Rogue Wave Views
Manager Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvManagerViewDragDropInteractor Class Referenceabstract

Manager interactor class. More...

#include <ilviews/manager/ddinter.h>

Inheritance diagram for IlvManagerViewDragDropInteractor:
IlvManagerViewInteractor IlvValueInterface

Public Member Functions

 IlvManagerViewDragDropInteractor (IlvManager *manager, IlvView *view, IlvView *target=0, IlvGraphic *ghost=0, IlUShort button=IlvLeftButton)
 Constructor. More...
 
virtual void abort ()
 Aborts the interaction. More...
 
virtual void checkLocation (IlvPoint &position)
 Allows you to modify the position when dragging the mouse. More...
 
virtual void doIt (IlvView *target, IlvGraphic *ghost, const IlvPoint &position) const =0
 Finalizes the interaction. More...
 
virtual IlBoolean dragStarted (IlUInt count, IlvGraphic **objects) const
 Called when the drag operation starts. More...
 
virtual void drawGhost ()
 Visual feedback during the interaction. More...
 
IlUShort getButton () const
 Returns the mouse button used by the interactor. More...
 
IlvGraphicgetGhost () const
 Returns the ghost image. More...
 
IlUInt getMaxSelections () const
 Returns the maximum number of objects the interactor can drag. More...
 
IlvViewgetTarget () const
 Returns the target view. More...
 
virtual IlBoolean handleEvent (IlvEvent &event)
 Handles events for the manager view. More...
 
virtual void init ()
 Initialization, when the interactor is attached to a view. More...
 
virtual IlBoolean inTarget (const IlvPoint &position)
 Indicates whether a position is a valid drop site. More...
 
void setButton (IlUShort button)
 Sets the mouse button involved in the drag-and-drop interaction. More...
 
void setGhost (IlvGraphic *ghost)
 Sets the ghost image. More...
 
void setMaxSelections (IlUInt m)
 Sets the maximum number of objects the interactor can drag. More...
 
void setTarget (IlvView *target)
 Sets the target view. More...
 
- Public Member Functions inherited from IlvManagerViewInteractor
 IlvManagerViewInteractor (IlvManager *manager, IlvView *view)
 Initializes a new IlvManagerViewInteractor. More...
 
virtual void ensureVisible (const IlvPoint &point)
 Ensures the visibility of a given location. More...
 
IlvDisplaygetDisplay () const
 Returns the display of the manager view. More...
 
IlvManagergetManager () const
 Returns the manager. More...
 
IlvTransformergetTransformer () const
 Returns the transformer used with the manager view. More...
 
IlvViewgetView () const
 Returns the manager view. More...
 
virtual void handleExpose (IlvRegion *clip=0)
 Called when the manager view receives an expose event. More...
 

Detailed Description

Manager interactor class.

Library: ilvmgr

Use this class to move objects to another view using a drag-and-drop operation to perform a particular action. dropped to perform a particular action. This class is abstract and designed to be subtyped so you can implement your own drop mechanism.

See also
IlvViewDragDropInteractor, IlvManagerDragDropInteractor.

Constructor & Destructor Documentation

IlvManagerViewDragDropInteractor::IlvManagerViewDragDropInteractor ( IlvManager manager,
IlvView view,
IlvView target = 0,
IlvGraphic ghost = 0,
IlUShort  button = IlvLeftButton 
)

Constructor.

The constructor specifies the manager and the view to which you attach the interactor. You can also specify the target view where the object can be released and the ghost graphic object moved by the interactor. If the ghost graphic object is not specified, the interactor uses the object which is being clicked.

Parameters
managerThe manager.
viewThe view to which the interactor is attached.
targetThe target view.
ghostThe graphic object moved during a drag operation.
buttonSpecifies the mouse button used for drag-and-drop.

Member Function Documentation

virtual void IlvManagerViewDragDropInteractor::abort ( )
virtual

Aborts the interaction.

Called by the manager when the user changes the current interactor. It resets the interactor to a state in which it appears to have never been launched. A common implementation is to erase the ghost image. Call this member function to inhibit the interactor action in particular circumstances.

