#include <sgldrag.h>
Inheritance diagram for SGLineDragTarget:
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 |
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.
Definition at line 185 of file sgldrag.h.
|
Constructor.
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 }
|
|
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)
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 }
|
|
Reimplemented from SGListDragTarget. |