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
IlvMatrixHook Class Reference

Manager view hook class. More...

#include <ilviews/gadmgr/mathook.h>

Inheritance diagram for IlvMatrixHook:
IlvManagerViewHook

Public Member Functions

 IlvMatrixHook (IlvManager *mgr, IlvView *view, IlvContainer *cont, IlvMatrix *matrix)
 Constructor. More...
 
void add (IlUShort posx, IlUShort posy, IlvAbstractMatrixItem *item, IlvManagerViewInteractor *interactor)
 Adds a new item in the matrix and associates the interactor with this item. More...
 
IlvContainergetContainer () const
 Returns the container in which the matrix is stored. More...
 
IlvMatrix * getMatrix () const
 Returns the matrix used by this object. More...
 
virtual void interactorChanged (IlvManagerViewInteractor *current, IlvManagerViewInteractor *previous)
 Called when the interactor of the manager view changes. More...
 
void set (IlUShort posx, IlUShort posy, IlvManagerViewInteractor *interactor)
 Associates a manager view interactor with a matrix item. More...
 
void setCallback (IlvMatrixHookCallback callback, IlAny arg=0)
 Sets a callback on this hook. More...
 
- Public Member Functions inherited from IlvManagerViewHook
 IlvManagerViewHook (IlvManager *manager=0, IlvView *view=0)
 Constructor. More...
 
virtual void afterDraw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *region=0, const IlvRegion *clip=0)
 Called after the manager has drawn its contents. More...
 
virtual void afterExpose (const IlvRect &rect)
 Called after the manager has received an Expose event in the view to which the hook is connected. More...
 
virtual void beforeDraw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *region=0, const IlvRegion *clip=0)
 Called before the manager draws its contents. More...
 
virtual void contentsChanged ()
 Called when the contents of the manager change.
 
IlvManagergetManager () const
 Returns the manager. More...
 
IlvViewgetView () const
 Returns the manager view. More...
 
void setManager (IlvManager *manager)
 Sets the manager. More...
 
void setView (IlvView *view)
 Sets the manager view. More...
 
virtual void transformerChanged (const IlvTransformer *current, const IlvTransformer *previous)
 Called when you change the transformer of the view to which the hook is connected. More...
 
virtual void viewRemoved ()
 Called when the view to which the hook is connected is removed from the list of views that the manager handles.
 
virtual void viewResized ()
 Called when the manager view is resized. More...
 

Detailed Description

Manager view hook class.

Library: ilvgadmgr

Rogue Wave Views provides a predefined hook to help the user control a set of view interactors with a manager. It also updates a selector matrix of tools depending on which view interactor is set in a view connected to a manager. Most of the editors that you develop will have an interface panel stored in an IlvGadgetContainer, and a working area controlled by a manager.

Items of the matrix can be associated with view interactors. When the user selects one of the items that has an associated interactor, this interactor is set as the current interactor of the view. On the other hand, if the user changes the current interactor of the view, the hook tries to locate a matrix item that is associated with this interactor. If there is such an item, it is selected in the matrix.

This hook for manager views makes it easy to associate a series of interactors with a series of matrix items. It also handles the settings in both the view and the matrix.

Warning
[note] This class is obsolete. You should use the IlvManagerViewInteractorSelector class instead.

Constructor & Destructor Documentation

IlvMatrixHook::IlvMatrixHook ( IlvManager mgr,
IlvView view,
IlvContainer cont,
IlvMatrix *  matrix 
)

Constructor.

The constructor initializes a new instance of the IlvMatrixHook class that will let matrix control the interactors of mgr in view. The matrix should be stored in cont.

Warning
[note] The client data of matrix is overwritten if you use a matrix hook.
Parameters
mgrThe manager.
viewThe manager view.
contThe container of matrix.
matrixThe matrix.

Member Function Documentation

void IlvMatrixHook::add ( IlUShort  posx,
IlUShort  posy,
IlvAbstractMatrixItem *  item,
IlvManagerViewInteractor interactor 
)

Adds a new item in the matrix and associates the interactor with this item.

The action is similar to adding an item to the matrix at the location specified in posx and posy, and then calling the member function set.

Parameters
posxThe column of the matrix where the item will be added.
posyThe row of the matrix where the item will be added.
itemThe item to add.
interactorThe manager view interactor.
IlvContainer* IlvMatrixHook::getContainer ( ) const

Returns the container in which the matrix is stored.

Returns
The container in which the matrix is stored.
IlvMatrix* IlvMatrixHook::getMatrix ( ) const

Returns the matrix used by this object.

Returns
The matrix used by this object.
virtual void IlvMatrixHook::interactorChanged ( IlvManagerViewInteractor current,
IlvManagerViewInteractor previous 
)
virtual

Called when the interactor of the manager view changes.

Called when you change the view interactor for the view to which the hook is connected.

Parameters
currentThe new interactor set on the view.
previousThe interactor previously set on the view.

Reimplemented from IlvManagerViewHook.

void IlvMatrixHook::set ( IlUShort  posx,
IlUShort  posy,
IlvManagerViewInteractor interactor 
)

Associates a manager view interactor with a matrix item.

Associates the item located at (posx, posy) in the matrix with interactor for this item. When the user selects this item, the interactor is set as the new view interactor of the view associated with the manager. If the view interactor of the view becomes interactor, the indicated item is automatically selected in the matrix.

Parameters
posxThe column of the matrix where the item will be added.
posyThe row of the matrix where the item will be added.
itemThe item to add.
interactorThe manager view interactor.
void IlvMatrixHook::setCallback ( IlvMatrixHookCallback  callback,
IlAny  arg = 0 
)

Sets a callback on this hook.

Specifies a callback function to be called when the interactor changes in the view of this hook. This lets you perform some additional actions when new tools are selected in the manager.

Parameters
callbackThe callback function.
argA pointer to user data that will be passed to the callback function.

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