Reimplemented from IlvManagerViewInteractor.

virtual void IlvManagerViewDragDropInteractor::checkLocation ( IlvPoint position)
virtual

Allows you to modify the position when dragging the mouse.

Called when you move the pointing device by providing a new pair of coordinates in position. You can overload this method to modify these coordinates.

Parameters
positionThe event coordinates.
virtual void IlvManagerViewDragDropInteractor::doIt ( IlvView target,
IlvGraphic ghost,
const IlvPoint position 
) const
pure virtual

Finalizes the interaction.

Called when you release the object over the target view. You need to define this function in your subtyped class.

Parameters
targetThe target view.
ghostThe graphic object used as ghost.
positionThe ButtonDown event coordinates.
Note
If you plan to create a new object from the ghost parameter you receive, you must create a copy of it.
virtual IlBoolean IlvManagerViewDragDropInteractor::dragStarted ( IlUInt  count,
IlvGraphic **  objects 
) const
virtual

Called when the drag operation starts.

Called by handleEvent in the treatment of the IlvButtonDown event.

Parameters
countThe number of graphic objects in the array.
objectsThe array of graphic objects being dragged.
Returns
IlTrue if the objects can be dragged, or IlFalse otherwise.
virtual void IlvManagerViewDragDropInteractor::drawGhost ( )
virtual

Visual feedback during the interaction.

Draws the ghost image.

Reimplemented from IlvManagerViewInteractor.

IlUShort IlvManagerViewDragDropInteractor::getButton ( ) const

Returns the mouse button used by the interactor.

Returns
The number indicating the current mouse button involved in the drag-and-drop interaction.
IlvGraphic* IlvManagerViewDragDropInteractor::getGhost ( ) const

Returns the ghost image.

Returns
The graphic object used as ghost image.
IlUInt IlvManagerViewDragDropInteractor::getMaxSelections ( ) const

Returns the maximum number of objects the interactor can drag.

Returns
The maximum number of objects the interactor can drag.
IlvView* IlvManagerViewDragDropInteractor::getTarget ( ) const

Returns the target view.

Returns
The target view.
virtual IlBoolean IlvManagerViewDragDropInteractor::handleEvent ( IlvEvent event)
virtual

Handles events for the manager view.

Called by the manager for which the interactor was created with every event it receives in the interactor view.

Returns
IlTrue if the event is consumed, IlFalse otherwise.

Implements IlvManagerViewInteractor.

virtual void IlvManagerViewDragDropInteractor::init ( )
virtual

Initialization, when the interactor is attached to a view.

Resets the interactor to its initial state.

Called by the manager whenever the interactor is associated with a view. An association of this kind is established by the member function IlvManager::setInteractor().

Reimplemented from IlvManagerViewInteractor.

virtual IlBoolean IlvManagerViewDragDropInteractor::inTarget ( const IlvPoint position)
virtual

Indicates whether a position is a valid drop site.

Called by handleEvent in the treatment of the IlvButtonDown event.

Parameters
positionThe ButtonDown event coordinates.
Returns
IlTrue if the point is at a valid location to drop the objects, or IlFalse otherwise.
void IlvManagerViewDragDropInteractor::setButton ( IlUShort  button)

Sets the mouse button involved in the drag-and-drop interaction.

Parameters
buttonSpecifies the mouse button. It can have the following values: IlvLeftButton, IlvMiddleButton, or IlvRightButton (see IlvEvent).
void IlvManagerViewDragDropInteractor::setGhost ( IlvGraphic ghost)

Sets the ghost image.

Sets the graphic object used as ghost image by the interactor.

Parameters
ghostSpecifies the graphic object.
void IlvManagerViewDragDropInteractor::setMaxSelections ( IlUInt  m)

Sets the maximum number of objects the interactor can drag.

Parameters
mThe maximum number of objects.
void IlvManagerViewDragDropInteractor::setTarget ( IlvView target)

Sets the target view.

Parameters
targetThe target view.

© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.