Using IlvMenuBar and IlvToolBar

The classes IlvMenuBar and IlvToolBar define menu bars and toolbars.

A Menu Bar

A Toolbar

These classes are very similar. The only difference is that IlvToolBar provides interactive features that the IlvMenuBar does not support, such as tooltips and gadgets.

Managing Gadgets in a Toolbar

You can use gadgets as toolbar items using the member function setGraphic. These gadgets are active, which means that they react to user events.

You can add a gadget to a toolbar with the member function insertGraphic.

A Toolbar with a Gadget shows a toolbar with a combo box.

A Toolbar with a Gadget

When the user clicks a gadget in a toolbar, the gadget is given the focus and all keyboard events are directly sent to it. See Focus Management.

You can force the focus to be given to a specific item with setFocusItem and retrieve the gadget that has the focus with getFocusItem.

Using Tooltips in a Toolbar

Menu items in a toolbar can be associated with a tooltip. A tooltip is short explanatory text that is displayed when the user places the mouse over its associated menu item.

To set a tooltip for a menu item, use setToolTip. To disable tooltips, call useToolTips with its parameter set to IlFalse.

Tooltip Displayed