Gadget Item class. More...
#include <ilviews/gadgets/itemgdt.h>
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 (IlvBitmap *bitmap) | |
Constructor. More... | |
IlvGadgetItem (IlvGraphic *graphic) | |
Constructor. More... | |
virtual void | activate () |
Activates the item. More... | |
virtual IlvGadgetItem * | copy () 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, const 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... | |
IlvBitmap * | getBitmap (const IlSymbol *symbol) const |
Returns the bitmap corresponding to the specified symbol. More... | |
IlvBitmap * | getBitmap (IlUShort index=(IlUShort) 0) const |
Returns the bitmap whose index is specified. 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 IlvBitmap * | getCurrentBitmap () const |
Returns the bitmap that is currently displayed by the item. More... | |
IlvGraphic * | getGraphic () const |
Returns the IlvGraphic object associated with this item. More... | |
virtual IlUShort | getHeight () const |
Returns the item height. More... | |
virtual const IlvPalette * | getHighlightTextPalette () const |
Returns the palette used to draw the label of highlighted items. More... | |
IlvGadgetItemHolder * | getHolder () const |
Returns the item holder. More... | |
virtual const IlvPalette * | getInsensitivePalette () const |
Returns the palette used to draw a nonsensitive item. More... | |
const char * | getLabel () const |
Returns the item label. More... | |
virtual 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... | |
IlvNamedProperty * | getNamedProperty (const IlSymbol *name) const |
Returns the property whose name is specified. More... | |
virtual const IlvPalette * | getNormalTextPalette () const |
Returns the default palette used to draw an item. More... | |
virtual const IlvPalette * | getOpaquePalette () 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 const IlvPalette * | getSelectionPalette () const |
Returns the palette used to draw selected items. More... | |
virtual const IlvPalette * | getSelectionTextPalette () 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... | |
IlvNamedProperty * | removeNamedProperty (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 (const IlSymbol *symbol, IlvBitmap *bitmap) |
Sets the specified bitmap to the item using the specified symbol. More... | |
void | setBitmap (IlUShort index, IlvBitmap *bitmap) |
Sets the specified bitmap to the item at the specified index. 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... | |
virtual 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... | |
IlvNamedProperty * | setNamedProperty (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 IlSymbol * | BitmapSymbol () |
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 IlSymbol * | GetItemBitmapSymbol (IlUShort index) |
Returns the symbol corresponding to the specified index. More... | |
static IlSymbol * | HighlightedBitmapSymbol () |
Returns the symbol associated with the highlighted bitmap. More... | |
static IlSymbol * | InsensitiveBitmapSymbol () |
Returns the symbol associated with the nonsensitive bitmap. More... | |
static IlvGadgetItem * | readItem (IlvInputFile &file, IlvDisplay *display) |
Reads an object description from a file. More... | |
static IlSymbol * | SelectedBitmapSymbol () |
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 |
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.
IlvGadgetItemHolder
, IlvGadgetItemMatrixItem
, IlvMenuItem
, IlvTreeGadgetItem
, IlvBitmap
, IlvGraphic
.Name | Return type | Equivalent methods |
---|---|---|
activate() | Void | activate() |
edit() | Void | edit() |
copy() | Object | copy() |
Graphic property | CSS property | Type |
---|---|---|
Background color | background-color | Color |
Text color | color | Color |
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.
label | The item label. |
bitmap | The sensitive bitmap of the item. |
position | The label position relative to the picture. |
spacing | The spacing between the label and the picture. |
copy | Specifies 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.
label | The item label. |
graphic | The item picture. |
position | The label position relative to the picture. |
spacing | The spacing between the label and the picture. |
copy | Specifies 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.
graphic | The 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.
bitmap | The sensitive bitmap of the item. |
|
virtual |
Activates the item.
The default implementation calls the holder method IlvGadgetItemHolder::itemActivated()
.
IlvGadgetItemHolder::itemActivated()
. Links a new bitmap symbol with the specified index.
GetItemBitmapSymbol()
, GetItemBitmapIndex()
, setBitmap()
.
|
static |
Returns the symbol associated with the sensitive bitmap.
GetItemBitmapIndex()
, AddItemBitmapSymbol()
, setBitmap()
.
|
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.
labelRect | The returned bounding box of the item label. |
pictureRect | The returned bounding box of the item picture. |
computeSize()
, recomputeSize()
, labelRect()
, pictureRect()
.
|
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.
width | The returned item width. |
height | The returned item height. |
computeRects()
, recomputeSize()
, getWidth()
, getHeight()
. Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.
|
virtual |
Copies this object.
Allocates and returns a copy of this object. The named properties attached to the gadget item are also copied.
IlvPredefinedGadgetItemIOMembers()
.
|
virtual |
Deselects the item.
The default implementation deselects and redraws the item, then it calls the holder method IlvGadgetItemHolder::itemDeSelected()
.
isSelected()
, select()
, SelectedBitmapSymbol()
. Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.
|
virtual |
Is called to draw the item.
You can override this method to modify the way the item is drawn.
dst | The destination drawing port. |
rect | The rectangle where to the item will be drawn. |
t | The transformer used to draw the item. |
clip | The clipping area. |
|
virtual |
Is called to draw the item label.
You can override this method to modify the way the item is drawn.
dst | The destination drawing port. |
palette | The palette used to draw the item label. |
rect | The rectangle where to the item label will be drawn. |
t | The transformer used to draw the item label. |
clip | The clipping area. |
draw()
, drawPicture()
, itemRect()
. Reimplemented in IlvMenuItem.
|
virtual |
Is called to draw the item picture.
You can override this method to modify the way the item is drawn.
dst | The destination drawing port. |
rect | The rectangle where to draw the item picture. |
t | The transformer used to draw the item picture. |
clip | The clipping area. |
draw()
, drawPicture()
, itemRect()
.
|
virtual |
Returns the bitmap corresponding to the specified symbol.
0
if there is no bitmap that matches this symbol. Returns the bitmap whose index is specified.
index | The index of the bitmap. |
0
if there is no bitmap at this index. setBitmap()
. IlUShort IlvGadgetItem::getBitmapCount | ( | ) | const |
Returns the number of bitmaps used by this item.
setBitmap()
.
|
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()
.
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.
0
. setClientData()
.
|
virtual |
Returns the bitmap that is currently displayed by the item.
getBitmap()
. Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.
IlvGraphic* IlvGadgetItem::getGraphic | ( | ) | const |
Returns the IlvGraphic
object associated with this item.
IlvGraphic
object associated with this item. You must not delete the returned IlvGraphic
object. setGraphic()
.
|
virtual |
|
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()
.
IlvGadgetItemHolder* IlvGadgetItem::getHolder | ( | ) | const |
Returns the item holder.
0
if the item has no holder.
|
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()
.
Reimplemented in IlvMenuItem.
Returns the index corresponding to the specified symbol.
Returns the symbol corresponding to the specified index.
0
if there is no such symbol. GetItemBitmapIndex()
, AddItemBitmapSymbol()
, setBitmap()
. const char* IlvGadgetItem::getLabel | ( | ) | const |
Returns the item label.
0
if there is no label.
|
virtual |
Returns the label alignment.
This method applies only when the label is made up of several lines.
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.
orientation | The label orientation. |
flip | Specifies whether the label is drawn from top to bottom or from bottom to top. |
setLabelOrientation()
. IlvPosition IlvGadgetItem::getLabelPosition | ( | ) | const |
Returns the position of the label relative to the picture.
setLabelPosition()
.
|
virtual |
Returns the message of the item.
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.
0
if there is no mnemonic. setLabel()
.
|
virtual |
Returns the item name.
Reimplemented from IlvValueInterface.
IlvNamedProperty* IlvGadgetItem::getNamedProperty | ( | const IlSymbol * | name | ) | const |
Returns the property whose name is specified.
name | The property name. |
0
if no named property matches the specified name. setNamedProperty()
, removeNamedProperty()
.
|
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()
.
|
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 object property whose symbol is provided as the parameter.
key | The symbol representing the property. |
0
when no property name matches the key parameter. setProperty()
, removeProperty()
, hasProperty()
.
|
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()
.
|
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()
.
IlUShort IlvGadgetItem::getSpacing | ( | ) | const |
Returns the spacing between the label and the picture of the item.
setSpacing()
.
|
virtual |
Indicates whether the item has the property whose symbol is specified.
key | The symbol representing the property. |
IlTrue
if the property specified by key was found, and IlFalse
otherwise. setProperty()
, removeProperty()
, getProperty()
. Highlights the item.
Highlights the item if value is IlTrue
, otherwise the item is not highlighted. Uses the highlight bitmap if one is provided.
value | Specifies whether the item should be highlighted. |
isHighlighted()
.
|
static |
Returns the symbol associated with the highlighted bitmap.
|
static |
Returns the symbol associated with the nonsensitive bitmap.
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.
IlTrue
if the item is considered a drag-and-drop target, and IlFalse
otherwise. IlBoolean IlvGadgetItem::isEditable | ( | ) | const |
Indicates whether the item can be edited.
IlTrue
if the item can be edited and IlFalse
otherwise. setEditable()
. IlBoolean IlvGadgetItem::isHighlighted | ( | ) | const |
Indicates whether the item is highlighted.
IlTrue
if the item is highlighted and IlFalse
otherwise. highlight()
. IlBoolean IlvGadgetItem::isOpaque | ( | ) | const |
Indicates whether the item is opaque.
IlTrue
if the item is opaque and, IlFalse
otherwise. setOpaque()
, getOpaquePalette()
.
|
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.
IlTrue
if the item can be selected, and IlFalse
otherwise. select()
, deSelect()
, isSelected()
. Reimplemented in IlvMenuItem.
IlBoolean IlvGadgetItem::isSelected | ( | ) | const |
Indicates whether the item is selected.
IlTrue
if the item is selected, and IlFalse
otherwise. select()
, deSelect()
. IlBoolean IlvGadgetItem::isSensitive | ( | ) | const |
Indicates whether the item is sensitive.
IlTrue
if the item is sensitive and IlFalse
otherwise. setSensitive()
, getInsensitivePalette()
. IlBoolean IlvGadgetItem::isShowingLabel | ( | ) | const |
Indicates whether the item label is visible.
IlTrue
if the item label is visible, and IlFalse
otherwise. showLabel()
, isShowingPicture()
. IlBoolean IlvGadgetItem::isShowingPicture | ( | ) | const |
Indicates whether the item picture is visible.
IlTrue
if the item picture is visible, and IlFalse
otherwise. showPicture()
, isShowingLabel()
. Returns the item bounding bbox.
Sets the item bounding box to rect when the item is drawn in bbox.
rect | The returned bounding box. |
bbox | The rectangle where the item should be drawn. |
pictureRect()
, labelRect()
, selectionRect()
. 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.
rect | The returned bounding box. |
bbox | The rectangle where the item should be drawn. |
pictureRect()
, itemRect()
, selectionRect()
. 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.
rect | The returned bounding box. |
bbox | The rectangle where the item should be drawn. |
labelRect()
, itemRect()
, selectionRect()
.
|
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:
file | The file to be read from. |
display | The display used to create the object. |
readItem()
method is not capitalized like other static methods so that it is consistent with the write()
method. 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.
redraw | Specifies whether the item should be redrawn. |
computeRects()
, getWidth()
, getHeight()
. void IlvGadgetItem::removeAllBitmaps | ( | ) |
Removes all the bitmaps associated with the item.
All the bitmaps are unlocked.
setGraphic()
, getBitmap()
, setBitmap()
. IlvNamedProperty* IlvGadgetItem::removeNamedProperty | ( | IlSymbol * | name | ) |
Removes the specified named property from the object.
name | The property name. |
0
. getNamedProperty()
, setNamedProperty()
. Removes a property from the object.
key | The symbol representing the property. |
IlTrue
if the property specified by key was found and IlFalse
otherwise. setProperty()
, getProperty()
, hasProperty()
.
|
virtual |
Selects the item.
The default implementation selects and redraws the item, then it calls the holder method IlvGadgetItemHolder::itemSelected()
.
isSelected()
, deSelect()
, SelectedBitmapSymbol()
. Reimplemented in IlvTreeGadgetItem, and IlvMenuItem.
|
static |
Returns the symbol associated with the selected bitmap.
GetItemBitmapIndex()
, AddItemBitmapSymbol()
, setBitmap()
, select()
. 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.
rect | The returned bounding box. |
bbox | The rectangle where the item should be drawn. |
pictureRect()
, itemRect()
, labelRect()
. 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.
symbol | The symbol specifying the type of bitmap. |
bitmap | The new 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 Bitmap | BitmapSymbol() | 0 |
Selected Bitmap | SelectedBitmapSymbol() | 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.
index | The index to which the bitmap should be assigned. |
bitmap | The new bitmap. |
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.
bitmap | The new sensitive bitmap. |
getBitmap()
. void IlvGadgetItem::setClientData | ( | IlAny | data | ) |
Sets the new client data for this item.
data | The new client data. Any previous client data is lost. |
getClientData()
. void IlvGadgetItem::setEditable | ( | IlBoolean | value | ) |
Specifies whether the item should be editable.
value | Specifies whether the item should be editable (IlTrue ) or not (IlFalse ). |
isEditable()
. void IlvGadgetItem::setGraphic | ( | IlvGraphic * | graphic | ) |
Specifies the graphic object associated with this item.
Calls the member function IlvGadgetItem::removeAllBitmaps()
.
getGraphic()
.
|
virtual |
Sets the palette used to draw the label of highlighted items.
The specified palette is locked.
palette | The palette used to draw the label of highlighted items. |
getHighlightTextPalette()
. Sets the item label.
To create labels that extend over several lines use the '
' character to start a new line.
label | The new item label. |
copy | Specifies whether the label should be copied. In any case the label characters are deleted from the memory by the IlvGadgetItem . |
getLabel()
, getMessage()
.
|
virtual |
Sets the label alignment.
Sets the label alignment to alignment. This method applies only to labels composed of several lines.
alignment | The new label alignment. Valid values are: IlvLeft , IlvRight , or IlvCenter . |
getLabelAlignment()
, setLabel()
. Sets the orientation of the item label.
orientation | The label orientation. Valid values are: IlvHorizontal and IlvVertical . |
flip | Specifies whether the label is drawn from top to bottom or from bottom to top. |
getLabelOrientation()
. void IlvGadgetItem::setLabelPosition | ( | IlvPosition | position | ) |
Sets the label position relative to the picture.
position | The new position. Valid values are: IlvLeft , IlvRight , IlvTop , IlvBottom , IlvCenter , IlvTopLeft , IlvTopRight , IlvBottomLeft , IlvBottomRight |
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.
name | The new item name. |
IlvNamedProperty* IlvGadgetItem::setNamedProperty | ( | IlvNamedProperty * | property | ) |
Sets the specified named property to the object.
property | The named property. |
0
. getNamedProperty()
, removeNamedProperty()
.
|
virtual |
Sets the default palette used to draw an item.
The specified palette is locked.
palette | The default palette used to draw an item. |
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.
value | Specifies whether the item should be opaque (IlTrue ) or not (IlFalse ). |
isOpaque()
, getOpaquePalette()
.
|
virtual |
Sets the palette used to draw opaque items.
The specified palette is locked.
palette | The new opaque palette. |
getOpaquePalette()
. Sets the property whose symbol is specified to the item.
key | The symbol representing the property. |
value | The new value of the property. If value is 0 , the property is removed. |
removeProperty()
, getProperty()
, hasProperty()
.
|
virtual |
Sets the palette used to draw the label of selected items.
The specified palette is locked.
palette | The new selection palette. |
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.
value | Specifies whether the item should be sensitive (IlTrue ) or not (IlFalse ). |
isSensitive()
, getInsensitivePalette()
. void IlvGadgetItem::setSpacing | ( | IlUShort | spacing | ) |
Sets the spacing between the label and the picture of the item.
spacing | The new spacing. |
getSpacing()
. Specifies whether the item label should be shown.
Specifies whether the item label should be shown (IlTrue
) or not (IlFalse
).
value | Specifies whether the item label should be shown. |
isShowingLabel()
, showPicture()
. Specifies whether the item picture should be shown.
Specifies whether the item picture should be shown (IlTrue
) or not (IlFalse
).
value | Specifies whether the item picture should be shown. |
|
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()
.
file | The name of the file to be written to. |