Understanding toolbars

This is an introduction to toolbars definition.

A toolbar defines action views presented as a set of buttons that can trigger events in an interactive instruction.

This section describes how to define toolbars with XML in files or in programs as global/default toolbars; it is also possible to define toolbars in forms with the TOOLBAR section, as form-specific toolbars.

Toolbar files can be loaded by a program with the methods ui.Interface.loadToolBar() (for global/default toolbars) or ui.Form.loadToolBar() (to load form-specific toolbars).

The global/default toolbar is displayed in all windows, or in the global window container when using a window container. The form-specific toolbar is displayed in the form where it is defined.

The position and overall rendering of toolbar can be defined with presentation style attributes of window elements, such as toolBarPosition. Typical "modal windows" (windowType="modal") do not display toolbars. See FGLDIR/lib/default.4st, where toolBarPosition is set to "none" for that kind of windows.

The toolbar items (or buttons) are enabled/disabled based on the ON ACTION handlers defined by the current interactive instruction. A toolbar item is bound to an action handler by name.. A click on the toolbar button will execute the user code in the action handler.

Toolbar elements can get a style attribute in order to use a specific rendering/decoration following presentation style definitions. Specific toolbar style attributes are supported to customize your toolbars.

The DOM tag names are case sensitive; Toolbar is different from ToolBar.

When binding to an action, make sure that you are using the right value in the name attribute. As ON ACTION and COMMAND generate lowercase identifiers, it is recommended to use lowercase names.

It is recommended that you define the decoration of toolbar items for common actions with action defaults.