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

CViewSource

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Constructor, Destructor, and Initializer Methods
Utility Methods
Overridden Mouse Event Methods:

CViewSource


Heritage

Superclass: CDragSource

Subclasses: None

Helper Class: CViewSink


Description

This derivation of CDragSource automatically initiates a drag-and-drop event whenever the mouse is pressed and dragged over a specific view.


Usage

CViewSource is used in the same way as a normal CDragSource. The basic difference is that upon construction you specify the following:

Once constructed, all you need to do is register sinks with the CViewSource object. The class takes care of calling DoDrag() automatically when the mouse is pressed and dragged over the view.

Note: Since mouse events are not generated for CNativeViews, CViewSource will not effectively manage these types of views.


Protected Data Members

CView* itsView; The view tracked by this drag source
long itsDragCommand; Command generated with drag-drop events
void* itsDragData; Passed as theData of drag-drop events
CPoint itsDownPoint; Point within itsView where mouse is down
CPoint itsDragSensitivity; Minimum drag distance required for DoDrag call
CURSOR itsDragCursor; Cursor used during drag-drop
BOOLEAN itIsDown; Indicates mouse button state


Public Methods

Constructor, Destructor, and Initializer Methods

CViewSource(
CView* theView,
long theDragCommand,
void* theDragData,
CURSOR theDragCursor = CURSOR_ARROW);
CViewSource(const CViewSource& theCopy);
CViewSource& operator=(const CViewSource& theCopy);
virtual ~CViewSource();

Utility Methods

CView* GetView() const;
void SetView(CView* theView);
long GetDragCommand() const;
void* GetDragData() const;
void SetData(long theDragCommand, void* theDragData);
CURSOR GetDragCursor(void) const;
void SetDragCursor(CURSOR theCursor);
void SetDragSensitivity(CPoint thePoint);
CPoint GetDragSensitivity() const;

Overridden Mouse Event Methods:

virtual BOOLEAN DoUp(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);
virtual BOOLEAN DoDown(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);
virtual BOOLEAN DoMove(
CPoint& theLocation,
short& theButton,
BOOLEAN& isShiftKey,
BOOLEAN& isControlKey);


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

support@xvt.com


Visit our online help desk for tech support

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