rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Manager Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvDragRectangleInteractor Class Reference

Manager interactor class. More...

#include <ilviews/manager/dragrin.h>

Inheritance diagram for IlvDragRectangleInteractor:
IlvManagerViewInteractor IlvMakeBitmapInteractor IlvMakeEllipseInteractor IlvMakeFilledRoundRectangleInteractor IlvMakeRectangleInteractor IlvMakeReliefDiamondInteractor IlvMakeReliefRectangleInteractor IlvMakeRoundRectangleInteractor IlvMakeUnZoomInteractor IlvMakeZoomInteractor

Public Member Functions

 IlvDragRectangleInteractor (IlvManager *manager, IlvView *view, IlUShort button=IlvLeftButton, IlBoolean snap=IlTrue)
 Constructor. More...
 
virtual void abort ()
 Abort the interaction. More...
 
virtual void doIt (IlvRect &rect)
 Finalizes the interaction. More...
 
virtual void doPoint (const IlvPoint &p)
 Called when the selected rectangle is reduced to a point. More...
 
virtual void drawGhost ()
 Visual feedback during the interaction. More...
 
IlvRectgetRectangle ()
 Returns the selected rectangle. More...
 
virtual void handleEvent (IlvEvent &event)
 Handles keyboard and mouse events. More...
 
virtual void init ()
 Initialization, when the interactor is attached to a view. More...
 
- Public Member Functions inherited from IlvManagerViewInteractor
 IlvManagerViewInteractor (IlvManager *manager, IlvView *view)
 Constructor. 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 drag rectangles in a view connected to a manager. The IlvDragRectangleInteractor class is never directly instantiated within a manager. Use it as a base class for the creation of derived interactors that drag rectangles in a view. To do this, redefine the member functions drawGhost and doIt.

See Also
IlvManager, IlvMakeRectangleInteractor, IlvMakeReliefRectangleInteractor, IlvMakeReliefDiamondInteractor, IlvMakeRoundRectangleInteractor, IlvMakeEllipseInteractor, IlvMakeBitmapInteractor.

Constructor & Destructor Documentation

IlvDragRectangleInteractor::IlvDragRectangleInteractor ( IlvManager manager,
IlvView view,
IlUShort  button = IlvLeftButton,
IlBoolean  snap = IlTrue 
)

Constructor.

Initializes a new instance of the IlvDragRectangleInteractor class, which lets the user drag rectangles in a manager view.

Parameters
managerThe manager.
viewThe view (it must be connected to the manager).
buttonSpecifies the pointing device button used for dragging the rectangle.
snapIf set to IlTrue, the rectangle snaps to the manager grid points. Otherwise it does not.

Member Function Documentation

virtual void IlvDragRectangleInteractor::abort ( )
virtual

Abort the interaction.

This virtual member function implementation does nothing; it is meant to be redefined in a subclass.

Reimplemented from IlvManagerViewInteractor.

virtual void IlvDragRectangleInteractor::doIt ( IlvRect rect)
virtual

Finalizes the interaction.

Performs the action. This virtual member function implementation does nothing; it is meant to be redefined in a subclasses. When implemented, the member function carries out the work of the interactor.

Parameters
rectSpecifies the rectangle that the user has been dragging.

Reimplemented in IlvMakeReliefDiamondInteractor, IlvMakeObjectInteractor, IlvMakeFilledRoundRectangleInteractor, IlvMakeUnZoomInteractor, IlvMakeFilledEllipseInteractor, IlvMakeFilledRectangleInteractor, IlvMakeReliefRectangleInteractor, IlvMakeRoundRectangleInteractor, IlvMakeEllipseInteractor, IlvMakeBitmapInteractor, IlvMakeRectangleInteractor, and IlvMakeZoomInteractor.

virtual void IlvDragRectangleInteractor::doPoint ( const IlvPoint p)
virtual

Called when the selected rectangle is reduced to a point.

Called when the user releases the pointing device button when no rectangle has been created. This can occur when the pointing device is not moved between the button down and button up events. This virtual member function implementation does nothing; it is meant to be redefined in a subclasses.

Parameters
pIndicates the coordinates of the pointing device when the button is released.
virtual void IlvDragRectangleInteractor::drawGhost ( )
virtual

Visual feedback during the interaction.

Draws a rectangle using a special palette of the IlvManager object that draws in XOR mode.

Reimplemented from IlvManagerViewInteractor.

Reimplemented in IlvMakeFilledRoundRectangleInteractor, IlvMakeFilledEllipseInteractor, IlvMakeFilledRectangleInteractor, IlvMakeReliefRectangleInteractor, IlvMakeRoundRectangleInteractor, and IlvMakeEllipseInteractor.

IlvRect& IlvDragRectangleInteractor::getRectangle ( )

Returns the selected rectangle.

Returns
The rectangle defined during the interaction. It is expressed in the view coordinates system.
virtual void IlvDragRectangleInteractor::handleEvent ( IlvEvent event)
virtual

Handles keyboard and mouse events.

Handles keyboard and mouse events. It examines the state of the mouse button (the default is the left button; see constructor parameters) to see if a rectangle is to be dragged. It also checks the Shift key state: if pressed, the dragged shape is constrained to be a square.

Parameters
eventThe event.

Implements IlvManagerViewInteractor.

virtual void IlvDragRectangleInteractor::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.


© Copyright 2012, 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.