SGNameDragTarget 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. This particular target is used for handling drags of NameGalllery items within their displayed list. It automatically handles drags with draginfo derived from BitmapDragInformation. Notes: Drag targets are destroyed automatically when a drag finishes by the drag manager with which they were registered. To remove a drag target at any time, destroy it - it automatically deregisters and cleans up. More...

#include <ngdrag.h>

Inheritance diagram for SGNameDragTarget:

SGListDragTarget SGListDragTarget KernelDragTarget KernelDragTarget DragTarget DragTarget ListItem ListItem CCObject CCObject SimpleCCObject SimpleCCObject List of all members.

Public Member Functions

 SGNameDragTarget (CGadgetID idGadget=0)
 Initialises a drag target for an item from the Name gallery.
 SGNameDragTarget ()
 Default constructor, required for dynamic creation.
 SGNameDragTarget (NameGallery *pGallery, CGadgetID idGadget=0)
 Initialises a drag target for an item from the Name gallery.

Protected Member Functions

virtual BOOL ProcessEvent (DragEventType nEvent, DragInformation *pDragInfo, OilCoord *pMousePos, KeyPress *pKeyPress)
 Event handler for SGNameItem gallery drag events. Overrides the base class handler to enable it to sort out the node being dragged for Name drags.
virtual BOOL ProcessEvent (DragEventType nEvent, DragInformation *pDragInfo, OilCoord *pMousePos, KeyPress *pKeyPress)
 Event Handler for SuperGallery listitem drag events.

Private Member Functions

 CC_DECLARE_DYNAMIC (SGNameDragTarget)

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. This particular target is used for handling drags of NameGalllery items within their displayed list. It automatically handles drags with draginfo derived from BitmapDragInformation. Notes: Drag targets are destroyed automatically when a drag finishes by the drag manager with which they were registered. To remove a drag target at any time, destroy it - it automatically deregisters and cleans up.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/7/99
See also:
SGListDragTarget; DragManagerOp::StartDrag; DragInformation; DragTarget; SGBitmapDragTarget::ProcessEvent

Definition at line 182 of file ngdrag.h.


Constructor & Destructor Documentation

SGNameDragTarget::SGNameDragTarget CGadgetID  idGadget = 0  ) 
 

Initialises a drag target for an item from the Name gallery.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/7/99
Parameters:
idGadget --- the gadget within that dialogue which is the target [INPUTS]

Definition at line 495 of file ngdrag.cpp.

00496   : SGListDragTarget(NameGallery::Instance(), idGadget)
00497 {
00498     // Empty.
00499 }

SGNameDragTarget::SGNameDragTarget  ) 
 

Default constructor, required for dynamic creation.

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

Definition at line 1454 of file sgname.cpp.

01455   : SGListDragTarget(0, 0)
01456 {
01457     // Empty.
01458 }

SGNameDragTarget::SGNameDragTarget NameGallery pGallery,
CGadgetID  idGadget = 0
 

Initialises a drag target for an item from the Name gallery.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
pGallery --- the instance of the Name gallery [INPUTS] idGadget --- the gadget within that dialogue which is the target

Definition at line 1472 of file sgname.cpp.

01473   : SGListDragTarget(pGallery, idGadget)
01474 {
01475     // Empty.
01476 }


Member Function Documentation

SGNameDragTarget::CC_DECLARE_DYNAMIC SGNameDragTarget   )  [private]
 

virtual BOOL SGNameDragTarget::ProcessEvent DragEventType  nEvent,
DragInformation pDragInfo,
OilCoord pMousePos,
KeyPress pKeyPress
[protected, virtual]
 

Event Handler for SuperGallery listitem drag events.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/3/95
Parameters:
Event - Indicates what has happened [INPUTS] pDragInfo - points to drag information describing this drag. This should be an SGListDragInfo or something has gone seriously wrong. pMousePos - points to information on the current mouse position, in OIL coords pKeyPress - NULL, or if for a keypress event, keypress information
Returns:
TRUE to claim the event, FALSE to let it through to other targets

Reimplemented from SGListDragTarget.

BOOL SGNameDragTarget::ProcessEvent DragEventType  nEvent,
DragInformation pDragInfo,
OilCoord pMousePos,
KeyPress pKeyPress
[protected, virtual]
 

Event handler for SGNameItem gallery drag events. Overrides the base class handler to enable it to sort out the node being dragged for Name drags.

BOOL SGNameDragTarget::ProcessEvent(DragEventType nEvent, DragInformation* pDragInfo, OilCoord* pMousePos, KeyPress* pKeyPress)

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/7/99
Parameters:
nEvent --- indicates what has happened [INPUTS] pDragInfo --- points to drag information describing this drag. This should be a BitmapDragInformation or derivation thereof pMousePos --- points to information on the current mouse position, in OIL coords pKeyPress --- NULL, or if for a keypress event, keypress information
Returns:
TRUE to claim the event, FALSE to let it through to other targets

Reimplemented from SGListDragTarget.

Definition at line 520 of file ngdrag.cpp.

00522 {
00523     ERROR3IF(!pDragInfo->IS_KIND_OF(SGNameDrag),
00524                 "SGNameDragTarget::ProcessEvent: wrong kind of DragInfo");
00525 
00526     SGDisplayNode* pDraggedNode = ((SGNameDrag*) pDragInfo)->GetDraggedNameAttr();
00527     if (pDraggedNode == 0) return FALSE;
00528 
00529     switch (nEvent)
00530     {
00531     case DRAGEVENT_COMPLETED:
00532         // Drag just one item.
00533         HandleDragCompleted((NameGallery*) TargetDialog, pDraggedNode, pMousePos, TRUE);
00534         return TRUE;
00535 
00536     case DRAGEVENT_MOUSEMOVED:
00537     case DRAGEVENT_MOUSESTOPPED:
00538     case DRAGEVENT_MOUSEIDLE:
00539         return DetermineCursorShape((NameGallery*) TargetDialog, pDraggedNode, pMousePos);
00540     }
00541 
00542     // Not interested in any other event so don't claim it.
00543     return FALSE;
00544 }


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