Using IlvMenuBar and IlvToolBar
The classes
IlvMenuBar and
IlvToolBar define menu bars and toolbars.
Figure 13.11 A Menu Bar
Figure 13.12 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.
Figure 13.13 shows a toolbar with a combo box.
Figure 13.13 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.
Figure 13.14 Tooltip Displayed
Version 5.6
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.