Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Drag-drop interactor for graphic objects. More...
#include <ilviews/graphics/inter.h>
Public Member Functions | |
IlvDragDropInteractor (IlvView *target=0, IlvGraphic *ghost=0) | |
Constructor. More... | |
virtual void | checkPosition (IlvPoint &position) |
Allows you to modify the position at each step of the interaction. More... | |
virtual void | doIt (IlvView *target, IlvGraphic *ghost, const IlvPoint &position) |
Finalizes the interaction. More... | |
virtual void | drawGhost (IlvView *view, IlvGraphic *ghost, const IlvPoint &position, const IlvTransformer *t=0) |
Visual feedback during interaction. More... | |
virtual void | endOperation () |
Performs the actions needed when the interaction ends. More... | |
IlvView * | getTarget () const |
Returns the target view. More... | |
virtual IlBoolean | handleEvent (IlvGraphic *obj, IlvEvent &event, const IlvTransformer *t) |
Handles events received by the interactor. More... | |
virtual IlBoolean | inTarget (const IlvPoint &point) |
Indicates whether the current position is in the target view. More... | |
void | setGhost (IlvGraphic *ghost) |
Sets the graphic object used as ghost image. More... | |
void | setTarget (IlvView *target) |
Sets the target view. More... | |
IlBoolean | useGhostRectangle () const |
Status of the policy for drawGhost() . More... | |
void | useGhostRectangle (IlBoolean val) |
Sets the policy for drawGhost() . More... | |
Public Member Functions inherited from IlvInteractor | |
virtual void | abort (IlvGraphic *obj) |
Aborts the interactor. More... | |
virtual IlBoolean | accept (const IlvGraphic *obj) const |
Indicates whether the current interactor can be associated with a given object. More... | |
virtual void | getCallbackTypes (IlUInt &count, const char *const **names, const IlSymbol *const **types) const |
Gets the number of register callback types for the interactor. More... | |
const char * | getRegisteredName () const |
Returns the name of the predefined shared instance. More... | |
IlBoolean | isAborted () const |
Indicates whether the current interactor is in an aborted state. More... | |
IlBoolean | isInOperation () const |
Indicates whether the current interactor is in an interaction state. More... | |
void | lock () |
Locks the current instance. Increments the counter that is used to know how many objects reference the current instance. More... | |
virtual void | startOperation () |
Performs the actions needed when the interaction starts. More... | |
void | unLock () |
Unlocks the current instance. Decrements the reference counter. When the counter drops down to zero, the current instance is deleted. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvInteractor | |
static IlvInteractor * | Get (const char *name, IlBoolean=IlTrue) |
Returns a predefined shared interactor instance. More... | |
Drag-drop interactor for graphic objects.
Library: views
Use this class to drag an object to another view, and then drop it to perform a particular action. This class is designed to be subtyped so you can implement your own drop mechanism.
The registered name of this interactor is "DragDrop".
IlvDragDropInteractor::IlvDragDropInteractor | ( | IlvView * | target = 0 , |
IlvGraphic * | ghost = 0 |
||
) |
Constructor.
The constructor specifies the target view where the object can be dropped. If a graphic object is specified for the ghost parameter, this object is used by the interactor as a ghost image during the interaction. Otherwise, the object to be drawn is the one being dragged.
target | The target view. |
ghost | The graphic object used as ghost image. |
|
virtual |
Allows you to modify the position at each step of the interaction.
Called when you drag the mouse. You can modify the coordinates of the point position so that they satisfy a given set of constraint.
position | The current position provided by the interaction, in the screen coordinate system. |
|
virtual |
Finalizes the interaction.
Called when you release the object over the target view.
target | The target view where the mouse button is released. |
ghost | The graphic object used as ghost image. |
position | The coordinates of the ghost image in the screen coordinate system. |
|
virtual |
Visual feedback during interaction.
Called to draw a preview image of the resulting user action. The default implementation draws the ghost image on the display screen port.
view | The source view that received the IlvButtonDown event. |
ghost | The graphic used as ghost image. |
position | The position where the drawing must be performed, in the screen coordinate system. |
t | The transformer applied to the view view. |
IlvDisplay::screenPort()
.
|
virtual |
Performs the actions needed when the interaction ends.
The default implementation resets the interactor flags and remove it from its parent, if it exists.
IlvStackInteractorInterface::removeFromParent()
. Reimplemented from IlvInteractor.
IlvView* IlvDragDropInteractor::getTarget | ( | ) | const |
Returns the target view.
|
virtual |
Handles events received by the interactor.
This method is the entry point of all events dispatched to this interactor.
g | The graphic object that receives the event. |
event | The received event. |
t | The transformer applied to the view in which the event occurred. |
IlTrue
if the event was successfully handled and IlFalse
otherwise. Implements IlvInteractor.
Indicates whether the current position is in the target view.
IlTrue
if the point point is contained in the target view, and IlFalse
otherwise. point | The current position. |
void IlvDragDropInteractor::setGhost | ( | IlvGraphic * | ghost | ) |
Sets the graphic object used as ghost image.
ghost | The new ghost image. |
void IlvDragDropInteractor::setTarget | ( | IlvView * | target | ) |
Sets the target view.
This method can be used to perform a multi-view drag&drop.
target | The new target view. |
IlBoolean IlvDragDropInteractor::useGhostRectangle | ( | ) | const |
Status of the policy for drawGhost()
.
void IlvDragDropInteractor::useGhostRectangle | ( | IlBoolean | val | ) |
Sets the policy for drawGhost()
.
Specifies whether you want a ghost image or a hollow rectangle to be displayed.
val | If IlTrue , a ghost rectangle is drawn. Otherwise, the ghost image graphic object is used. |
© Copyright 2018, 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.