Views
Gadgets Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
IlvMenuItem Class Reference

Menu item class. More...

#include <ilviews/gadgets/amenu.h>

Inheritance diagram for IlvMenuItem:
IlvGadgetItem IlvValueInterface IlvStylable IlvMenuItemPath

Public Member Functions

 IlvMenuItem ()
 Constructor. More...
 
 IlvMenuItem (const char *label)
 Constructor. More...
 
 IlvMenuItem (IlvBitmap *bitmap)
 Constructor. More...
 
 IlvMenuItem (IlvGraphic *graphic)
 Constructor. More...
 
virtual void deSelect ()
 Deselects the item. More...
 
void detachMenu (IlBoolean destroy=IlFalse)
 Suppresses the IlvPopupMenu associated with the menu 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...
 
IlUShort getAcceleratorKey () const
 Returns the accelerator key of the menu item. More...
 
IlUShort getAcceleratorModifiers () const
 Returns the combination of modifiers used with the menu item accelerator. More...
 
const char * getAcceleratorText () const
 Returns the text describing the accelerator. More...
 
virtual IlUInt getBitmapMask () const
 Returns the bitmap mask of the item. More...
 
IlvGraphicCallback getCallback () const
 Returns a pointer to the item callback. More...
 
IlSymbolgetCallbackName () const
 Returns the symbol that represents the name of the item callback. More...
 
virtual IlvBitmapgetCurrentBitmap () const
 Returns the bitmap that is currently displayed by the item. More...
 
virtual IlvPalettegetInsensitivePalette () const
 Returns the palette used to draw a nonsensitive item. More...
 
IlvPopupMenugetMenu () const
 Returns the IlvPopupMenu displayed by the menu item. More...
 
virtual const char * getMessage () const
 Returns the message of the item. More...
 
const char * getToolTip () const
 Returns the message used in the tooltip associated with the menu item. More...
 
IlvMenuItemType getType () const
 Returns the type of the menu item. More...
 
IlBoolean isChecked () const
 Specifies whether the menu item is checked. More...
 
IlBoolean isRadioToggle () const
 Returns the radio state of the menu item. More...
 
IlBoolean isReadOnly () const
 Indicates whether the menu item is read-only. More...
 
virtual IlBoolean isSelectable () const
 Indicates whether the item can be selected. More...
 
IlBoolean isTearOff () const
 Indicates whether the menu item is a tear-off item. More...
 
IlBoolean isToggle () const
 Indicates whether the menu item is a toggle item. More...
 
virtual void select ()
 Selects the item. More...
 
void setAcceleratorKey (IlUShort key)
 Sets the accelerator key of the menu item. More...
 
void setAcceleratorModifiers (IlUShort modifiers)
 Sets the combination of modifiers used with the menu item accelerator. More...
 
void setAcceleratorText (const char *text)
 Sets the text describing the accelerator. More...
 
void setCallback (IlvGraphicCallback callback)
 Sets the item callback. More...
 
void setCallbackName (IlSymbol *callbackName)
 Sets the name of the item callback. More...
 
void setChecked (IlBoolean value)
 Specifies whether the menu item should be checked. More...
 
void setMenu (IlvPopupMenu *menu, IlBoolean copy=IlTrue)
 Sets the IlvPopupMenu displayed by the menu item. More...
 
void setRadioToggle (IlBoolean value)
 Sets the radio state of the menu item. More...
 
void setReadOnly (IlBoolean value)
 Specifies whether the menu item should be read-only. More...
 
void setTearOff (IlBoolean value=IlTrue)
 Specifies whether the menu item should be a tear-off item. More...
 
void setToggle (IlBoolean value)
 Specifies whether the menu item should be a toggle item. More...
 
void setToolTip (const char *tooltip)
 Sets the message displayed by the tooltip associated with the menu item. More...
 
virtual void sizes (IlvPalette *pal, IlvDim &width, IlvDim &height, IlBoolean margin=IlTrue) const
 Returns the size of the menu item. More...
 
- Public Member Functions inherited from IlvGadgetItem
 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 IlvGadgetItemcopy () const
 Copies this object. 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 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 (const IlSymbol *symbol) const
 Returns the bitmap corresponding to the specified symbol. More...
 
