Toolbars (Top Button Areas)

In addition to the top menu, toolbars are important entry points for the users of your application. They can be freely positioned on the screen and docked to any place. Toolbars usually contain push buttons, but can also contain choice boxes and separators. Toolbars are always in the foreground.

Default Toolbar

Irrespective of the current user, your application will always start with the default toolbar (if you have not created any user-specific default toolbar). A button area becomes a default toolbar if you use the button area name TOP_BUT.


User-Specific Default Toolbar

You can create an individual default toolbar for every user of the application. The names for these toolbars can be user-specifically specified with the help of the default variable TOPBUTTON. The default toolbar name TOP_BUT for the user GLOBAL should not be changed. Thus you make sure that users without a specific toolbar always get the default toolbar.

As an alternative for the default variable TOPBUTTON you can create new default variables to assign user-specific top button area names, such as TOPBUTTON1. This results in sets of user-specific toolbars. In the DataView starting procedure or in a user login script you can then use the system default variable DATAVIEW_BUTT to control, which set the application starts with. If you do not set the variable, TOPBUTTON is the default setting.


Additional Toolbars

If you want to create further toolbars in addition to the standard toolbar, you can use the standard userexit but_usx (called e.g. at a suitable Top sub-menu item). The button area name must be passed as parameter. If the button area has a title, it will automatically appear in the dynamic View menu. The new toolbar can be displayed or hidden in the menu. You can use but_usx "Button-Area-Name ,D" to remove toolbars.


Sub-Objects in Toolbars

Toolbars can contain pushbuttons, separators, choice boxes and text. The definition of the sub-objects is done in the selection master or in the menu-selection relation as follows:

Sup-object Field in item-assignment sub-list Entry, comment
Push button Selection text Like usual push bottoms in button areas, i.e. #filename:text
Separator Selection text Like separators in menus, i.e. '-'
Userexit Like separators in menus, i.e. macro @LINE
Choice box Selection name Macro @CBOX-Name (only selection of selection texts from selection lists possible), or
Macro @EBOX-Name (selection of selection texts possible additionally and automatically by editing in the field)
Selection text Any pre-assigned text. It is not restricted to the texts from the selection list. This allows you to realize texts like Please select" and the like. It is possible to enter text macros @GROUP, @USER, @LNGSYS, @LNGUSR.
Userexit Userexit to be executed immediately after selecting a selection text. Any userexit can be entered, which can be passed the selected selection text as first and only parameter, e.g. : prt_mod_grp, lng_set_act_sys, lng_set_act_usr. If no suitable userexit is available, you have to program your own one.
Parameter Selection list. The selected selection text is automatically passed to the userexit as parameter. Corresponding to the userexit named above, the dynamic system menus #USER_GROUP, #LANGUAGE_SYS, #LANGUAGE_USR are applicable. On the other hand any menu defined in T_MENU can be entered. This menu may not already exist as sub-menu in the top menu. The menu can contain control selections in the form @TABLENAME.COLUMNNAME, but with the following limitations :
a) multi-column control selections are not supported (if they do exist, not only the first but the contents of all columns will be used).
b) in the standard toolbar, however, such control selections may not contain any Where conditions.
Full description Quick-info for choice box
Width Width of the choice box
Text (e.g. Choice-Box-Title) Selection text Title text
Length/Width 0/0

*Do not mixup choice boxes at toolbars with choice boxes at fields. A toolbar choice box does not need a link to a mask field.


Display Options for Toolbars

Value for
ToolbartheButton
Display
0 Buttons with icon without text (default)
1 Display of the buttons with icon and centred text below
2 Buttons with icon and text right beside it

The background for this is to completely define buttons for toolbars once including icon and text, but to leave the representation to the application. The precondition for that is the assignment of buttons without defined dimensions (length/width = 0/0) to the button area and the usage of icons of the default size x pixels.

If buttons with defined dimensions are assigned to the button area, the ToolbarButton setting is of no consequence. The buttons will then be a displayed with their defined size and position in the toolbar. Icons can deviate from the default size of x pixels and can have any size, text is always positioned centred below the icon. This method can be used to create toolbars with buttons of any size. However, the display cannot be controlled by the application.


Titles for Toolbars

Toolbars should contain at title in the menu master. The title will be automatically displayed as selection text in the dynamic view menu VIEWBAR. In the the menu you can display or hide the new toolbar. The title additionally appears in the title line of toolbar, if it floats on the desktop.