Using IlvAbstractBar
IlvAbstractBar is an abstract class for managing the size and position of menu bar or toolbar items. See
Using IlvAbstractMenu and
Using IlvMenuItem.
This section covers these topics:
Setting the Bar Orientation
You can specify the orientation of the bar with the member function
setOrientation and retrieve it with
getOrientation.
The bar can be vertical, in which case menu items are arranged from top to bottom, or it can be horizontal, in which case items are arranged from left to right.
Figure 13.8 Vertical and Horizontal Toolbars
Constraining the Bar Geometry
You can constrain the bar geometry so that all its items are visible whatever its size with the member function
setConstraintMode. When this member function is set to
IlTrue, the bar is automatically resized to accommodate all its items. Items can be extended to several lines if necessary. To know whether the constraint mode is on, call
useConstraintMode.
Figure 13.9 Constrained (Top) and Nonconstrained Toolbars (Bottom)
Notifying the Bar About Geometry Changes
When the constraint mode is on, the virtual member function
geometryChanged is called if:
![*](bullet.gif)
Modifying the height of a vertical bar causes its width to change.
![*](bullet.gif)
Modifying the width of a horizontal bar causes its height to change.
Setting the Default Item Size
You can set a default size for all the items in a bar with the member function
setDefaultItemSize and retrieve it with
getDefaultItemSize. You can specify the spacing between two items in a bar with
setSpacing and retrieve it with
getSpacing.
Aligning Items Flush-right
You can align the last item in a bar with its right border with the member function
setFlushingRight. Help menus, for example, are flush-right most of the time.
Figure 13.10 Help Menu Aligned Flush-right
Using Docking Features
You can dock and undock abstract bar objects. See
Using Docking Bars.
Version 5.6
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.