|
iTool Programming: Creating a Custom iTool Widget Interface |
|
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:
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:
Toolbar/File container contains proxies to four of the operations registered in the Operations/File container: New, Open, Save, and Print. Proxies are described in Registering Components.
Each iTool toolbar contains an entry for each item that is registered in the container. This has two ramifications:
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.
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.
IDL Online Help (March 06, 2007)