Progress
ADM 2 Guide
SmartToolbar Usage Notes
This section discusses special programming considerations for using SmartToolbars.
SmartPanels as Toolbars
In previous ADM releases, a common way to provide toolbar-type functionality in Progress applications was to instance both a Navigation SmartPanel and an Update SmartPanel and use them collectively as a sort of toolbar. If the containing SmartObject is a SmartWindow, this is no longer necessary, as you can now use a SmartToolbar instead.
Complex SmartToolbar Modifications
More complex SmartToolbar modifications (for example, the order and structure of icons and menus) involve modifying the SmartToolbar object itself. You manage the layout and availability of actions in a toolbar in the functions initializeMenu( ) and initializeToolbar( ). These functions are not defined in the SmartToolbar super procedure as a default, but are called from initializeObject and must always exist in the toolbar. Using these functions to customize the SmartToolbar ensures that its structure and layout are defined at the right moment in the initializeObject( ) function.
You can override the default behavior of the SmartToolbar in either a local SmartToolbar master or a local SmartToolbar super procedure.
- Local SmartToolbar master—Create a local SmartToolbar master by copying the master (
adm2/dyntoolbar.w
), then customize the initializeMenu( ) and initializeToolbar( ) functions as required.Note that if your application requires two or more versions of a SmartToolbar, you can create local masters for each (the local masters must have different names), then update the
.cst
files accordingly.- Local SmartToolbar super procedure—Create a local SmartToolbar super procedure by copying the super procedure (
adm2/custom/toolbarcustom.p
), then customizing its code as required. The code inadm2/dyntoolbar.w
’s initializeMenu( ) and initializeToolbar( ) functions calls SUPER( ) with the no–error option. If it does not find a super procedure or returns false, the default code is executed.You can use this technique to implement a data-driven SmartToolbar that checks properties (for example, user and object) to retrieve the correct SmartToolbar specification data. (If no data is found, return FALSE to trigger the default behavior.)
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |