Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_M_DragTarget Class Reference

Class used in drag and drop to provide a drag target.

Inheritance diagram for CP_M_DragTarget:

CP_View_Imp CP_View CP_BackgroundView CP_FocusBorder CP_LittleArrowsEditBuddy CP_OpenGLView CP_PlatformControl CP_PrintView CP_QT_MovieView CP_ScrollableView CP_Scroller CP_SelectColorButton CP_Splitter CP_TextView CP_Toolbar CP_Window_Imp CP_Window_Imp CP_Window_Imp List of all members.

Drag Target

virtual void OnDragEnter (CP_DragDrop &inDragDrop, bool inDragHasLeftSender)
virtual void OnDragLeave (CP_DragDrop &inDragDrop)
virtual void OnDragTrack (CP_DragDrop &inDragDrop)
static CP_M_DragTargetFindDragTarget (OSWindow inOSWindow, CP_Point &inMouseLocation, CP_DragDrop &inDragDrop)

Public Member Functions

virtual void HandleDragReceive (CP_DragDrop &)
void SetTargetWindow (OSWindow inWindow)
virtual void OnDragEnter (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
virtual void OnDragOver (DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
virtual void OnDragLeave ()
virtual void OnDrop (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
CP_Point GetDropPoint ()
Constructor / Destructor
 CP_M_DragTarget ()
 Constructor.
virtual ~CP_M_DragTarget () throw ()
 Destructor.

Protected Member Functions

virtual bool OnCanAcceptDrag (UInt32 inItem, CP_DragDrop &inDragDrop)=0
virtual CP_Region GetDropRegion ()=0
virtual bool PtInDropArea (CP_Point &inGlobalPoint)
virtual bool OnCanAcceptDragWin (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)

Protected Attributes

CP_WindowfWindow
bool fDropAreaIsHilited
bool fCanAcceptCurrentDrag
OSWindow fTargetWindow
CDropTargetfDropTarget
CP_Point fDropPoint

Static Protected Attributes

static CP_DragTarget_ListfsDragTargetList = NULL
static CP_M_DragTargetfsCurrentDragTarget = NULL
static bool fsDragHasLeftSender = false

Constructor & Destructor Documentation

CP_M_DragTarget::CP_M_DragTarget  ) 
 

Constructor.

Exceptions:
none 

CP_M_DragTarget::~CP_M_DragTarget  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

void CP_M_DragTarget::AddDragTarget CP_M_DragTarget inDragTarget,
CP_Window inWindow
 

Adds the passed in CP_M_DragTarget to the global list of drag targets that this object maintains. This is the list of objects that get checked during a drag and drop operation to see if the object can receive the dropped object when the mouse if over the target object.

Parameters:
inDragTarget The object that can be the receipient of a drag and drop operation.
inWindow The window that contains the drag target.
Exceptions:
none 

void CP_M_DragTarget::RemoveDragTarget CP_M_DragTarget inDragTarget,
CP_Window inWindow
 

Removes a previously added CP_M_DragTarget object. This is called for you automatically when aa CP_M_DragTarget object is destroyed. However you can call this at other times, if you want to remove an object as a postential drop target for drag and drops.

Parameters:
inDragTarget The object that is going to be removed.
inWindow The window that contains the drag target.
Exceptions:
none 

virtual void CP_M_DragTarget::HandleDragReceive CP_DragDrop  )  [virtual]
 

Reimplemented in CP_View_Imp.

bool CP_M_DragTarget::CanAcceptDrag CP_DragDrop inDragDrop  ) 
 

Screen location where drop occurred.

void CP_M_DragTarget::HiliteDropArea CP_DragDrop inDragDrop  )  [virtual]
 

Called when the drag enters a new drop area. This is used to show the MacOS default drag hiliting.

Parameters:
inDragDrop The CP_DragDrop object that is performing the drag and drop.
Exceptions:
none 
Returns:
void

void CP_M_DragTarget::UnhiliteDropArea CP_DragDrop inDragDrop  )  [virtual]
 

Called when the drag leaves a drop area. This is used to remove the MacOS default drag hiliting.

Parameters:
inDragDrop The CP_DragDrop object that is performing the drag and drop.
Exceptions:
none 
Returns:
void

pascal::OSErr CP_M_DragTarget::HandleDragTrackingCallback DragTrackingMessage  inMessage,
WindowPtr  inOSWindow,
void *  inRefCon,
DragReference  inDragRef
[static, protected]
 

Callback to the MacOS Drag Manager that is called during a drag and drop tracking operation.

Parameters:
inMessage The message or reason that this callback was called.
inOSWindow The MacOS window that the drag is ocurring in.
inRefCon Not used.
inDragRef The Drag Manager DragReference for this drag and drop.
Exceptions:
none 
Returns:
OSErr The result of this operation.

pascal OSErr CP_M_DragTarget::HandleDragReceiveCallback WindowPtr  inOSWindow,
void *  inRefCon,
DragReference  inDragRef
[static, protected]
 

Callback to the MacOS Drag Manager when the user has dropped an object over a drag target.

Parameters:
inOSWindow The MacOS window that the drop occured over.
inRefCon Not used.
inDragRef The Drag Manager DragReference for this drag and drop.
Exceptions:
none 
Returns:
OSErr The result of this operation.