IlvBitmapgetBitmap (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...
 
IlAny getClientData () const
 Returns the client data of 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...
 
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...
 
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...
 
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 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...
 
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 IlSymbolCheckedBitmapSymbol ()
 Returns the symbol of the checked bitmap. More...
 
- Static Public Member Functions inherited from IlvGadgetItem
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 computeSize (IlUShort &, IlUShort &) const
 Computes the item size. More...
 
- Protected Member Functions inherited from IlvGadgetItem
virtual void computeRects (IlvRect &labelRect, IlvRect &pictureRect) const
 Computes the label and picture bounding boxes. More...
 

Friends

class IlvAbstractMenu
 
class IlvPopupMenu
 

Detailed Description

Menu item class.

Library: ilvgadgt

The class IlvMenuItem implements the items appearing in pop-up menus (IlvPopupMenu) or in menu bars (IlvMenuBar, IlvToolBar). A menu item can display a label, a bitmap, a graphic object and can be used as a separator.

See also
IlvAbstractMenu, IlvPopupMenu, IlvAbstractBar, IlvToolBar, IlvMenuBar.

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 IlvGadgetItem and adds the following ones:

Name Type Equivalent methods
type Int getType()
checkedBitmap Bitmap getBitmap(const IlSymbol*) const, setBitmap()
checked Boolean isChecked(), setChecked()
readOnly Boolean isReadOnly(), setReadOnly()
radio Boolean isRadioToggle(), setRadioToggle()
toggle Boolean isToggle(), setToggle()
tooltip String getToolTip(), setToolTip()
menu Object getMenu(), setMenu()
callbackName String getCallbackName(), setCallbackName()

Constructor & Destructor Documentation

◆ IlvMenuItem() [1/4]

IlvMenuItem::IlvMenuItem ( const char *  label)

Constructor.

Initializes a new instance of the IlvMenuItem class.

Parameters
labelThe label of the menu item.

◆ IlvMenuItem() [2/4]

IlvMenuItem::IlvMenuItem ( IlvBitmap bitmap)

Constructor.

Initializes a new instance of the IlvMenuItem class.

Parameters
bitmapThe bitmap displayed by the menu item. The bitmap provided is used as the sensitive bitmap of the menu item. For more details, see IlvGadget::setBitmap(). The bitmap is locked.

◆ IlvMenuItem() [3/4]

IlvMenuItem::IlvMenuItem ( IlvGraphic graphic)

Constructor.

Initializes a new instance of the IlvMenuItem class.

Parameters
graphicThe graphic object displayed by the menu item.

◆ IlvMenuItem() [4/4]

IlvMenuItem::IlvMenuItem ( )

Constructor.

Initializes a new instance of the IlvMenuItem class. This constructor creates a menu item that serves as a separator.

Member Function Documentation

◆ CheckedBitmapSymbol()

static IlSymbol* IlvMenuItem::CheckedBitmapSymbol ( )
static

Returns the symbol of the checked bitmap.

Returns
The symbol used to reference the checked bitmap of a menu item.
See also
IlvGadgetItem::setBitmap().

◆ computeSize()

virtual void IlvMenuItem::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 from IlvGadgetItem.

◆ deSelect()

virtual void IlvMenuItem::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 from IlvGadgetItem.

◆ detachMenu()

void IlvMenuItem::detachMenu ( IlBoolean  destroy = IlFalse)

Suppresses the IlvPopupMenu associated with the menu item.

Parameters
destroyIlTrue if the suppressed pop-up menu should be destroyed.
See also
setMenu().

◆ drawLabel()

virtual void IlvMenuItem::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 from IlvGadgetItem.

◆ getAcceleratorKey()

IlUShort IlvMenuItem::getAcceleratorKey ( ) const

Returns the accelerator key of the menu item.

Returns
The accelerator key. Used in combination with the modifier keys it provides a quick access to the callback attached to the menu item.
See also
setAcceleratorKey(), getAcceleratorModifiers(), getAcceleratorText().

◆ getAcceleratorModifiers()

IlUShort IlvMenuItem::getAcceleratorModifiers ( ) const

Returns the combination of modifiers used with the menu item accelerator.

Returns
The combination of modifiers, such as IlvCtrlModifier or IlvShiftModifier, that should be used in combination with the accelerator key to invoke the menu item callback (see IlvEvent::modifiers()).
See also
setAcceleratorKey(), getAcceleratorKey(), getAcceleratorText().

◆ getAcceleratorText()

const char* IlvMenuItem::getAcceleratorText ( ) const

Returns the text describing the accelerator.

This text appears to the right of the menu item.

Returns
The text that is shown on the menu item to describe the accelerator when the item is located in an IlvPopupMenu.
See also
setAcceleratorText(), getAcceleratorModifiers(), getAcceleratorKey().

◆ getBitmapMask()

virtual IlUInt IlvMenuItem::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 from IlvGadgetItem.

◆ getCallback()

IlvGraphicCallback IlvMenuItem::getCallback ( ) const

Returns a pointer to the item callback.

Returns
A pointer to the callback associated with the menu item or 0 if there is none.

◆ getCallbackName()

IlSymbol* IlvMenuItem::getCallbackName ( ) const

Returns the symbol that represents the name of the item callback.

Returns
The symbol that represents the name of the item callback or 0 if there is none.
See also
setCallbackName(), getCallback().

◆ getCurrentBitmap()

virtual IlvBitmap* IlvMenuItem::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 from IlvGadgetItem.

◆ getInsensitivePalette()

virtual IlvPalette* IlvMenuItem::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 from IlvGadgetItem.

◆ getMenu()

IlvPopupMenu* IlvMenuItem::getMenu ( ) const

Returns the IlvPopupMenu displayed by the menu item.

Returns
The submenu associated with this menu item or 0 if there is none.
See also
setMenu().

◆ getMessage()

virtual const char* IlvMenuItem::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 from IlvGadgetItem.

◆ getToolTip()

const char* IlvMenuItem::getToolTip ( ) const

Returns the message used in the tooltip associated with the menu item.

Returns
The message used in the tooltip associated with this menu item or 0 if there is none.
See also
setToolTip().

◆ getType()

IlvMenuItemType IlvMenuItem::getType ( ) const

Returns the type of the menu item.

Returns
The type of menu entry. This method is obsolete since a menu item now displays both a picture and a label. Only the following two return values are meaningful: IlvSeparatorItem and IlvTearOffItem.
See also
IlvMenuItemType.

◆ isChecked()

IlBoolean IlvMenuItem::isChecked ( ) const

Specifies whether the menu item is checked.

Returns
IlTrue if the menu item is checked. In this case, if the menu item is part of an IlvPopupMenu, a small check mark appears to the left side of the menu item. It returns IlFalse if the menu item is not checked.
See also
setChecked().

◆ isRadioToggle()

IlBoolean IlvMenuItem::isRadioToggle ( ) const

Returns the radio state of the menu item.

Returns
IlTrue if the menu item is radio. When an item is radio and is located in an IlvPopupMenu, a radio toggle check mark appears next to it, whether the item is checked or not.
Note
A radio toggle appears as a diamond under Motif and as a circle under Windows/Windows 95/ViewsX.
See also
setRadioToggle(), IlvPopupMenu.

◆ isReadOnly()

IlBoolean IlvMenuItem::isReadOnly ( ) const

Indicates whether the menu item is read-only.

A menu entry can be read-only. A read-only menu item cannot be selected.

Returns
IlTrue if the menu item is read-only and IlFalse otherwise.
See also
setReadOnly().

◆ isSelectable()

virtual IlBoolean IlvMenuItem::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 from IlvGadgetItem.

◆ isTearOff()

IlBoolean IlvMenuItem::isTearOff ( ) const

Indicates whether the menu item is a tear-off item.

Returns
IlTrue if the menu item is a tear-off item.
See also
setTearOff(), getType().

◆ isToggle()

IlBoolean IlvMenuItem::isToggle ( ) const

Indicates whether the menu item is a toggle item.

Returns
IlTrue if the menu item is a toggle item. In this case, a check mark appears next to the item whether it is checked or not.
See also
setToggle().

◆ select()

virtual void IlvMenuItem::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 from IlvGadgetItem.

◆ setAcceleratorKey()

void IlvMenuItem::setAcceleratorKey ( IlUShort  key)

Sets the accelerator key of the menu item.

Sets key as the accelerator key. Used in combination with the modifier keys, it provides a quick access to the callback attached to the menu item.

Parameters
keyThe new accelerator key.
See also
getAcceleratorKey(), setAcceleratorText(), setAcceleratorModifiers().

◆ setAcceleratorModifiers()

void IlvMenuItem::setAcceleratorModifiers ( IlUShort  modifiers)

Sets the combination of modifiers used with the menu item accelerator.

Sets the combination of modifiers, such as IlvCtrlModifier or IlvShiftModifier), that is to be used in combination with the accelerator key to call the menu item callback (see IlvEvent::modifiers()).

