SGBitmapDragTarget 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 <sgbitmap.h>

Inheritance diagram for SGBitmapDragTarget:

SGListDragTarget KernelDragTarget DragTarget ListItem CCObject SimpleCCObject List of all members.

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

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:
25/3/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 184 of file sgbitmap.h.


Constructor & Destructor Documentation

SGBitmapDragTarget::SGBitmapDragTarget DialogOp TheDialog,
CGadgetID  TheGadget = NULL
 

Constructor.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/3/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 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 }


Member Function Documentation

BOOL SGBitmapDragTarget::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 Bitmap drags.

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

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/3/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 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 }


Friends And Related Function Documentation

friend class DragManagerOp [friend]
 

Reimplemented from SGListDragTarget.

Definition at line 186 of file sgbitmap.h.


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