Working with IToolBar Parts

The following tasks are associated with using an IToolBar* part in visual composition. Tasks that are common to many parts are described in related topics.

Defining the location of a tool bar
To set the location of the tool bar, set the location property in the IToolBar* property sheet. With the <default> value, the tool bar is positioned above the client area of the frame window that owns it. Alternatively, select one of the following choices in the value column:

aboveClient
Positions the tool bar above the client area. The tool bar orientation is horizontal.

belowClient
Positions the tool bar below the client area. The tool bar orientation is horizontal.

floating
Places the tool bar in the client area of its own frame window. The tool bar orientation is horizontal. If you drop an IToolBar* part on the free-form surface, you can define it as floating.

hidden
Makes the tool bar invisible, so it has no location.

leftOfClient
Positions the tool bar left of the client area. The tool bar orientation is vertical.

rightOfClient
Positions the tool bar right of the client area. The tool bar orientation is vertical.

Hiding a tool bar
To hide the tool bar, set the location property in the IToolBar* property sheet. Select hidden in the value column.

Grouping tool bars
To group a second tool bar with one previously added to the frame window, set the groupWithPreceding property in the IToolBar* property sheet. Select true in the value column. The tool bar is placed after the previously added tool bar in the same row or column.

Defining a tool bar title
When the user drags the tool bar away from the frame window, it Places the tool bar in the client area of its own frame window. The tool bar frame window floats free of the frame window that owns it. To define a title for the floating tool bar frame window, set the floatingTitle property in the IToolBar* property sheet. Enter the title in the value column.

Adding controls to a tool bar
To add controls to the tool bar, select control parts from the parts palette and drop them on the IToolBar* part. The following controls are commonly added to tool bars:

Reordering controls on a tool bar
To reorder tool bar buttons and other controls on a tool bar, open the IToolBar* pop-up menu and select View parts list. Then, in the parts list window, drag parts within the list to reorder them.

Setting the initial view of tool bar buttons
Tool bar buttons can show bitmaps, text, or both. To define the initial view of tool bar buttons on the tool bar, do either of the following:

Changing the view of tool bar buttons
To change the view of tool bar buttons on the tool bar when a push button is selected, connect the IPushButton* buttonClickEvent feature to the IToolBar* buttonView attribute. Specify the new view by doing either of the following:


Related procedures
Common Tasks for Control Parts
Setting Part Style Properties
Setting Part Color Properties
Setting Part Font Properties
Setting Part Handlers Properties
Setting Part Framing Properties
Providing Drag and Drop Support
Working with VisualAge User Interface Parts

Related references
IToolBar
Property Settings -- IToolBar
Portability -- IToolBar