[Classes] [Prev] [Next] [Methods]

CDragSink

Methods Index

Heritage
Description
Usage
Protected Data Members
Overrides
Public Methods
Mouse Event Methods
Utility Methods
Protected Methods

CDragSink


Heritage

Superclass: None

Subclasses: CViewSink

Helper Class: CDragSource


Description

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.


Usage

This is an abstract class which defines interface only. To make use of it, you must instantiate one of its subclasses.

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.


Protected Data Members

RWGSlist(CDragSource) itsSources; List of sources where sink is registered


Overrides


Public Methods

virtual ~CDragSink();
virtual BOOLEAN IsInSink(CPoint theLocation) = 0;

Mouse Event Methods

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;

Utility Methods

virtual CView* GetOwner(void) = 0;

Protected Methods

CDragSink(void);


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.