Views
Gadgets Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvGadgetMatrixItem Class Reference

Matrix item class. More...

#include <ilviews/gadgets/matrix.h>

Inheritance diagram for IlvGadgetMatrixItem:
IlvGraphicMatrixItem IlvAbstractMatrixItem IlvValueInterface

Public Member Functions

 IlvGadgetMatrixItem (IlvGadget *gadget)
 Constructor. More...
 
virtual IlvAbstractMatrixItemcopy () const
 Copies this object. More...
 
virtual void draw (const IlvMatrix *, IlUShort, IlUShort, IlvPort *, const IlvRect &, const IlvRect *) const
 Is called to draw the matrix item. More...
 
IlUShort focusColumn ()
 Returns the index of the column containing the matrix item. More...
 
IlUShort focusRow ()
 Returns the index of the row containing the matrix item. More...
 
IlvGadgetgetGadget () const
 Returns a pointer to the gadget stored in this matrix item. More...
 
virtual const char * getLabel () const
 Returns the label that identifies this matrix item. More...
 
IlBoolean hasFocus () const
 Indicates whether the gadget in the matrix item has the focus. More...
 
IlBoolean isInteractive () const
 Indicates whether the gadget stored in this matrix item is active. More...
 
virtual void minimumSize (const IlvMatrix *, IlvDim &w, IlvDim &h) const
 Returns the preferred size of the item. More...
 
void setGadget (IlvGadget *gadget)
 Sets the gadget stored in this matrix item. More...
 
void setInteractive (IlBoolean val)
 Specifies whether the gadget stored in this matrix item should be active. More...
 
virtual void setLabel (const char *, IlBoolean copy=IlTrue)
 Sets the label of the matrix item. More...
 
virtual void write (IlvOutputFile &) const
 Writes an object description to a file. More...
 
- Public Member Functions inherited from IlvGraphicMatrixItem
 IlvGraphicMatrixItem (IlvGraphic *graphic)
 Constructor. More...
 
IlvGraphicgetGraphic () const
 Returns a pointer to the graphic object stored in this matrix item. More...
 
virtual IlBoolean handleSelectionDrawing () const
 Indicates whether the selection drawing is handled by the matrix item.
More...
 
virtual void setBackground (IlvColor *)
 Sets the background color of this matrix item. More...
 
virtual void setFont (IlvFont *)
 Sets the font of this matrix item. More...
 
virtual void setForeground (IlvColor *)
 Sets the foreground color of this matrix item. More...
 
void setGraphic (IlvGraphic *graphic)
 Sets the graphic object stored in this matrix item. More...
 
virtual void setPalette (IlvPalette *)
 Sets the palette of this matrix item. More...
 
- Public Member Functions inherited from IlvAbstractMatrixItem
void drawLabel (const char *label, const IlvMatrix *matrix, IlUShort col, IlUShort row, IlvPort *dst, const IlvRect &bbox, const IlvRect *clip=0) const
 Is called to draw the label of the matrix item. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvAbstractMatrixItem
static IlvAbstractMatrixItemreadItem (IlvInputFile &file, IlvDisplay *display)
 Reads an object description from a file. More...
 

Detailed Description

Matrix item class.

Library: ilvadvgdt

Use this class to define a matrix item as a gadget. Gadgets stored in a matrix item are active.

See also
IlvGadget, IlvMatrix.

Accessors\nAccessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods <tt>IlvValueInterface::queryValue()</tt>, <tt>IlvValueInterface::queryValues()</tt>, <tt>IlvValueInterface::changeValue()</tt>, <tt>IlvValueInterface::changeValues()</tt>.\n\n\nThis class inherits the accessors of its superclass \c IlvGraphicMatrixItem and adds the following ones:

Name Type Equivalent methods
graphic Object getGadget(), setGadget()
interactive Boolean isInteractive(), setInteractive()
hasFocus Boolean hasFocus()
focusRow UInt focusRow()
focusColumn UInt focusColumn()

Constructor & Destructor Documentation

◆ IlvGadgetMatrixItem()

IlvGadgetMatrixItem::IlvGadgetMatrixItem ( IlvGadget gadget)

Constructor.

Initializes a new instance of the class IlvGadgetMatrixItem.

Parameters
gadgetThe gadget encapsulated by this matrix item.

Member Function Documentation

◆ copy()

virtual IlvAbstractMatrixItem* IlvGadgetMatrixItem::copy ( ) const
virtual

Copies this object.

Allocates and returns a copy of this object.

Returns
A copy of the object.
See also
IlvPredefinedMatrixItemIOMembers().

Reimplemented from IlvGraphicMatrixItem.

◆ draw()

virtual void IlvGadgetMatrixItem::draw ( const IlvMatrix matrix,
IlUShort  col,
IlUShort  row,
IlvPort dst,
const IlvRect bbox,
const IlvRect clip 
) const
virtual

