OilDragTarget Class Reference

An instantiation of this class is created by each entity which wishes to provide a 'destination' to which the mouse can go to complete a drag. OilDragTargets are used as a base class from which to derive drag targets for WINOIL entities (an optional HWND). More...

#include <dragtrgt.h>

Inheritance diagram for OilDragTarget:

DragTarget ListItem CCObject SimpleCCObject ColourLineDragTarget EditButtonDragTarget ViewDragTarget List of all members.

Public Member Functions

 OilDragTarget (wxWindow *TheWindow, wxRect *ClientArea=NULL)
 Constructs a OilDragTarget AND REGISTERS it with the current DragManagerOp This is used as a drag target for entities existing in the winoil (usually windows/controls).
virtual BOOL IsAKernelObject (void)
 Virtual method to determine if a given DragTarget is of the Kernel or Winoil 'gender'.

Protected Member Functions

virtual BOOL ProcessEvent (DragEventType Event, DragInformation *pDragInfo, wxPoint *pMousePos, KeyPress *pKeyPress)
 To process a drag-specific event. By default this method does nothing, just returning FALSE so that the event is left unclaimed, and is thus passed on to other interested drag targets.
virtual void GetTargetAreaInfo (wxWindow **ReturnedHWnd, wxRect *ReturnedTargetRect)
 Winoil method for determining target-area information.

Protected Attributes

wxWindow * TargetHWnd
wxRect TargetClientArea

Friends

class DragManagerOp

Detailed Description

An instantiation of this class is created by each entity which wishes to provide a 'destination' to which the mouse can go to complete a drag. OilDragTargets are used as a base class from which to derive drag targets for WINOIL entities (an optional HWND).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/1/95
Notes: Drag targets are destructed automatically when a drag finishes by the drag manager with which they were registered.

To remove a drag target at any time, destruct it - it automatically deregisters and cleans up.

See also:
DragManagerOp::StartDrag; DragInformation; DragTarget
Documentation: Docs.doc

Definition at line 358 of file dragtrgt.h.


Constructor & Destructor Documentation

OilDragTarget::OilDragTarget wxWindow *  TheWindow,
wxRect *  ClientArea = NULL
 

Constructs a OilDragTarget AND REGISTERS it with the current DragManagerOp This is used as a drag target for entities existing in the winoil (usually windows/controls).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/1/95
Parameters:
TheWindow - the winoil hWnd of the window to be used as the drag target [INPUTS] area. This may be NULL (see Notes). ClientArea - NULL (see Notes), or the window client-coordinates of a rectangle within TheWindow of the target area.
Notes: If both parameters are NULL, then this DragTarget is not associated with any particular area of the screen, and will recieve all drag events (that are not claimed by another such global event processor).

If ClientArea is NULL, then the entire window client area will be considered the target area. Otherwise, only that specified region within the window client area is used as the target.

Returns:
Errors: In debug builds, an ERROR3 will occur if there is no active drag manager (no drag occurring), and the DragTarget will probably appear as a memory leak (as the Drag manager is normally responsible for deleting the drag targets registered with it)
See also:
OilDragTarget::OilDragTarget; DragManagerOp
Documentation: Docs.doc

Definition at line 554 of file dragtrgt.cpp.

00555 {
00556     TargetHWnd = TheWindow;
00557 
00558     if (ClientArea == NULL)
00559     {
00560         // Get whole window rectangle in client coords
00561         //TargetClientArea = CRect(0, 0, 32000, 32000); // !!!! **** ToDo
00562         TargetClientArea = TheWindow->GetClientSize();
00563     }
00564     else
00565         TargetClientArea = *ClientArea;
00566 
00567 //  PORTNOTE("other", "Removed DragManagerOp usage")
00568 //#ifndef EXCLUDE_FROM_XARALX
00569     // Register this drag target automatically with the system
00570     DragManagerOp *DragMan = DragManagerOp::GetCurrentManager();
00571     if (DragMan != NULL)
00572         DragMan->RegisterTarget(this, (TheWindow == NULL));
00573 #ifdef _DEBUG
00574     else
00575         ERROR3("There is no active drag (when attempting to create a DragTarget)");
00576 #endif
00577 //#endif
00578 }


Member Function Documentation

void OilDragTarget::GetTargetAreaInfo wxWindow **  ReturnedHWnd,
wxRect *  ReturnedTargetRect
[protected, virtual]
 

Winoil method for determining target-area information.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/95
Parameters:
ReturnedHWnd - Filled in with the window [OUTPUTS] ReturnedTargetRect - Filled in with the target area rectangle in that window
Documentation: Docs.doc

Reimplemented from DragTarget.

Definition at line 662 of file dragtrgt.cpp.

00663 {
00664     *ReturnedHWnd = TargetHWnd;
00665     *ReturnedTargetRect = TargetClientArea;
00666 }

BOOL OilDragTarget::IsAKernelObject void   )  [virtual]
 

Virtual method to determine if a given DragTarget is of the Kernel or Winoil 'gender'.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/1/95
Returns:
FALSE (This is a winoil object, not a kernel one)
Notes: Don't override this! Derive from KernelDragTarget or OilDragTarget

Documentation: Docs.doc

Reimplemented from DragTarget.

Definition at line 600 of file dragtrgt.cpp.

00601 {
00602     return(FALSE);
00603 }

BOOL OilDragTarget::ProcessEvent DragEventType  Event,
DragInformation pDragInfo,
wxPoint *  pMousePos,
KeyPress pKeyPress
[protected, virtual]
 

To process a drag-specific event. By default this method does nothing, just returning FALSE so that the event is left unclaimed, and is thus passed on to other interested drag targets.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/1/95
Parameters:
Event - Specifies what type of event has occurred [INPUTS] pDragInfo - Specifies a descriptor describing the currently active drag pMousePos - Specifies the last known mouse coordinates, in terms of client area coordinates within the drag target window (or screen coordinates if no window was specified on registering) pKeyPress - NULL, or a pointer to the key pressed (for KEYPRESS events)
Notes: Each derived DragTarget class should override this method to handle events in a manner appropriate for the target.

BE VERY CAREFUL to only override the winoil parts of this interface!

See also:
keyword DragEventType
Documentation: Docs.doc

Reimplemented from DragTarget.

Reimplemented in ViewDragTarget, EditButtonDragTarget, ColourLineDragTarget, and ViewDragTarget.

Definition at line 637 of file dragtrgt.cpp.

00639 {
00640     return(FALSE);      // We do not claim the event
00641 }


Friends And Related Function Documentation

friend class DragManagerOp [friend]
 

Reimplemented from DragTarget.

Reimplemented in ViewDragTarget, EditButtonDragTarget, and ColourLineDragTarget.

Definition at line 360 of file dragtrgt.h.


Member Data Documentation

wxRect OilDragTarget::TargetClientArea [protected]
 

Definition at line 386 of file dragtrgt.h.

wxWindow* OilDragTarget::TargetHWnd [protected]
 

Definition at line 385 of file dragtrgt.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:57:19 2007 for Camelot by  doxygen 1.4.4