Parameters
modifiersThe new modifiers to be used with the accelerator.
See also
getAcceleratorModifiers(), setAcceleratorKey(), setAcceleratorText().

◆ setAcceleratorText()

void IlvMenuItem::setAcceleratorText ( const char *  text)

Sets the text describing the accelerator.

This text appears to the right of the menu item.

Sets text as the text that appears in the menu item to describe the accelerator when the item is located in an IlvPopupMenu.

Parameters
textThe new text for the accelerator.
See also
getAcceleratorText(), setAcceleratorModifiers(), setAcceleratorKey().

◆ setCallback()

void IlvMenuItem::setCallback ( IlvGraphicCallback  callback)

Sets the item callback.

Sets the callback associated with the menu item to callback.

Parameters
callbackA pointer to the new item callback.
See also
getCallback(), setCallbackName().

◆ setCallbackName()

void IlvMenuItem::setCallbackName ( IlSymbol callbackName)

Sets the name of the item callback.

Sets the name of the item callback to callbackName. The item callback is triggered when the item is activated.

Parameters
callbackNameThe name of the callback.
See also
getCallbackName(), setCallback().

◆ setChecked()

void IlvMenuItem::setChecked ( IlBoolean  value)

Specifies whether the menu item should be checked.

If the item has a sensitive bitmap, and if no checked bitmap has been provided, a default checked bitmap is automatically computed the first time the item is checked.

