KernelDragTarget 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. KernelDragTargets are used as a base class from which to derive drag targets for KERNEL entities (usually a DialogOp and optional Gadget ID). More...

#include <dragtrgt.h>

Inheritance diagram for KernelDragTarget:

DragTarget ListItem CCObject SimpleCCObject ColEditorDragTarget SGListDragTarget SGScrollDragTarget SGBitmapDragTarget SGClipartDragTarget SGColourDragTarget SGFillsDragTarget SGFontsDragTarget SGLineDragTarget SGNameDragTarget SGNameDragTarget List of all members.

Public Member Functions

 KernelDragTarget (DialogOp *TheDialog, CGadgetID TheGadget=NULL)
 Constructs a KernelDragTarget, AND REGISTERS it with the current DragManagerOp This is used as a drag target for entities existing in the kernel (usually DialogOps).
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, OilCoord *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 (DialogOp **ReturnedDialog, CGadgetID *ReturnedGadget)
 Kernel method for determining target-area information.

Protected Attributes

DialogOpTargetDialog
CGadgetID TargetGadget

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. KernelDragTargets are used as a base class from which to derive drag targets for KERNEL entities (usually a DialogOp and optional Gadget ID).

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 300 of file dragtrgt.h.


Constructor & Destructor Documentation

KernelDragTarget::KernelDragTarget DialogOp TheDialog,
CGadgetID  TheGadget = NULL
 

Constructs a KernelDragTarget, AND REGISTERS it with the current DragManagerOp This is used as a drag target for entities existing in the kernel (usually DialogOps).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/1/95
Parameters:
TheDialog - NULL (see Notes), or the kernel DialogOp providing the drag target [INPUTS] TheGadget - NULL (see Notes), or the ID of the gadget within that dialogue which is the drag 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). It is not expected that kernel drag processors will be used in this way

If TheGadget is NULL, then the entire dialogue client area will be considered the target area. Otherwise, only that gadget is used as the target.

See also:
OilDragTarget::OilDragTarget; DragManagerOp
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)
Documentation: Docs.doc

Definition at line 396 of file dragtrgt.cpp.

00397 {
00398     TargetDialog = TheDialog;
00399     TargetGadget = TheGadget;
00400 
00401 //  PORTNOTE("other", "Removed DragManagerOp usage")
00402 //#ifndef EXCLUDE_FROM_XARALX
00403     // Register this drag target automatically with the system
00404     DragManagerOp *DragMan = DragManagerOp::GetCurrentManager();
00405     if (DragMan != NULL)
00406         DragMan->RegisterTarget(this, (TheDialog == NULL));
00407 #ifdef _DEBUG
00408     else
00409         ERROR3("There is no active drag (when attempting to create a DragTarget)");
00410 #endif
00411 //#endif
00412 }


Member Function Documentation

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

Kernel 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
Documentation: Docs.doc

Reimplemented from DragTarget.

Definition at line 495 of file dragtrgt.cpp.

00496 {
00497     *ReturnedDialog = TargetDialog;
00498     *ReturnedGadget = TargetGadget;
00499 }

BOOL KernelDragTarget::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

Documentation: Docs.doc

Reimplemented from DragTarget.

Definition at line 434 of file dragtrgt.cpp.

00435 {
00436     return(TRUE);
00437 }

BOOL KernelDragTarget::ProcessEvent DragEventType  Event,
DragInformation pDragInfo,
OilCoord 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 OilCoords (Millipoint offsets within the drag target window/gadget) 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 kernel parts of this interface!

See also:
keyword DragEventType
Documentation: Docs.doc

Reimplemented from DragTarget.

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

Definition at line 470 of file dragtrgt.cpp.

00472 {
00473     return(FALSE);      // We do not claim the event
00474 }


Friends And Related Function Documentation

friend class DragManagerOp [friend]
 

Reimplemented from DragTarget.

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

Definition at line 302 of file dragtrgt.h.


Member Data Documentation

DialogOp* KernelDragTarget::TargetDialog [protected]
 

Definition at line 327 of file dragtrgt.h.

CGadgetID KernelDragTarget::TargetGadget [protected]
 

Definition at line 328 of file dragtrgt.h.


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