Using IlvOptionMenu

The class IlvOptionMenu defines a drop-drown list of items from which the user can select.

An Option Menu

Note

Because the Microsoft ®Windows® look and feel does not provide an option menu, the class IlvOptionMenu is represented as a combo box when the style in use is Microsoft Windows.

This section covers the following topics:

Setting and Retrieving Items

Because IlvOptionMenu is a subclass of IlvListGadgetItemHolder, you must use the member functions of this class to modify the items of the option menu.

See IlvListGadgetItemHolder.

Changing and Retrieving the Selected Item

To modify the selected item in an option menu, use the member function setSelected. To retrieve the index of the selected item, use whichSelected.

Localizing Option Menus

Option menus can be localized.

See Localizing a Gadget.

Event Handling and Callbacks

When the user selects a new item in the menu, either by pointing on it with the mouse or by using the arrow keys, the virtual member function doIt is called. It can be overridden in a subclass of the option menu when necessary.

Its default implementation invokes the Main callback of the option menu.

See Associating a Callback with a Gadget.