CP_M_DragTarget * CP_M_DragTarget::FindDragTarget OSWindow  inOSWindow,
CP_Point inMouseLocation,
CP_DragDrop inDragDrop
[static, protected]
 

Finds and returns the CP_M_DragTarget that is in the passed in OSWindow at the passed in mouse location. The mouse location is in global coordinates.

If no target was found at the passed in location, then NULL is returned.

Parameters:
inOSWindow The MacOS window that the mouse is over.
inMouseLocation Global location of the mouse.
inDragDrop The CP_DragDrop object that is performing the drag and drop.
Exceptions:
none 
Returns:
CP_M_DragTarget * The object that was registered to handle a drag and drop at the passed in mouse location. NULL is returned if no target object was found.

void CP_M_DragTarget::OnDragEnter CP_DragDrop inDragDrop,
bool  inDragHasLeftSender
[protected, virtual]
 

Called when the user has entered a registered drag target object.

Parameters:
inDragDrop The CP_DragDrop object that is performing the drag and drop.
inDragHasLeftSender Flag to indicate if the drag operation has left the sending object, and is now in another object.
Exceptions:
none 
Returns:
void

void CP_M_DragTarget::OnDragLeave CP_DragDrop inDragDrop  )  [protected, virtual]
 

Called when the user is has left the current drag target object.

Parameters:
inDragDrop The CP_DragDrop object that is performing the drag and drop.
Exceptions:
none 
Returns:
void

void CP_M_DragTarget::OnDragTrack CP_DragDrop inDragDrop  )  [protected, virtual]
 

Called when the user is tracking or moving the mouse during a drag and drop operationn.

Parameters:
inDragDrop The CP_DragDrop object that is performing the drag and drop.
Exceptions:
none 
Returns:
void

virtual bool CP_M_DragTarget::OnCanAcceptDrag UInt32  inItem,
CP_DragDrop inDragDrop
[protected, pure virtual]
 

virtual CP_Region CP_M_DragTarget::GetDropRegion  )  [protected, pure virtual]
 

Implemented in CP_View_Imp.

bool CP_M_DragTarget::PtInDropArea CP_Point inGlobalPoint  )  [protected, virtual]
 

Returns true if the passed in global point is over this drag target.

Parameters:
inGlobalPoint The location of the mouse in global coordinates to test against. The default implmentation gets the drop region for the target, and compares the location to the drop region.
Exceptions:
none 
Returns:
bool Returns true if the passed in point is over the drop region for this drag target.

void CP_M_DragTarget::HandleTrackInWindow WindowPtr  inOSWindow,
CP_DragDrop inDragDrop
[static, protected]
 

Called when the user is dragging an object around in a window. This is called from the MacOS Drag Manager callback.

Parameters:
inOSWindow The MacOS window that the user is dragging an object over.
inDragDrop The CP_DragDrop object that is performing the drag and drop.
Exceptions:
none 
Returns:
void

void CP_M_DragTarget::SetTargetWindow OSWindow  inWindow  ) 
 

Register a Windows HWND as a possible target for dropping objects onto.

Parameters:
inWindow - the Windows HWND that is to be the target.

void CP_M_DragTarget::OnDragEnter LPDATAOBJECT  pIDataSource,
DWORD  grfKeyState,
POINTL  pt,
LPDWORD  pdwEffect
[virtual]
 

Called when we are entering a new drag target.

void CP_M_DragTarget::OnDragOver DWORD  grfKeyState,
POINTL  pt,
LPDWORD  pdwEffect
[virtual]
 

Called while we are dragging over the target object.

void CP_M_DragTarget::OnDragLeave  )  [virtual]
 

Called when we leave the current target.

void CP_M_DragTarget::OnDrop LPDATAOBJECT  pIDataSource,
DWORD  grfKeyState,
POINTL  pt,
LPDWORD  pdwEffect
[virtual]
 

Called when the data is dropped onto the target object. Subclasses need to override this method.

CP_Point CP_M_DragTarget::GetDropPoint  ) 
 

bool CP_M_DragTarget::OnCanAcceptDragWin LPDATAOBJECT  pIDataSource,
DWORD  grfKeyState,
POINTL  pt,
LPDWORD  pdwEffect
[protected, virtual]
 

Return true if this object can accept the dropped data. Subclasses need to override.


Member Data Documentation

CPLAT_Begin_Namespace_CPLAT CP_DragTarget_List * CP_M_DragTarget::fsDragTargetList = NULL [static, protected]
 

CP_M_DragTarget * CP_M_DragTarget::fsCurrentDragTarget = NULL [static, protected]
 

bool CP_M_DragTarget::fsDragHasLeftSender = false [static, protected]
 

CP_Window* CP_M_DragTarget::fWindow [protected]
 

bool CP_M_DragTarget::fDropAreaIsHilited [protected]
 

bool CP_M_DragTarget::fCanAcceptCurrentDrag [protected]
 

OSWindow CP_M_DragTarget::fTargetWindow [protected]
 

CDropTarget* CP_M_DragTarget::fDropTarget [protected]
 

Windows HWND for the target.

CP_Point CP_M_DragTarget::fDropPoint [protected]
 

OLE drop target interface object.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:49 2005 for CPLAT by  doxygen 1.4.0