Rogue Wave Views
Gadgets Package API Reference Guide
Product Documentation:

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

Matrix Item Editor class. More...

#include <ilviews/gadgets/matrix.h>

Inheritance diagram for IlvMatrixItemEditor:
IlvDefaultMatrixItemEditor

Public Member Functions

 IlvMatrixItemEditor (IlvMatrix *matrix, IlUShort col, IlUShort row)
 Constructor. More...
 
virtual void applyTo () const =0
 Is called to apply the editor value into the matrix. More...
 
virtual void cancel ()
 Cancels the editing. More...
 
IlUShort getColumn () const
 Returns the edited column. More...
 
IlvGraphicgetEditorField () const
 Returns the graphic object used to edit. More...
 
IlvMatrixgetMatrix () const
 Returns the matrix being edited. More...
 
IlUShort getRow () const
 Returns the edited row. More...
 
virtual IlBoolean handleEvent (IlvEvent &event)
 Is called by the matrix when an event occurs while editing. More...
 
virtual void initFrom () const =0
 Is called to initialize the editor. More...
 
virtual void validate ()
 Validates the editing. More...
 

Protected Member Functions

void setEditorField (IlvGraphic *g)
 Sets the graphic object used to edit the item. More...
 

Detailed Description

Matrix Item Editor class.

Library: ilvadvgdt

The base class for the editors of IlvAbstractMatrixItem objects. A matrix item editor is created through a factory of the class IlvMatrixItemEditorFactory. The editor must call setEditorField() from its constructor to set the graphic object that will be used for editing. In most cases, an interactor must be set on this graphic object to call the validate() method when the editing is to be finished.

See also
IlvMatrixItemEditorFactory.

Constructor & Destructor Documentation

IlvMatrixItemEditor::IlvMatrixItemEditor ( IlvMatrix matrix,
IlUShort  col,
IlUShort  row 
)

Constructor.

Parameters
matrixThe matrix where the editor will be used for editing.
colThe column of the matrix where the editor will be used for editing.
rowThe row of the matrix where the editor will be used for editing.

Member Function Documentation

virtual void IlvMatrixItemEditor::applyTo ( ) const
pure virtual

Is called to apply the editor value into the matrix.

The implementation must change the edited matrix item using the editor field.

See also
getMatrix(), getColumn(), getRow().

Implemented in IlvDefaultMatrixItemEditor.

virtual void IlvMatrixItemEditor::cancel ( )
virtual

Cancels the editing.

This method should be called by the interactor of the graphic object used for the editing to cancel the editing.

IlUShort IlvMatrixItemEditor::getColumn ( ) const

Returns the edited column.

Returns
The edited column.
IlvGraphic* IlvMatrixItemEditor::getEditorField ( ) const

Returns the graphic object used to edit.

Returns
The graphic object used to edit.
IlvMatrix* IlvMatrixItemEditor::getMatrix ( ) const

Returns the matrix being edited.

Returns
The matrix being edited.
IlUShort IlvMatrixItemEditor::getRow ( ) const

Returns the edited row.

Returns
The edited row.
virtual IlBoolean IlvMatrixItemEditor::handleEvent ( IlvEvent event)
virtual

Is called by the matrix when an event occurs while editing.

The default implementation handles the IlvEscape to cancel an editing, the IlvReturn key to validate an editing, and some special keys like arrows keys to validate an editing and move the selection in the matrix. Any other event is sent to the interactor of the editor field.

Parameters
eventThe event.
Returns
IlTrue if the event was consumed, IlFalse otherwise.
See also
getEditorField().
virtual void IlvMatrixItemEditor::initFrom ( ) const
pure virtual

Is called to initialize the editor.

The implementation must initialize the editor field using the data located in the matrix.

See also
getMatrix(), getColumn(), getRow().

Implemented in IlvDefaultMatrixItemEditor.

void IlvMatrixItemEditor::setEditorField ( IlvGraphic g)
protected

Sets the graphic object used to edit the item.

The previous graphic object, if any, is deleted.

Parameters
gThe new graphic object.
virtual void IlvMatrixItemEditor::validate ( )
virtual

Validates the editing.

This method should be called by the interactor of the graphic object used for the editing to validate the editing.


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