Toolbar Control
- Last UpdatedJan 09, 2024
- 2 minute read
Toolbar visibility in different applications is controlled by the object APPTBARCNTRL. A global instance !!appTbarCntrl is created when starting Marine.
Each toolbar is registered with a list of applications in which it can be active. !!appTbarCntrl then controls the active state and visibility of the toolbar as applications are switched. Toolbars can be shown and hidden using the popup menu which appears when you right click on a toolbar or menu bar of the main form. If a toolbar is shown in one application, then it will be shown in all other applications for which it is registered.
To register a toolbar, use the command
!!appTbarCntrl.addToolbar(!toolbarName is STRING, !appName is STRING, !visible is BOOLEAN),
where !toolbarName is the name of the toolbar frame, !appName is the name of the application to register the toolbar in and !visible is whether the toolbar is visible by default.
Instead of registering a toolbar in multiple applications individually, an array of applications can be specified:
!!appTbarCntrl.addToolbar(!toolbarName is STRING, !appNames is ARRAY, !visible is BOOLEAN)
registers the toolbar for all applications in the array !appNames.
The application name 'ALL' has been reserved so that toolbars can be registered in every application. To register a toolbar in all applications, use
!!appTbarCntrl.addToolbar(!toolbarName is STRING, 'ALL', !visible is BOOLEAN)
where !toolbarName is the name of the toolbar and !visible is whether it is visible by default.
The command
!!appTbarCntrl.addToolbar(!toolbarName is STRING)
is a shorthand way of registering the toolbar to be visible in all applications, making it visible by default.
Any toolbars on the main form that are not registered are automatically detected and hidden by default. They are registered to be active in all applications.