Parameters
valueSpecifies whether the menu item should be checked.
See also
isChecked(), IlvGadgetItem::setBitmap(), CheckedBitmapSymbol()

◆ setMenu()

void IlvMenuItem::setMenu ( IlvPopupMenu menu,
IlBoolean  copy = IlTrue 
)

Sets the IlvPopupMenu displayed by the menu item.

Sets a submenu to this menu item. A small arrow is displayed on the right side of the entry when the item is located in an IlvPopupMenu. If there was already a submenu, then it is deleted.

Parameters
menuThe new submenu.
copyIlTrue if menu should be copied.
See also
getMenu().

◆ setRadioToggle()

void IlvMenuItem::setRadioToggle ( IlBoolean  value)

Sets the radio state of the menu item.

Sets the menu item to be a radio toggle, if value is IlTrue.

Parameters
valueSpecifies whether the menu item should be a radio item.
See also
isRadioToggle().

◆ setReadOnly()

void IlvMenuItem::setReadOnly ( IlBoolean  value)

Specifies whether the menu item should be read-only.

Sets the menu item to the read-only mode. If value is IlTrue, the menu item cannot be selected.

Parameters
valueSpecifies whether the menu item should be read-only.
See also
isReadOnly().

◆ setTearOff()

void IlvMenuItem::setTearOff ( IlBoolean  value = IlTrue)

Specifies whether the menu item should be a tear-off item.

A tear-off menu item is represented by a dashed line when it is located in an IlvPopupMenu. When selected, a tear-off menu item creates a top window in which a copy of the pop-up menu that contains it is put.

Parameters
valueThe tear-off state of the menu item.
See also
setTearOff(), getType().

◆ setToggle()

void IlvMenuItem::setToggle ( IlBoolean  value)

Specifies whether the menu item should be a toggle item.

Sets the menu item to be a toggle item. A toggle item located in an IlvPopupMenu has a check mark displayed next to it only when using the Motif look-and-feel.
If the toggle item is located in an IlvToolBar, then the item has a toggle behavior.

Parameters
valueSpecifies whether the menu item should be a toggle item.
See also
isToggle(), IlvToolBar, IlvPopupMenu.

◆ setToolTip()

void IlvMenuItem::setToolTip ( const char *  tooltip)

Sets the message displayed by the tooltip associated with the menu item.

Sets the message displayed by the tooltip associated with this menu item. Tooltips attached to menu items are only active when the items belong to an IlvToolBar object.

Parameters
tooltipThe message to be displayed by the tooltip.
See also
getToolTip(), IlvToolBar.

◆ sizes()

virtual void IlvMenuItem::sizes ( IlvPalette pal,
IlvDim width,
IlvDim height,
IlBoolean  margin = IlTrue 
) const
virtual

Returns the size of the menu item.

Returns in width and height the size of the menu item.

Parameters
palThis parameter is not used anymore.
widthIs set to the width of the menu item.
heightIs set to the height of the menu item.
marginThis parameter is not used anymore.
See also
IlvGadgetItem::getWidth(), IlvGadgetItem::getHeight().