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

CViewSink

Methods Index

Heritage
Description
Usage
Override
Protected Data Members
Public Methods
Constructor, Destructor, and Initializer Methods
Drag and Drop Event Methods

CViewSink


Heritage

Superclass: CViewSink

Subclasses: None


Description

The purpose of CViewSink is to provide a simple implementation of CDragSink using DSC++ views as sinks.


Usage

A CViewSink is used to propagate drag-and-drop events to a specific view. The sink sends a DoCommand() message to its view for each of the following events:

You can choose the command that should be generated for each of these events by calling SetCommands(). Bundled with each command, the sink sends a pointer to a CViewSinkData object. CViewSinkData encapsulates the following drag-and-drop data:

CViewSink* itsSink; Sink generating the command
long itsDragCommand; Command supplied to the drag source
void* itsDragData; Data supplied to the drag source
CPoint itsMouseLocation; Mouse location relative to Task_Win
short itsMouseButton; Mouse button currently pressed
BOOLEAN itIsShift; Is the shift key pressed?
BOOLEAN itIsControl; Is the control key pressed?


Override

You may override IsInSink() to fine tune sink location within the view itself. The current implementation treats the entire view as a sink.

None


Protected Data Members

CView *itsView; View managed by the sink
long itsDropCommand; Sent to itsView on a drop event
long itsEnterCommand; Sent to itsView on an enter event
long itsLeaveCommand; Sent to itsView on a leave event
long itsDragCommand; Sent to itsView on a drag event


Public Methods

Constructor, Destructor, and Initializer Methods

CViewSink(
CView* theView,
long theDropCommand,
long theEnterCommand = NULLcmd,
long theLeaveCommand = NULLcmd,
long theDragCommand = NULLcmd);
CViewSink(const CViewSink& theSink);			
CViewSink& operator=(const CViewSink &theSink);
virtual ~CViewSink();
void SetSinkCommands(
long theDropCommand,
long theEnterCommand = NULLcmd,
long theLeaveCommand = NULLcmd,
long theDragCommand = NULLcmd);
long GetDropCommand() const; long GetEnterCommand() const; long GetLeaveCommand() const; long GetDragCommand() const;
void SetView(CView* theView);
CView* GetView(void) const;
virtual BOOLEAN IsInSink(CPoint theLocation);

Drag and Drop Event Methods

virtual void DoDrop(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData);
virtual void DoEnter(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData);
virtual void DoLeave(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData);
virtual void DoDrag(
CPoint theLocation,
short theButton,
BOOLEAN isShift,
BOOLEAN isControl,
long theDragCommand,
void* theDragData);

CViewSink* itsSink; Sink generating the command
long itsDragCommand; Command supplied to the drag source
void* itsDragData; Data supplied to the drag source
CPoint itsMouseLocation; Mouse location relative to Task_Win
short itsMouseButton; Mouse button currently pressed
BOOLEAN itIsShift; Is the shift key pressed?
BOOLEAN itIsControl; Is the control key pressed?

virtual CView* GetOwner(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.