Rogue Wave Views
Gadgets Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
IlvGadgetItem Class Reference

Gadget Item class. More...

#include <ilviews/gadgets/itemgdt.h>

Inheritance diagram for IlvGadgetItem:
IlvValueInterface IlvStylable IlvMenuItem IlvPathGadgetItem IlvTreeGadgetItem IlvMenuItemPath IlvTreePathGadgetItem

Public Member Functions

 IlvGadgetItem (const char *label, IlvBitmap *bitmap=0, IlvPosition position=IlvRight, IlUShort spacing=4, IlBoolean copy=IlTrue)
 Constructor. More...
 
 IlvGadgetItem (const char *label, IlvGraphic *graphic, IlvPosition position=IlvRight, IlUShort spacing=4, IlBoolean copy=IlTrue)
 Constructor. More...
 
 IlvGadgetItem (IlvGraphic *graphic)
 Constructor. More...
 
 IlvGadgetItem (IlvBitmap *bitmap)
 Constructor. More...
 
virtual void activate ()
 Activates the item. More...
 
virtual IlvGadgetItemcopy () const
 Copies this object. More...
 
virtual void deSelect ()
 Deselects the item. More...
 
virtual void draw (IlvPort *dst, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Is called to draw the item. More...
 
virtual void drawLabel (IlvPort *dst, IlvPalette *palette, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Is called to draw the item label. More...
 
virtual void drawPicture (IlvPort *dst, const IlvRect &rect, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Is called to draw the item picture. More...
 
virtual void edit ()
 Edits the item label. More...
 
IlvBitmapgetBitmap (IlUShort index=(IlUShort) 0) const
 Returns the bitmap whose index is specified. More...
 
IlvBitmapgetBitmap (const IlSymbol *symbol) const
 Returns the bitmap corresponding to the specified symbol. More...
 
IlUShort getBitmapCount () const
 Returns the number of bitmaps used by this item. More...
 
virtual IlUInt getBitmapMask () const
 Returns the bitmap mask of the item. More...
 
IlAny getClientData () const
 Returns the client data of the item. More...
 
virtual IlvBitmapgetCurrentBitmap () const
 Returns the bitmap that is currently displayed by the item. More...
 
IlvGraphicgetGraphic () const
 Returns the IlvGraphic object associated with this item. More...
 
virtual IlUShort getHeight () const
 Returns the item height. More...
 
virtual IlvPalettegetHighlightTextPalette () const
 Returns the palette used to draw the label of highlighted items. More...
 
IlvGadgetItemHoldergetHolder () const
 Returns the item holder. More...
 
virtual IlvPalettegetInsensitivePalette () const
 Returns the palette used to draw a nonsensitive item. More...
 
const char * getLabel () const
 Returns the item label. More...
 
IlvAlignment getLabelAlignment () const
 Returns the label alignment. More...
 
void getLabelOrientation (IlvOrientation &orientation, IlBoolean &flip) const
 Returns the orientation of the item label. More...
 
IlvPosition getLabelPosition () const
 Returns the position of the label relative to the picture. More...
 
virtual const char * getMessage () const
 Returns the message of the item. More...
 
char getMnemonic () const
 Returns the mnemonic letter associated with the item. More...
 
const char * getName () const
 Returns the item name. More...
 
IlvNamedPropertygetNamedProperty (const IlSymbol *name) const
 Returns the property whose name is specified. More...
 
virtual IlvPalettegetNormalTextPalette () const
 Returns the default palette used to draw an item. More...
 
virtual IlvPalettegetOpaquePalette () const
 Returns the palette that is used to draw opaque items. More...
 
IlAny getProperty (const IlSymbol *key) const
 Returns the object property whose symbol is provided as the parameter. More...
 
virtual IlvPalettegetSelectionPalette () const
 Returns the palette used to draw selected items. More...
 
virtual IlvPalettegetSelectionTextPalette () const
 Returns the palette used to draw the label of selected items. More...
 
IlUShort getSpacing () const
 Returns the spacing between the label and the picture of the item. More...
 
virtual IlUShort getWidth () const
 Returns the item width. More...
 
IlBoolean hasProperty (const IlSymbol *key) const
 Indicates whether the item has the property whose symbol is specified. More...
 
virtual void highlight (IlBoolean value=IlTrue)
 Highlights the item. More...
 
IlBoolean isDragDropTarget () const
 Indicates whether the item is the target of a drag-and-drop operation. More...
 
IlBoolean isEditable () const
 Indicates whether the item can be edited. More...
 
IlBoolean isHighlighted () const
 Indicates whether the item is highlighted. More...
 
IlBoolean isOpaque () const
 Indicates whether the item is opaque. More...
 
virtual IlBoolean isSelectable () const
 Indicates whether the item can be selected. More...
 
IlBoolean isSelected () const
 Indicates whether the item is selected. More...
 
IlBoolean isSensitive () const
 Indicates whether the item is sensitive. More...
 
IlBoolean isShowingLabel () const
 Indicates whether the item label is visible. More...
 
IlBoolean isShowingPicture () const
 Indicates whether the item picture is visible. More...
 
virtual void itemRect (IlvRect &rect, const IlvRect &bbox) const
 Returns the item bounding bbox. More...
 
virtual void labelRect (IlvRect &rect, const IlvRect &bbox) const
 Returns the bounding box of the item label. More...
 
virtual void pictureRect (IlvRect &rect, const IlvRect &bbox) const
 Returns the bounding bbox of the item picture. More...
 
virtual void recomputeSize (IlBoolean redraw=IlTrue)
 Recomputes the item geometry. More...
 
void removeAllBitmaps ()
 Removes all the bitmaps associated with the item. More...
 
IlvNamedPropertyremoveNamedProperty (IlSymbol *name)
 Removes the specified named property from the object. More...
 
IlBoolean removeProperty (const IlSymbol *key)
 Removes a property from the object. More...
 
virtual void select ()
 Selects the item. More...
 
virtual void selectionRect (IlvRect &rect, const IlvRect &bbox) const
 Returns the bounding box of the item selection. More...
 
void setBitmap (IlUShort index, IlvBitmap *bitmap)
 Sets the specified bitmap to the item at the specified index. More...
 
void setBitmap (const IlSymbol *symbol, IlvBitmap *bitmap)
 Sets the specified bitmap to the item using the specified symbol. More...
 
void setBitmap (IlvBitmap *bitmap)
 Sets the sensitive bitmap of the item. More...
 
void setClientData (IlAny data)
 Sets the new client data for this item. More...
 
void setEditable (IlBoolean value)
 Specifies whether the item should be editable. More...
 
void setGraphic (IlvGraphic *graphic)
 Specifies the graphic object associated with this item. More...
 
virtual void setHighlightTextPalette (IlvPalette *palette)
 Sets the palette used to draw the label of highlighted items. More...
 
void setLabel (const char *label, IlBoolean copy=IlTrue)
 Sets the item label. More...
 
void setLabelAlignment (IlvAlignment alignment)
 Sets the label alignment. More...
 
void setLabelOrientation (IlvOrientation orientation, IlBoolean flip=IlFalse)
 Sets the orientation of the item label. More...
 
void setLabelPosition (IlvPosition position)
 Sets the label position relative to the picture. More...
 
void setName (const char *name)
 Sets the item name. More...
 
IlvNamedPropertysetNamedProperty (IlvNamedProperty *property)
 Sets the specified named property to the object. More...
 
virtual void setNormalTextPalette (IlvPalette *palette)
 Sets the default palette used to draw an item. More...
 
void setOpaque (IlBoolean value)
 Specifies whether the item should be opaque. More...
 
virtual void setOpaquePalette (IlvPalette *palette)
 Sets the palette used to draw opaque items. More...
 
void setProperty (const IlSymbol *key, IlAny value)
 Sets the property whose symbol is specified to the item. More...
 
virtual void setSelectionTextPalette (IlvPalette *palette)
 Sets the palette used to draw the label of selected items. More...
 
void setSensitive (IlBoolean value)
 Specifies whether the item should be sensitive or not. More...
 
void setSpacing (IlUShort spacing)
 Sets the spacing between the label and the picture of the item. More...
 
void showLabel (IlBoolean value=IlTrue)
 Specifies whether the item label should be shown. More...
 
void showPicture (IlBoolean value=IlTrue)
 Specifies whether the item picture should be shown. More...
 
virtual void write (IlvOutputFile &file) const
 Writes an object description to a file. More...
 

Static Public Member Functions

static void AddItemBitmapSymbol (const IlSymbol *symbol, IlUShort index)
 Links a new bitmap symbol with the specified index. More...
 
static IlSymbolBitmapSymbol ()
 Returns the symbol associated with the sensitive bitmap. More...
 
static IlShort GetItemBitmapIndex (const IlSymbol *symbol)
 Returns the index corresponding to the specified symbol. More...
 
static IlSymbolGetItemBitmapSymbol (IlUShort index)
 Returns the symbol corresponding to the specified index. More...
 
static IlSymbolHighlightedBitmapSymbol ()
 Returns the symbol associated with the highlighted bitmap. More...
 
static IlSymbolInsensitiveBitmapSymbol ()
 Returns the symbol associated with the nonsensitive bitmap. More...
 
static IlvGadgetItemreadItem (IlvInputFile &file, IlvDisplay *display)
 Reads an object description from a file. More...
 
static IlSymbolSelectedBitmapSymbol ()
 Returns the symbol associated with the selected bitmap. More...
 

Protected Member Functions

virtual void computeRects (IlvRect &labelRect, IlvRect &pictureRect) const
 Computes the label and picture bounding boxes. More...
 
virtual void computeSize (IlUShort &width, IlUShort &height) const
 Computes the item size. More...
 

Friends

class IlvGadgetItemHolder
 

Detailed Description

Gadget Item class.

Library: ilvgadgt

IlvGadgetItem is the base class for items used in gadget classes such as IlvAbstractMenu, IlvStringList or IlvTreeGadget.

IlvGadgetItem objects can display a text and a picture. The picture can be an IlvGraphic object or a bitmap. If it is a bitmap, you can specify several bitmaps, each corresponding to different item states, such as selected or highlighted.

See also
IlvGadgetItemHolder, IlvGadgetItemMatrixItem, IlvMenuItem, IlvTreeGadgetItem, IlvBitmap, IlvGraphic.

Accessors

Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue(), IlvValueInterface::queryValues(), IlvValueInterface::changeValue(), IlvValueInterface::changeValues(). This class inherits the accessors of its superclass IlvValueInterface and adds the following ones:

Data accessors

Name Type Equivalent methods
bitmap Bitmap getBitmap(IlUShort) const, setBitmap(IlvBitmap*)
insensitiveBitmap Bitmap getBitmap(IlUShort) const, setBitmap(IlUShort, IlvBitmap*)
highlightedBitmap Bitmap getBitmap(IlUShort) const, setBitmap(IlUShort, IlvBitmap*)
selectedBitmap Bitmap getBitmap(IlUShort) const, setBitmap(IlUShort, IlvBitmap*)
label String getLabel(), setLabel(const char*, IlBoolean)
alignment Direction getLabelAlignment(), setLabelAlignment()
labelPosition Direction getLabelPosition(), setLabelPosition()
labelOrientation Direction getLabelOrientation(), setLabelOrientation()
flipLabel Boolean getLabelOrientation(), setLabelOrientation()
editable Boolean isEditable(), setEditable()
highlighted Boolean isHighlighted(), highlight()
opaque Boolean isOpaque(), setOpaque()
selected Boolean isSelected(), select(), deSelect()
sensitive Boolean isSensitive(), setSensitive()
showPicture Boolean isShowingPicture(), showPicture()
showLabel Boolean isShowingLabel(), showLabel()
graphic Object getGraphic(), setGraphic()
spacing UInt getSpacing(), setSpacing()
width UInt getWidth()
height UInt getHeight()

Method accessors

Name Return type Equivalent methods
activate() Void activate()
edit() Void edit()
copy() Object copy()

Styling

This class supports the following CSS properties:

Graphic property CSS property Type
Background color background-colorColor
Text color color Color
Note
The gadget item background is drawn only if the gadget item is opaque (see IlvGadgetItem::setOpaque()).

Constructor & Destructor Documentation

IlvGadgetItem::IlvGadgetItem ( const char *  label,
IlvBitmap bitmap = 0,
IlvPosition  position = IlvRight,
IlUShort  spacing = 4,
IlBoolean  copy = IlTrue 
)

Constructor.

Initializes a new instance of the IlvGadgetItem class. This constructor allows you to specify both a label and a bitmap, as well as their relative alignment and spacing. The bitmap is locked.

Parameters
labelThe item label.
bitmapThe sensitive bitmap of the item.
positionThe label position relative to the picture.
spacingThe spacing between the label and the picture.
copySpecifies whether the label should be copied. In any case the label characters are deleted from the memory by the IlvGadgetItem.
IlvGadgetItem::IlvGadgetItem ( const char *  label,
IlvGraphic graphic,
IlvPosition  position = IlvRight,
IlUShort  spacing = 4,
IlBoolean  copy = IlTrue 
)

Constructor.

Initializes a new instance of the IlvGadgetItem class. This constructor allows you to specify both a label and a graphic, as well as their relative alignment and spacing.

Parameters
labelThe item label.
graphicThe item picture.
positionThe label position relative to the picture.
spacingThe spacing between the label and the picture.
copySpecifies whether a label should be copied. In any case the label characters are deleted from the memory by the IlvGadgetItem.
IlvGadgetItem::IlvGadgetItem ( IlvGraphic graphic)

Constructor.

Initializes a new instance of the IlvGadgetItem class. This constructor allows you to create an item represented by a graphic object.

Parameters
graphicThe item picture.
IlvGadgetItem::IlvGadgetItem ( IlvBitmap bitmap)

Constructor.

Initializes a new instance of the IlvGadgetItem class. This constructor allows you to create an item represented by a bitmap. The bitmap is locked.

Parameters
bitmapThe sensitive bitmap of the item.

Member Function Documentation

virtual void IlvGadgetItem::activate ( )
virtual

Activates the item.

The default implementation calls the holder method IlvGadgetItemHolder::itemActivated().

See also
IlvGadgetItemHolder::itemActivated().
static void IlvGadgetItem::AddItemBitmapSymbol ( const IlSymbol symbol,
IlUShort  index 
)
static

Links a new bitmap symbol with the specified index.

See also
GetItemBitmapSymbol(), GetItemBitmapIndex(), setBitmap().
static IlSymbol* IlvGadgetItem::BitmapSymbol ( )
static

Returns the symbol associated with the sensitive bitmap.

Returns
The symbol associated with the sensitive bitmap.
See also
GetItemBitmapIndex(), AddItemBitmapSymbol(), setBitmap().
virtual void IlvGadgetItem::computeRects ( IlvRect labelRect,
IlvRect pictureRect 
) const
protectedvirtual

Computes the label and picture bounding boxes.

If you want to change the label or picture location, you can override this member function in a subclass.

Parameters
labelRectThe returned bounding box of the item label.
pictureRectThe returned bounding box of the item picture.
See also
computeSize(), recomputeSize(), labelRect(), pictureRect().
virtual void IlvGadgetItem::computeSize ( IlUShort width,
IlUShort height 
) const
protectedvirtual

Computes the item size.

Computes the size of the item using the member function IlvGadgetItem::computeRects(), which specifies the location of the label and picture parts. If you want to change the item size, you can override this member function in a subclass.

Parameters
widthThe returned item width.
heightThe returned item height.
See also
computeRects(), recomputeSize(), getWidth(), getHeight().

Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.

virtual IlvGadgetItem* IlvGadgetItem::copy ( ) const
virtual

Copies this object.

Allocates and returns a copy of this object. The named properties attached to the gadget item are also copied.

Returns
A copy of the object.
See also
IlvPredefinedGadgetItemIOMembers().
virtual void IlvGadgetItem::deSelect ( )
virtual

Deselects the item.

The default implementation deselects and redraws the item, then it calls the holder method IlvGadgetItemHolder::itemDeSelected().

See also
isSelected(), select(), SelectedBitmapSymbol().

Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.

virtual void IlvGadgetItem::draw ( IlvPort dst,
const IlvRect rect,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
virtual

Is called to draw the item.

You can override this method to modify the way the item is drawn.

Parameters
dstThe destination drawing port.
rectThe rectangle where to the item will be drawn.
tThe transformer used to draw the item.
clipThe clipping area.
See also
drawLabel(), drawPicture(), itemRect(), IlvGadgetItemHolder::drawGadgetItem().
virtual void IlvGadgetItem::drawLabel ( IlvPort dst,
IlvPalette palette,
const IlvRect rect,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
virtual

Is called to draw the item label.

You can override this method to modify the way the item is drawn.

Parameters
dstThe destination drawing port.
paletteThe palette used to draw the item label.
rectThe rectangle where to the item label will be drawn.
tThe transformer used to draw the item label.
clipThe clipping area.
See also
draw(), drawPicture(), itemRect().

Reimplemented in IlvMenuItem.

virtual void IlvGadgetItem::drawPicture ( IlvPort dst,
const IlvRect rect,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
virtual

Is called to draw the item picture.

You can override this method to modify the way the item is drawn.

Parameters
dstThe destination drawing port.
rectThe rectangle where to draw the item picture.
tThe transformer used to draw the item picture.
clipThe clipping area.
See also
draw(), drawPicture(), itemRect().
virtual void IlvGadgetItem::edit ( )
virtual

Edits the item label.

Edits the item if editing is allowed.

See also
isEditable().
IlvBitmap* IlvGadgetItem::getBitmap ( IlUShort  index = (IlUShort) 0) const

Returns the bitmap whose index is specified.

Parameters
indexThe index of the bitmap.
Returns
The bitmap whose index is specified or 0 if there is no bitmap at this index.
See also
setBitmap().
IlvBitmap* IlvGadgetItem::getBitmap ( const IlSymbol symbol) const

Returns the bitmap corresponding to the specified symbol.

Returns
The bitmap corresponding to the specified symbol or 0 if there is no bitmap that matches this symbol.
See also
setBitmap(), BitmapSymbol(), SelectedBitmapSymbol(), InsensitiveBitmapSymbol(), HighlightedBitmapSymbol().
IlUShort IlvGadgetItem::getBitmapCount ( ) const

Returns the number of bitmaps used by this item.

Returns
The number of bitmaps used by this item.
See also
setBitmap().
virtual IlUInt IlvGadgetItem::getBitmapMask ( ) const
virtual

Returns the bitmap mask of the item.

The bitmap mask lets you know which bitmap indexes the item is handling. If the ith bit of the return value is set, it means that the item uses the bitmap of index i. You can get the associated symbol using the static member function GetItemBitmapSymbol().

Returns
The bitmap mask of the item.
See also
GetItemBitmapSymbol(), getBitmap(IlUShort).

Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.

IlAny IlvGadgetItem::getClientData ( ) const

Returns the client data of the item.

Client data is not typed where and can store any type of data.

Returns
The client data of the item. If no client data has been set, the member function returns 0.
See also
setClientData().
virtual IlvBitmap* IlvGadgetItem::getCurrentBitmap ( ) const
virtual

Returns the bitmap that is currently displayed by the item.

Returns
The bitmap that is currently displayed, depending on the item state. If you want to display a specific bitmap, you can override this member function is a subclass.
See also
getBitmap().

Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.

IlvGraphic* IlvGadgetItem::getGraphic ( ) const

Returns the IlvGraphic object associated with this item.

Returns
The IlvGraphic object associated with this item. You must not delete the returned IlvGraphic object.
See also
setGraphic().
virtual IlUShort IlvGadgetItem::getHeight ( ) const
virtual

Returns the item height.

Returns
The item height.
See also
getWidth(), itemRect().
virtual IlvPalette* IlvGadgetItem::getHighlightTextPalette ( ) const
virtual

Returns the palette used to draw the label of highlighted items.

By default, an item uses the palette of its holder. Therefore, this method simply calls IlvGadgetItemHolder::getHighlightTextPalette().

Returns
The palette used to draw the label of highlighted items.
See also
setHighlightTextPalette(), IlvGadgetItemHolder::getHighlightTextPalette().
IlvGadgetItemHolder* IlvGadgetItem::getHolder ( ) const

Returns the item holder.

Returns
The item holder or 0 if the item has no holder.
virtual IlvPalette* IlvGadgetItem::getInsensitivePalette ( ) const
virtual

Returns the palette used to draw a nonsensitive item.

By default, an item uses the palette of its holder. Therefore, this method simply calls IlvGadgetItemHolder::getInsensitivePalette().

Returns
The palette used to draw a nonsensitive item.
See also
IlvGadgetItemHolder::getInsensitivePalette().

Reimplemented in IlvMenuItem.

static IlShort IlvGadgetItem::GetItemBitmapIndex ( const IlSymbol symbol)
static

Returns the index corresponding to the specified symbol.

Returns
The index corresponding to symbol or -1 if the symbol does not match an existing index.
See also
GetItemBitmapSymbol(), AddItemBitmapSymbol(), setBitmap().
static IlSymbol* IlvGadgetItem::GetItemBitmapSymbol ( IlUShort  index)
static

Returns the symbol corresponding to the specified index.

Returns
The symbol corresponding to index or 0 if there is no such symbol.
See also
GetItemBitmapIndex(), AddItemBitmapSymbol(), setBitmap().
const char* IlvGadgetItem::getLabel ( ) const

Returns the item label.

Returns
The item label or 0 if there is no label.
IlvAlignment IlvGadgetItem::getLabelAlignment ( ) const

Returns the label alignment.

This method applies only when the label is made up of several lines.

Returns
The label alignment.
See also
setAlignment(), setLabel().
void IlvGadgetItem::getLabelOrientation ( IlvOrientation orientation,
IlBoolean flip 
) const

Returns the orientation of the item label.

Sets orientation and flip to the orientation of the item label.

Parameters
orientationThe label orientation.
flipSpecifies whether the label is drawn from top to bottom or from bottom to top.
See also
setLabelOrientation().
IlvPosition IlvGadgetItem::getLabelPosition ( ) const

Returns the position of the label relative to the picture.

Returns
The position of the label relative to the picture.
See also
setLabelPosition().
virtual const char* IlvGadgetItem::getMessage ( ) const
virtual

Returns the message of the item.

Returns
The message string with which the item label is associated in the display database. If the item label has no associated message string, the method returns the item label.
See also
getLabel().

Reimplemented in IlvMenuItem.

char IlvGadgetItem::getMnemonic ( ) const

Returns the mnemonic letter associated with the item.

To set a mnemonic letter, you must type the ^ (caret) character before the letter used as the mnemonic in the item label or message.

Returns
The mnemonic letter associated with the item or 0 if there is no mnemonic.
See also
setLabel().
const char* IlvGadgetItem::getName ( ) const
virtual

Returns the item name.

Returns
The item name. You must not delete or modify the returned string.
See also
setName(), IlvGadgetItemHolder::getItemByName().

Reimplemented from IlvValueInterface.

IlvNamedProperty* IlvGadgetItem::getNamedProperty ( const IlSymbol name) const

Returns the property whose name is specified.

Parameters
nameThe property name.
Returns
A pointer to the specified named property. Returns 0 if no named property matches the specified name.
See also
setNamedProperty(), removeNamedProperty().
virtual IlvPalette* IlvGadgetItem::getNormalTextPalette ( ) const
virtual

Returns the default palette used to draw an item.

By default, an item uses the palette of its holder. Therefore, this method simply calls IlvGadgetItemHolder::getNormalTextPalette().

Returns
The default palette used to draw an item.
See also
setNormalTextPalette(), IlvGadgetItemHolder::getNormalTextPalette().
virtual IlvPalette* IlvGadgetItem::getOpaquePalette ( ) const
virtual

Returns the palette that is used to draw opaque items.

By default, an item uses the palette of its holder. Therefore, this method simply calls IlvGadgetItemHolder::getOpaquePalette().

Returns
The palette used to draw opaque items.
See also
setOpaquePalette(), IlvGadgetItemHolder::getOpaquePalette().
IlAny IlvGadgetItem::getProperty ( const IlSymbol key) const

Returns the object property whose symbol is provided as the parameter.

Parameters
keyThe symbol representing the property.
Returns
The specified property value when it can be found. It Returns 0 when no property name matches the key parameter.
See also
setProperty(), removeProperty(), hasProperty().
virtual IlvPalette* IlvGadgetItem::getSelectionPalette ( ) const
virtual

Returns the palette used to draw selected items.

By default, an item uses the palette of its holder. Therefore, this method simply calls IlvGadgetItemHolder::getSelectionPalette().

Returns
The palette used to draw selected items.
See also
IlvGadgetItemHolder::getSelectionPalette().
virtual IlvPalette* IlvGadgetItem::getSelectionTextPalette ( ) const
virtual

Returns the palette used to draw the label of selected items.

By default, an item uses the palette of its holder. Therefore, this method simply calls IlvGadgetItemHolder::getSelectionTextPalette().

Returns
The palette used to draw the label of selected items.
See also
setSelectionTextPalette(), IlvGadgetItemHolder::getSelectionTextPalette().
IlUShort IlvGadgetItem::getSpacing ( ) const

Returns the spacing between the label and the picture of the item.

Returns
The spacing between the label and the picture of the item.
See also
setSpacing().
virtual IlUShort IlvGadgetItem::getWidth ( ) const
virtual

Returns the item width.

Returns
The item width.
See also
getHeight(), itemRect().
IlBoolean IlvGadgetItem::hasProperty ( const IlSymbol key) const

Indicates whether the item has the property whose symbol is specified.

Parameters
keyThe symbol representing the property.
Returns
IlTrue if the property specified by key was found, and IlFalse otherwise.
See also
setProperty(), removeProperty(), getProperty().
virtual void IlvGadgetItem::highlight ( IlBoolean  value = IlTrue)
virtual

Highlights the item.

Highlights the item if value is IlTrue, otherwise the item is not highlighted. Uses the highlight bitmap if one is provided.

Parameters
valueSpecifies whether the item should be highlighted.
See also
isHighlighted().
static IlSymbol* IlvGadgetItem::HighlightedBitmapSymbol ( )
static

Returns the symbol associated with the highlighted bitmap.

Returns
The symbol associated with the highlighted bitmap.
See also
GetItemBitmapIndex(), AddItemBitmapSymbol(), setBitmap(), highlight().
static IlSymbol* IlvGadgetItem::InsensitiveBitmapSymbol ( )
static

Returns the symbol associated with the nonsensitive bitmap.

Returns
The symbol associated with the nonsensitive bitmap.
See also
GetItemBitmapIndex(), AddItemBitmapSymbol(), setBitmap(), setSensitive().
IlBoolean IlvGadgetItem::isDragDropTarget ( ) const

Indicates whether the item is the target of a drag-and-drop operation.

When an item is the target of a drag-and-drop operation, it is drawn as if it was selected.

Returns
IlTrue if the item is considered a drag-and-drop target, and IlFalse otherwise.
See also
IlvGadgetItemHolder::setDragDropTarget().
IlBoolean IlvGadgetItem::isEditable ( ) const

Indicates whether the item can be edited.

Returns
IlTrue if the item can be edited and IlFalse otherwise.
See also
setEditable().
IlBoolean IlvGadgetItem::isHighlighted ( ) const

Indicates whether the item is highlighted.

Returns
IlTrue if the item is highlighted and IlFalse otherwise.
See also
highlight().
IlBoolean IlvGadgetItem::isOpaque ( ) const

Indicates whether the item is opaque.

Returns
IlTrue if the item is opaque and, IlFalse otherwise.
See also
setOpaque(), getOpaquePalette().
virtual IlBoolean IlvGadgetItem::isSelectable ( ) const
virtual

Indicates whether the item can be selected.

Is called when an item is about to be selected. You can redefine this member function to filter item selection.

Returns
IlTrue if the item can be selected, and IlFalse otherwise.
See also
select(), deSelect(), isSelected().

Reimplemented in IlvMenuItem.

IlBoolean IlvGadgetItem::isSelected ( ) const

Indicates whether the item is selected.

Returns
IlTrue if the item is selected, and IlFalse otherwise.
See also
select(), deSelect().
IlBoolean IlvGadgetItem::isSensitive ( ) const

Indicates whether the item is sensitive.

Returns
IlTrue if the item is sensitive and IlFalse otherwise.
See also
setSensitive(), getInsensitivePalette().
IlBoolean IlvGadgetItem::isShowingLabel ( ) const

Indicates whether the item label is visible.

Returns
IlTrue if the item label is visible, and IlFalse otherwise.
See also
showLabel(), isShowingPicture().
IlBoolean IlvGadgetItem::isShowingPicture ( ) const

Indicates whether the item picture is visible.

Returns
IlTrue if the item picture is visible, and IlFalse otherwise.
See also
showPicture(), isShowingLabel().
virtual void IlvGadgetItem::itemRect ( IlvRect rect,
const IlvRect bbox 
) const
virtual

Returns the item bounding bbox.

Sets the item bounding box to rect when the item is drawn in bbox.

Parameters
rectThe returned bounding box.
bboxThe rectangle where the item should be drawn.
See also
pictureRect(), labelRect(), selectionRect().
virtual void IlvGadgetItem::labelRect ( IlvRect rect,
const IlvRect bbox 
) const
virtual

Returns the bounding box of the item label.

Sets the bounding box of the item label to rect when the item is drawn in bbox.

Parameters
rectThe returned bounding box.
bboxThe rectangle where the item should be drawn.
See also
pictureRect(), itemRect(), selectionRect().
virtual void IlvGadgetItem::pictureRect ( IlvRect rect,
const IlvRect bbox 
) const
virtual

Returns the bounding bbox of the item picture.

Sets the bounding box of the item picture to rect when the item is drawn in bbox.

Parameters
rectThe returned bounding box.
bboxThe rectangle where the item should be drawn.
See also
labelRect(), itemRect(), selectionRect().
static IlvGadgetItem* IlvGadgetItem::readItem ( IlvInputFile file,
IlvDisplay display 
)
static

Reads an object description from a file.

Reads an object description from the file input. It reads the information that was saved by the member function write() to be able to create a new instance of this object. Usually, because of the availability of the constructor that expects an IlvInputFile, readItem() should be equivalent to:

MyClass::readItem(IlvInputFile& file, IlvDisplay* display)
{
return new MyClass(file, display);
}
Parameters
fileThe file to be read from.
displayThe display used to create the object.
See also
DeclareGadgetItemInfoRO(), DeclareGadgetItemInfo(), IlvPredefinedGadgetItemIOMembers().
Note
The readItem() method is not capitalized like other static methods so that it is consistent with the write() method.
virtual void IlvGadgetItem::recomputeSize ( IlBoolean  redraw = IlTrue)
virtual

Recomputes the item geometry.

Is internally called by each function that modifies the item size. If you change the size of an IlvGraphic object encapsulated by an IlvGadgetItem, you must call this member function. If redraw is IlTrue or is omitted, the item will be redrawn automatically.

Parameters
redrawSpecifies whether the item should be redrawn.
See also
computeRects(), getWidth(), getHeight().
void IlvGadgetItem::removeAllBitmaps ( )

Removes all the bitmaps associated with the item.

All the bitmaps are unlocked.

See also
setGraphic(), getBitmap(), setBitmap().
IlvNamedProperty* IlvGadgetItem::removeNamedProperty ( IlSymbol name)

Removes the specified named property from the object.

Parameters
nameThe property name.
Returns
The named property with the same name that was previously associated with this object. You can delete it or keep it for further handling. If no previous named property with the same name was associated with this object, this member function returns 0.
See also
getNamedProperty(), setNamedProperty().
IlBoolean IlvGadgetItem::removeProperty ( const IlSymbol key)

Removes a property from the object.

Parameters
keyThe symbol representing the property.
Returns
IlTrue if the property specified by key was found and IlFalse otherwise.
See also
setProperty(), getProperty(), hasProperty().
virtual void IlvGadgetItem::select ( )
virtual

Selects the item.

The default implementation selects and redraws the item, then it calls the holder method IlvGadgetItemHolder::itemSelected().

See also
isSelected(), deSelect(), SelectedBitmapSymbol().

Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.

static IlSymbol* IlvGadgetItem::SelectedBitmapSymbol ( )
static

Returns the symbol associated with the selected bitmap.

Returns
The symbol associated with the selected bitmap.
See also
GetItemBitmapIndex(), AddItemBitmapSymbol(), setBitmap(), select().
virtual void IlvGadgetItem::selectionRect ( IlvRect rect,
const IlvRect bbox 
) const
virtual

Returns the bounding box of the item selection.

Sets the bounding bbox of the item selection to rect when the item is drawn in bbox.

Parameters
rectThe returned bounding box.
bboxThe rectangle where the item should be drawn.
See also
pictureRect(), itemRect(), labelRect().
void IlvGadgetItem::setBitmap ( IlUShort  index,
IlvBitmap bitmap 
)

Sets the specified bitmap to the item at the specified index.

Sets the bitmap whose index is specified to bitmap. If a bitmap already exists for this index, it is unlocked. The new bitmap is locked. Existing indexes are:

Sensitive BitmapBitmapSymbol() 0
Selected BitmapSelectedBitmapSymbol() 1
Insensitive Bitmap InsensitiveBitmapSymbol() 2
Highlighted Bitmap HighlightedBitmapSymbol() 3

You can use other indexes to store more bitmaps. In this case, you must override the member function IlvGadgetItem::getCurrentBitmap() to return the correct bitmap.

Parameters
indexThe index to which the bitmap should be assigned.
bitmapThe new bitmap.
See also
getBitmap(), BitmapSymbol(), SelectedBitmapSymbol(), InsensitiveBitmapSymbol(), HighlightedBitmapSymbol().
void IlvGadgetItem::setBitmap ( const IlSymbol symbol,
IlvBitmap bitmap 
)

Sets the specified bitmap to the item using the specified symbol.

Sets the bitmap of the item specified by symbol to bitmap. If a bitmap already exists for this symbol, it is unlocked. The new bitmap is locked.

Parameters
symbolThe symbol specifying the type of bitmap.
bitmapThe new bitmap.
See also
getBitmap(), BitmapSymbol(), SelectedBitmapSymbol(), InsensitiveBitmapSymbol(), HighlightedBitmapSymbol().
void IlvGadgetItem::setBitmap ( IlvBitmap bitmap)

Sets the sensitive bitmap of the item.

Sets the sensitive bitmap to bitmap. If a sensitive bitmap already exists for this item, it is unlocked. The new bitmap is locked.

Parameters
bitmapThe new sensitive bitmap.
See also
getBitmap().
void IlvGadgetItem::setClientData ( IlAny  data)

Sets the new client data for this item.

Parameters
dataThe new client data. Any previous client data is lost.
See also
getClientData().
void IlvGadgetItem::setEditable ( IlBoolean  value)

Specifies whether the item should be editable.

Parameters
valueSpecifies whether the item should be editable (IlTrue) or not (IlFalse).
See also
isEditable().
void IlvGadgetItem::setGraphic ( IlvGraphic graphic)

Specifies the graphic object associated with this item.

Calls the member function IlvGadgetItem::removeAllBitmaps().

See also
getGraphic().
virtual void IlvGadgetItem::setHighlightTextPalette ( IlvPalette palette)
virtual

Sets the palette used to draw the label of highlighted items.

The specified palette is locked.

Parameters
paletteThe palette used to draw the label of highlighted items.
See also
getHighlightTextPalette().
void IlvGadgetItem::setLabel ( const char *  label,
IlBoolean  copy = IlTrue 
)

Sets the item label.

To create labels that extend over several lines use the '
' character to start a new line.

Parameters
labelThe new item label.
copySpecifies whether the label should be copied. In any case the label characters are deleted from the memory by the IlvGadgetItem.
See also
getLabel(), getMessage().
void IlvGadgetItem::setLabelAlignment ( IlvAlignment  alignment)

Sets the label alignment.

Sets the label alignment to alignment. This method applies only to labels composed of several lines.

Parameters
alignmentThe new label alignment. Valid values are: IlvLeft, IlvRight, or IlvCenter.
See also
getLabelAlignment(), setLabel().
void IlvGadgetItem::setLabelOrientation ( IlvOrientation  orientation,
IlBoolean  flip = IlFalse 
)

Sets the orientation of the item label.

Parameters
orientationThe label orientation. Valid values are: IlvHorizontal and IlvVertical.
flipSpecifies whether the label is drawn from top to bottom or from bottom to top.
See also
getLabelOrientation().
void IlvGadgetItem::setLabelPosition ( IlvPosition  position)

Sets the label position relative to the picture.

Parameters
positionThe new position. Valid values are: IlvLeft, IlvRight, IlvTop, IlvBottom, IlvCenter, IlvTopLeft, IlvTopRight, IlvBottomLeft, IlvBottomRight
See also
getLabelPosition().
void IlvGadgetItem::setName ( const char *  name)

Sets the item name.

Assigning a name to items helps you distinguish them by using a designation other than their labels.

Parameters
nameThe new item name.
See also
getName(), IlvGadgetItemHolder::getItemByName().
IlvNamedProperty* IlvGadgetItem::setNamedProperty ( IlvNamedProperty property)

Sets the specified named property to the object.

Parameters
propertyThe named property.
Returns
The named property with the same name that was previously associated with this object. You can delete it or keep it for further handling. If no previous named property with the same name was associated with this object, this member function returns 0.
See also
getNamedProperty(), removeNamedProperty().
virtual void IlvGadgetItem::setNormalTextPalette ( IlvPalette palette)
virtual

Sets the default palette used to draw an item.

The specified palette is locked.

Parameters
paletteThe default palette used to draw an item.
See also
getNormalTextPalette().
void IlvGadgetItem::setOpaque ( IlBoolean  value)

Specifies whether the item should be opaque.

When an item is opaque, its label is drawn with a background.

Parameters
valueSpecifies whether the item should be opaque (IlTrue) or not (IlFalse).
See also
isOpaque(), getOpaquePalette().
virtual void IlvGadgetItem::setOpaquePalette ( IlvPalette palette)
virtual

Sets the palette used to draw opaque items.

The specified palette is locked.

Parameters
paletteThe new opaque palette.
See also
getOpaquePalette().
void IlvGadgetItem::setProperty ( const IlSymbol key,
IlAny  value 
)

Sets the property whose symbol is specified to the item.

Parameters
keyThe symbol representing the property.
valueThe new value of the property. If value is 0, the property is removed.
See also
removeProperty(), getProperty(), hasProperty().
virtual void IlvGadgetItem::setSelectionTextPalette ( IlvPalette palette)
virtual

Sets the palette used to draw the label of selected items.

The specified palette is locked.

Parameters
paletteThe new selection palette.
See also
getSelectionTextPalette().
void IlvGadgetItem::setSensitive ( IlBoolean  value)

Specifies whether the item should be sensitive or not.

Uses the insensitive bitmap, if one is provided. If such a bitmap is not provided, and if a sensitive bitmap is available, the insensitive bitmap is automatically computed.

Parameters
valueSpecifies whether the item should be sensitive (IlTrue) or not (IlFalse).
See also
isSensitive(), getInsensitivePalette().
void IlvGadgetItem::setSpacing ( IlUShort  spacing)

Sets the spacing between the label and the picture of the item.

Parameters
spacingThe new spacing.
See also
getSpacing().
void IlvGadgetItem::showLabel ( IlBoolean  value = IlTrue)

Specifies whether the item label should be shown.

Specifies whether the item label should be shown (IlTrue) or not (IlFalse).

Parameters
valueSpecifies whether the item label should be shown.
See also
isShowingLabel(), showPicture().
void IlvGadgetItem::showPicture ( IlBoolean  value = IlTrue)

Specifies whether the item picture should be shown.

Specifies whether the item picture should be shown (IlTrue) or not (IlFalse).

Parameters
valueSpecifies whether the item picture should be shown.
virtual void IlvGadgetItem::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
DeclareGadgetItemInfoRO(), DeclareGadgetItemInfo(), IlvPredefinedGadgetItemIOMembers().

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