rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Manager Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

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

List of all members.

Public Member Functions

 IlvDragRectangleInteractor (IlvManager *manager, IlvView *view, IlUShort button=IlvLeftButton, IlBoolean snap=IlTrue)
 Constructor.
virtual void abort ()
 Abort the interaction.
virtual void doIt (IlvRect &rect)
 Finalizes the interaction.
virtual void doPoint (const IlvPoint &p)
 Called when the selected rectangle is reduced to a point.
virtual void drawGhost ()
 Visual feedback during the interaction.
IlvRectgetRectangle ()
 Returns the selected rectangle.
virtual void handleEvent (IlvEvent &event)
 Handles keyboard and mouse events.
virtual void init ()
 Initialization, when the interactor is attached to a view.

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:
manager The manager.
view The view (it must be connected to the manager).
button Specifies the pointing device button used for dragging the rectangle.
snap If 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:
rect Specifies the rectangle that the user has been dragging.

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

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:
p Indicates 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 IlvMakeEllipseInteractor, IlvMakeFilledEllipseInteractor, IlvMakeFilledRectangleInteractor, IlvMakeReliefRectangleInteractor, IlvMakeRoundRectangleInteractor, and IlvMakeFilledRoundRectangleInteractor.

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:
event The 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.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.