DragTarget 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. More...

#include <dragtrgt.h>

Inheritance diagram for DragTarget:

ListItem CCObject SimpleCCObject KernelDragTarget OilDragTarget ColEditorDragTarget SGListDragTarget SGScrollDragTarget ColourLineDragTarget EditButtonDragTarget ViewDragTarget SGBitmapDragTarget SGClipartDragTarget SGColourDragTarget SGFillsDragTarget SGFontsDragTarget SGLineDragTarget SGNameDragTarget SGNameDragTarget List of all members.

Public Member Functions

virtual BOOL IsAKernelObject (void)
 Virtual method to determine if a given DragTarget is of the Kernel or Winoil 'gender'.
BOOL WantsAllEvents (void)
 To determine if a given dragtarget wants events to be passed to it if the mouse pointer is outside the target area - This is only necessary for targets which supply a target window area. It is also not necessary for some events (e.g. INITIALISE, DEINITIALISE) which are always delivered, regardless of the pointer position.

Protected Member Functions

 DragTarget ()
 To ERROR3 if you are dumb enough to call the default constructor.
 ~DragTarget ()
 Destructor Ensures that this drag target is no longer registered with any drag manager. i.e. if you want to remove a target during a drag, just destruct it.
virtual BOOL ProcessEvent (DragEventType Event, DragInformation *pDragInfo, OilCoord *pMousePos, KeyPress *pKeyPress)
 Kernel-style ProcessEvent interface The KernelDragTarget overrides this method to handle kernel events. Non- kernel targets do not override this method, and thus give errors if called incorrectly.
virtual BOOL ProcessEvent (DragEventType Event, DragInformation *pDragInfo, wxPoint *pMousePos, KeyPress *pKeyPress)
 Winoil-style ProcessEvent interface The OilDragTarget overrides this method to handle winoil events. Non- winoil targets do not override this method, and thus give errors if called incorrectly.
virtual void GetTargetAreaInfo (DialogOp **ReturnedDialog, CGadgetID *ReturnedGadget)
 Winoil method for determining target-area information.
virtual void GetTargetAreaInfo (wxWindow **ReturnedHWnd, wxRect *ReturnedTargetRect)
 Winoil method for determining target-area information.
virtual UINT32 GetCursorID ()
 Base Method to set cursor over this target.
virtual BOOL GetStatusLineText (String_256 *TheText)
 


Protected Attributes

BOOL IWantAllEvents

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.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/1/95
Notes: IMPORTANT! The DragTarget class is the abstract base from which KernelDragTarget and OilDragTarget are derived. You should derive your class from one of these classes, NOT from DragTarget itself.

This class would be properly abstract (pure virtual methods) execept that IMPLEMENT_DYNAMIC screws that all up for us.

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

Definition at line 194 of file dragtrgt.h.


Constructor & Destructor Documentation

DragTarget::DragTarget  )  [protected]
 

To ERROR3 if you are dumb enough to call the default constructor.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/1/95
Documentation: Docs.doc

Definition at line 135 of file dragtrgt.cpp.

00136 {
00137     IWantAllEvents = FALSE;     // By default, targets only want events while the pointer
00138                                 // is over their target area
00139 }

DragTarget::~DragTarget  )  [protected]
 

Destructor Ensures that this drag target is no longer registered with any drag manager. i.e. if you want to remove a target during a drag, just destruct it.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/1/95
Documentation: Docs.doc

Definition at line 158 of file dragtrgt.cpp.

00159 {
00160     // Just ensure that this target is not still registered with the manager
00161     DragManagerOp *Mgr = DragManagerOp::GetCurrentManager();
00162     if (Mgr != NULL)
00163         Mgr->DeregisterTarget(this);
00164 }


Member Function Documentation

UINT32 DragTarget::GetCursorID void   )  [protected, virtual]
 

Base Method to set cursor over this target.

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/95

Reimplemented in ColEditorDragTarget, SGScrollDragTarget, SGListDragTarget, ViewDragTarget, EditButtonDragTarget, ColourLineDragTarget, and ViewDragTarget.

Definition at line 333 of file dragtrgt.cpp.

00334 {
00335      return _R(IDC_CANDROP);
00336 }

BOOL DragTarget::GetStatusLineText String_256 TheText  )  [protected, virtual]
 

Author:
Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/1/95
Returns:
a cursor ID to set during this drag

Reimplemented in ColEditorDragTarget, SGScrollDragTarget, SGListDragTarget, ViewDragTarget, EditButtonDragTarget, ColourLineDragTarget, and ViewDragTarget.

Definition at line 351 of file dragtrgt.cpp.

00352 {
00353     ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()");
00354     * TheText = String_256(_R(IDS_DROPSTATUSLINETEXT));
00355     return TRUE;
00356 }

void DragTarget::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
Notes: Generates an ERROR3 - must not be called (This method is overridden by OilDragTargets to supply the requested information)

Documentation: Docs.doc

