#include <sgbitmap.h>
Inheritance diagram for SGBitmapDragTarget:
Public Member Functions | |
SGBitmapDragTarget (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 Bitmap 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 184 of file sgbitmap.h.
|
Constructor.
Definition at line 202 of file sgbitmap.cpp. 00203 : SGListDragTarget(TheDialog, TheGadget) 00204 { 00205 ERROR3IF(!TheDialog->IsKindOf(CC_RUNTIME_CLASS(BitmapSGallery)), 00206 "You can only use SGBitmapDragTargets with BitmapSGallery dialogues!"); 00207 }
|
|
Event Handler for SuperGallery listitem drag events. Overrides the base class handler to enable it to sort out the node being dragged for Bitmap drags. BOOL SGBitmapDragTarget::ProcessEvent(DragEventType Event, DragInformation *pDragInfo, OilCoord *pMousePos, KeyPress* pKeyPress)
Reimplemented from SGListDragTarget. Definition at line 232 of file sgbitmap.cpp. 00234 { 00235 if (!pDragInfo->IsKindOf(CC_RUNTIME_CLASS(BitmapDragInformation))) 00236 return(FALSE); 00237 00238 SGDisplayNode *DraggedNode = NULL; 00239 BOOL IsSimpleBitmapDrag = TRUE; // Only one bitmap is being dragged 00240 00241 if (IS_A(pDragInfo, GalleryBitmapDragInfo)) 00242 { 00243 DraggedNode = ((GalleryBitmapDragInfo *)pDragInfo)->GetDraggedBitmap(); 00244 00245 IsSimpleBitmapDrag = FALSE; // We started the drag, so we will accept multiple 00246 // bitmaps being dragged in a single operation 00247 } 00248 00249 if (DraggedNode != NULL) 00250 { 00251 switch(Event) 00252 { 00253 case DRAGEVENT_COMPLETED: 00254 HandleDragCompleted((SuperGallery *) TargetDialog, 00255 DraggedNode, pMousePos, IsSimpleBitmapDrag); 00256 return(TRUE); 00257 00258 00259 case DRAGEVENT_MOUSESTOPPED: 00260 case DRAGEVENT_MOUSEMOVED: 00261 case DRAGEVENT_MOUSEIDLE: 00262 // Call a subroutine to work out and set our current cursor shape 00263 return(DetermineCursorShape((SuperGallery *) TargetDialog, 00264 DraggedNode, pMousePos)); 00265 default: 00266 break; 00267 } 00268 } 00269 // Otherwise, we aren't interested in the event, so we don't claim it 00270 return(FALSE); 00271 }
|
|
Reimplemented from SGListDragTarget. Definition at line 186 of file sgbitmap.h. |