Is called to draw the matrix item.

The default implementation of the method calls IlvAbstractMatrixItem::drawLabel.

Parameters
matrixThe matrix to which the item belongs.
colThe column where the matrix item is located.
rowThe row where the matrix item is located.
dstThe destination drawing port.
bboxThe bounding box of the matrix item.
clipThe clipping area.
See also
IlvAbstractMatrix::drawItem, drawLabel().

Reimplemented from IlvGraphicMatrixItem.

◆ focusColumn()

IlUShort IlvGadgetMatrixItem::focusColumn ( )

Returns the index of the column containing the matrix item.

This method must be called only when the item has the focus.

Returns
The index of the column containing the matrix item when this item has the focus.
See also
focusRow(), IlvMatrix::setFocus(IlUShort, IlUShort).

◆ focusRow()

IlUShort IlvGadgetMatrixItem::focusRow ( )

Returns the index of the row containing the matrix item.

This method must be called only when the item has the focus.

Returns
The index of the row containing the matrix item when this item has the focus.
See also
focusColumn(), IlvMatrix::setFocus(IlUShort, IlUShort).

◆ getGadget()

IlvGadget* IlvGadgetMatrixItem::getGadget ( ) const

Returns a pointer to the gadget stored in this matrix item.

Returns
A pointer to the gadget stored in this matrix item.

◆ getLabel()

virtual const char* IlvGadgetMatrixItem::getLabel ( ) const
virtual

Returns the label that identifies this matrix item.

Returns
The label that identifies this matrix item. The returned string must not be deleted or modified.
See also
setLabel().

Reimplemented from IlvGraphicMatrixItem.

◆ hasFocus()

IlBoolean IlvGadgetMatrixItem::hasFocus ( ) const

Indicates whether the gadget in the matrix item has the focus.

Returns
IlTrue if the gadget has the focus and IlFalse otherwise. When a gadget has the focus, it receives all the keyboard events.
See also
IlvMatrix::setFocus(IlUShort, IlUShort).

◆ isInteractive()

IlBoolean IlvGadgetMatrixItem::isInteractive ( ) const

Indicates whether the gadget stored in this matrix item is active.

Returns
IlTrue if the gadget stored in this matrix item is active. When a gadget is active, events are sent to its handleEvent() method.
See also
setInteractive().

◆ minimumSize()

virtual void IlvGadgetMatrixItem::minimumSize ( const IlvMatrix matrix,
IlvDim width,
IlvDim height 
) const
virtual

Returns the preferred size of the item.

The preferred size is the size that the item must have for its content to be entirely visible. Uses width and height to return the preferred size of this item when stored in matrix. This method is called by the member functions IlvMatrix::getColumnFittingSize and IlvMatrix::getRowFittingSize.

Parameters
matrixThe matrix to which the item belongs.
widthThe returned preferred width of the item.
heightThe returned preferred height of the item.
See also
IlvMatrix::getColumnFittingSize(), IlvMatrix::getRowFittingSize().

Reimplemented from IlvGraphicMatrixItem.

◆ setGadget()

void IlvGadgetMatrixItem::setGadget ( IlvGadget gadget)

Sets the gadget stored in this matrix item.

The old gadget that was stored in this matrix item is deleted.

Parameters
gadgetThe new gadget.
See also
getGadget().

◆ setInteractive()

void IlvGadgetMatrixItem::setInteractive ( IlBoolean  val)

Specifies whether the gadget stored in this matrix item should be active.

This method has the same function as IlvGadget::setActive(). Though in this situation the information is directly managed by the IlvGadgetMatrixItem instance.

Parameters
valSpecifies whether the gadget stored in this matrix item should be active (IlTrue) or not (IlFalse).
See also
isInteractive(), IlvGadget::isActive().

◆ setLabel()

virtual void IlvGadgetMatrixItem::setLabel ( const char *  label,
IlBoolean  copy = IlTrue 
)
virtual

Sets the label of the matrix item.

Parameters
labelThe label of the matrix item.
copySpecifies whether a label should be copied. If the value is IlFalse, then you must allocate some memory for the label because in any case the label characters are deleted from the memory by the IlvAbstractMatrixItem.
See also
getLabel().

Reimplemented from IlvGraphicMatrixItem.

◆ write()

virtual void IlvGadgetMatrixItem::write ( IlvOutputFile file) const
virtual

Writes an object description to a file.

Writes out, in a file, the object description. This description contains all the information necessary to create an exact copy of this object by means of the member function readItem().

Parameters
fileThe name of the file to be written to.
See also
DeclareMatrixItemInfoRO(), DeclareMatrixItemInfo(), IlvPredefinedMatrixItemIOMembers().

Reimplemented from IlvGraphicMatrixItem.