| Methods Index |
Subclasses:
CViewSinkHelper Class:
CDragSource
CDragSink provides a generic interface to a drag sink (a.k.a. "drop site") which may be registered with a CDragSource, and receive notification of enter, leave, drag, and drop events.
The
IsInSink() method must return TRUE if theLocation is "in" the sink, and FALSE if theLocation is not "in" the sink. The meaning of "in" the sink is left to the specific implementation.When registered with a
CDragSource, instances of this class are notified when a dragging item enters, drags, drops, or leaves the sink (as defined by IsInSink()). CDragSource calls DoEnter, DoDrag, DoDrop, and DoLeave, respectively, to notify the drag sink of the above listed events.
CDragSource and CDragSink have a many-to-many association: a source can service zero or more sinks, and a sink can be registered with zero or more sources. This association is automatically managed: destruction of a sink automatically unregisters it with a source. In addition, destruction of a source unregisters all of its sinks and destroys those not registered with another drag source.For useful implementation of a
CDragSink, see the CViewSink class.
|
|
|
|
RWGSlist(CDragSource)
|
itsSources;
| List of sources where sink is registered |
virtual ~CDragSink();
CDragsSources it was registered with.
virtual BOOLEAN IsInSink(CPoint theLocation) = 0;
TRUE if theLocation represents a coordinate inside the sink area. The position passed in is in Task Window relative coordinates.
virtual void DoDrop(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData) = 0; virtual void DoEnter(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData) = 0; virtual void DoLeave(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData) = 0; virtual void DoDrag(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData) = 0;
CDragSource, instances of this class are notified when a dragging item enters, drags, drops, or leaves the sink (as defined by IsInSink()). CDragSource calls DoEnter, DoDrag, DoDrop, and DoLeave, respectively, to notify the drag sink of the above listed events.
virtual CView* GetOwner(void) = 0;
CDragSink(void);