Adding a Toolbar

iTool toolbars are created using the CW_ITTOOLBAR compound widget. The signature of the CW_ITTOOLBAR function is:

Result = CW_ITTOOLBAR(Parent, UI, Target [, KEYWORDS])

where:

Standard Toolbars

Operations registered in the iTool containers that create the standard toolbars are automatically sensitized and desensitized to reflect whether the corresponding operation or manipulator is currently available. Some items are sensitized when the selected item is of the correct data or visualization type, others (such as Undo and Redo) are sensitized when some other criteria are met. Still others (such as the File Open operation) are always available.

The following statements create the toolbars used by the standard iTools:

wToolbar = WIDGET_BASE(wBase, /ROW, XPAD=0, YPAD=0, SPACE=7) 
wTool1 = CW_ITTOOLBAR(wToolbar, oUI, 'Toolbar/File') 
wTool2 = CW_ITTOOLBAR(wToolbar, oUI, 'Toolbar/Edit') 
wTool3 = CW_ITTOOLBAR(wToolbar, oUI, 'Manipulators', /EXCLUSIVE) 
wTool4 = CW_ITTOOLBAR(wToolbar, oUI, 'Manipulators/View',$ 
   /EXCLUSIVE) 
wTool5 = CW_ITTOOLBAR(wToolbar, oUI, 'Toolbar/View') 
wTool6 = CW_ITTOOLBAR(wToolbar, oUI, 'Manipulators/Annotation', $ 
   /EXCLUSIVE) 

There are a couple of points to note:

Modifying Toolbar Contents

Each iTool toolbar contains an entry for each item that is registered in the container. This has two ramifications:

  1. If you register (or proxy) a new operation or manipulator in one of the standard toolbar containers, it will appear on the toolbar for your iTool, and be sensitized and desensitized according to the same rules as the other items.
  2. If you unregister an operation or manipulator from one of the standard toolbar containers, it will be removed from the toolbar for your iTool.

Operations and manipulators are generally registered and unregistered in the Init method of an iTool creation routine. See Creating an Operation or Creating a Manipulator for details. For an example that shows how to unregister standard toolbar items, see Example: a Custom iTool Interface.

Resizing Toolbars

Toolbars consist of bitmap buttons that cannot be resized, so no special resizing code is required. If you are concerned that all of your toolbars appear even if the user resizes the top level base widget to a width too narrow to display them all, you can either set a minimum width for the top level base or write resizing code that arranges the toolbars into multiple rows if the top level base is not wide enough.