# Toolbar Control

toolslib\custctrl\toolbar.fp

This instrument driver contains functions for creating and managing toolbar controls. Toolbar and toolbar items provide access to commonly used functions and operations by way of a graphical interface. You can include multiple toolbars per panel.

You can add the following types of items to the toolbar.

- Command Button—Behaves the same way as a user interface command button control.
- Toggle Button—Behaves the same way as a user interface toggle button control.
- Exclusive Toggle Button—Behaves similarly to a user interface toggle button, but you can select only one exclusive toggle button at a time.
- Separator—Serves as a divider on the toolbar.
- Ring—Behaves the same way as a user interface ring control.
- String—Behaves the same way as a user interface string control.
- Text Pulldown Menu—Lists a group of items when you select the pulldown menu.
- Picture Pulldown Menu—Lists a group of items when you select the pulldown menu. The picture pulldown menu contains a picture instead of text label.
- Color Numeric—Behaves the same way as a user interface color numeric control.
- Move Handle—Allows you to dock and undock toolbars on the panel. You also can move toolbars between multiple panels.

You can associate images with the command buttons, toggle buttons, picture pulldown menus, and exclusive toggle buttons. LabWindows/CVI uses picture button controls for the items for which you specify images.

If the toolbar is wider than the panel, a narrow button with two arrows appears in place of the toolbar controls that do not fit on the panel. Select this button to view and select those controls.

You can call the following function to allow the user to select which items appear on the toolbar.

Toolbar_SetAttribute (myToolbar, TOOLBAR_ATTR_CUSTOMIZABLE, 1);

When you enable TOOLBAR_ATTR_CUSTOMIZABLE, LabWindows/CVI places a button with a down arrow on the toolbar. The user can select the button to view a drop-down list of items on the toolbar and select which items to view on the toolbar.

In addition to being able to place toolbars on panels, you can create floating toolbars. By placing move handle controls on your toolbars, you can allow users to dock/undock/arrange toolbars. You can gain more control over docking by installing a toolbar callback with Toolbar_InstallCallback and responding to dock, undock, and size events. User-defined toolbar layouts can be persisted between sessions using the Toolbar_SaveStates and Toolbar_LoadStates functions.

The functions in this instrument driver are multithread-safe.