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.
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.
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.
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.
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:
*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.
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.
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.