Reimplemented in OilDragTarget.

Definition at line 284 of file dragtrgt.cpp.

00285 {
00286     *ReturnedHWnd = NULL;
00287     *ReturnedTargetRect = wxRect(0,0,0,0);
00288     ERROR3("DragTarget::GetTargetAreaInfo (WINOIL) -"
00289             " this is an illegal call on a KERNEL target!");
00290 }

void DragTarget::GetTargetAreaInfo DialogOp **  ReturnedDialog,
CGadgetID ReturnedGadget
[protected, virtual]
 

Winoil method for determining target-area information.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/1/95
Parameters:
ReturnedDialog - Filled in with a pointer to the dialogop of the target area [OUTPUTS] ReturnedGadget - Filled in with the gadget containing the target area
Notes: Generates an ERROR3 - must not be called (This method is overridden by KernelDragTargets to supply the requested information)

Documentation: Docs.doc

Reimplemented in KernelDragTarget.

Definition at line 313 of file dragtrgt.cpp.

00314 {
00315     *ReturnedDialog = NULL;
00316     *ReturnedGadget = 0;
00317     ERROR3("DragTarget::GetTargetAreaInfo (KERNEL) -"
00318             " this is an illegal call on a WINOIL target!");
00319 }

BOOL DragTarget::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:
TRUE (This is a kernel object, not a winoil one)
Notes: Don't override this! Derive from KernelDragTarget or OilDragTarget

This method gives an ERROR3 - you should not derive from/use DragTarget!

Documentation: Docs.doc

Reimplemented in KernelDragTarget, and OilDragTarget.

Definition at line 188 of file dragtrgt.cpp.

00189 {
00190     ERROR3("Somebody is using 'abstract' base class DragTarget!!!");
00191     return(TRUE);
00192 }

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

Winoil-style ProcessEvent interface The OilDragTarget overrides this method to handle winoil events. Non- winoil targets do not override this method, and thus give errors if called incorrectly.

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)
See also:
keyword DragEventType
Documentation: Docs.doc

Reimplemented in ViewDragTarget, EditButtonDragTarget, ColourLineDragTarget, OilDragTarget, and ViewDragTarget.

Definition at line 222 of file dragtrgt.cpp.

00224 {
00225     ERROR3("Illegal call to DragTarget::ProcessEvent - I'm not a WINOIL Target!");
00226     return(FALSE);      // We do not claim the event
00227 }

BOOL DragTarget::ProcessEvent DragEventType  Event,
DragInformation pDragInfo,
OilCoord pMousePos,
KeyPress pKeyPress
[protected, virtual]
 

Kernel-style ProcessEvent interface The KernelDragTarget overrides this method to handle kernel events. Non- kernel targets do not override this method, and thus give errors if called incorrectly.

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 OilCoords (Millipoint offsets within the drag target window/gadget) pKeyPress - NULL, or a pointer to the key pressed (for KEYPRESS events)
See also:
keyword DragEventType
Documentation: Docs.doc

Reimplemented in ColEditorDragTarget, SGNameDragTarget, SGBitmapDragTarget, SGColourDragTarget, SGScrollDragTarget, SGListDragTarget, SGClipartDragTarget, SGFillsDragTarget, SGNameDragTarget, KernelDragTarget, SGFontsDragTarget, and SGLineDragTarget.

Definition at line 256 of file dragtrgt.cpp.

00258 {
00259     ERROR3("Illegal call to DragTarget::ProcessEvent - I'm not a KERNEL Target!");
00260     return(FALSE);      // We do not claim the event
00261 }

BOOL DragTarget::WantsAllEvents void   )  [inline]
 

To determine if a given dragtarget wants events to be passed to it if the mouse pointer is outside the target area - This is only necessary for targets which supply a target window area. It is also not necessary for some events (e.g. INITIALISE, DEINITIALISE) which are always delivered, regardless of the pointer position.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/3/95
Notes: Targets which wish to recieve these events (e.g. scroll drags in galleries like to continue scrolling even if the pointer moves out of the window - the drag is used to "capture" the mouse) should set their member variable "IWantAllEvents" in their constructors.

If an event is claimed by another target, it will NOT be passed on to other targets, even if this method returns TRUE.

Definition at line 266 of file dragtrgt.h.

00267 {
00268     return(IWantAllEvents);
00269 }


Friends And Related Function Documentation

friend class DragManagerOp [friend]
 

Reimplemented in ColEditorDragTarget, SGBitmapDragTarget, SGColourDragTarget, SGScrollDragTarget, SGListDragTarget, SGClipartDragTarget, SGFillsDragTarget, ViewDragTarget, EditButtonDragTarget, ColourLineDragTarget, KernelDragTarget, OilDragTarget, SGFontsDragTarget, and SGLineDragTarget.

Definition at line 196 of file dragtrgt.h.


Member Data Documentation

BOOL DragTarget::IWantAllEvents [protected]
 

Definition at line 235 of file dragtrgt.h.


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