SGLineDragTarget 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 <sgldrag.h>

Inheritance diagram for SGLineDragTarget:

SGListDragTarget KernelDragTarget DragTarget ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SGLineDragTarget (DialogOp *TheDialog, CGadgetID TheGadget=NULL)
 Constructor.

Protected Member Functions

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

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:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
This particular target is used for handling drags of BitmapSGalllery items within their displayed list. It automatically handles drags with draginfo derived from BitmapDragInformation.

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; SGBitmapDragTarget::ProcessEvent
Documentation: Docs.doc; Docs.doc

Definition at line 185 of file sgldrag.h.


Constructor & Destructor Documentation

SGLineDragTarget::SGLineDragTarget DialogOp TheDialog,
CGadgetID  TheGadget = NULL
 

Constructor.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
TheDialog - The kernel dialog in which the target exists [INPUTS] TheGadget - The gadget within that dialogue which is the target

Definition at line 144 of file sgldrag.cpp.

00145                     : SGListDragTarget(TheDialog, TheGadget)
00146 {
00147     ERROR3IF(!TheDialog->IsKindOf(CC_RUNTIME_CLASS(LineGallery)),
00148             "You can only use SGLineDragTargets with LineGallery dialogues!");
00149 }


Member Function Documentation

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

Event Handler for SuperGallery listitem drag events. Overrides the base class handler to enable it to sort out the node being dragged for Line drags.

BOOL SGLineDragTarget::ProcessEvent(DragEventType Event, DragInformation *pDragInfo, OilCoord *pMousePos, KeyPress* pKeyPress)

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
Event - 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 174 of file sgldrag.cpp.

00176 {
00177     if (!pDragInfo->IsKindOf(CC_RUNTIME_CLASS(GalleryLineDragInfo)))
00178         return(FALSE);
00179 
00180     SGDisplayNode *DraggedNode = NULL;
00181     BOOL IsSimpleBitmapDrag = TRUE;
00182 
00183     if (IS_A(pDragInfo, GalleryLineDragInfo))
00184     {
00185         DraggedNode = ((GalleryLineDragInfo *)pDragInfo)->GetDraggedLineAttr();
00186     }
00187 
00188     if (DraggedNode != NULL)
00189     {
00190         switch(Event)
00191         {
00192             case DRAGEVENT_COMPLETED:
00193                 HandleDragCompleted((SuperGallery *) TargetDialog,
00194                                     DraggedNode, pMousePos, IsSimpleBitmapDrag);
00195                 return(TRUE);
00196 
00197 
00198             case DRAGEVENT_MOUSESTOPPED:
00199             case DRAGEVENT_MOUSEMOVED:
00200             case DRAGEVENT_MOUSEIDLE:
00201                 // Call a subroutine to work out and set our current cursor shape
00202                 return(DetermineCursorShape((SuperGallery *) TargetDialog,
00203                                             DraggedNode, pMousePos));
00204             default:
00205                 break;
00206         }
00207     }
00208 
00209     // Otherwise, we aren't interested in the event, so we don't claim it
00210     return(FALSE);
00211 }


Friends And Related Function Documentation

friend class DragManagerOp [friend]
 

Reimplemented from SGListDragTarget.

Definition at line 187 of file sgldrag.h.


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