skip to main content
OpenEdge Development: AppBuilder
Control Objects : SmartToolbars
The SmartToolbar object optionally combines a standard menu bar with a full‑width toolbar, and provides access to database navigation and record‑management functions. You can use a SmartToolbar in place of the standard menu bar in a SmartWindow, if you wish. The SmartToolbar offers the same functions that the larger, separate Navigation and Update SmartPanel button arrays provide between them.
The SmartToolbar has some limitations:
*You can only use the full SmartToolbar in a SmartWindow or SmartFrame. If you place one in a SmartDialog, only the toolbar component will activate, since a dialog cannot have a menu bar even as part of a SmartObject.
*You can use only one SmartToolbar per organizer instance. If you need additional controls, you must create and group them by hand.
*The width of a SmartToolbar does not automatically change to agree with changes in the organizer object. You must change the width under program control, or manually.
*If you use the menu component, you cannot use the standard menu editor to populate it. You must write code to add any additional menu items that you desire.
Placing a SmartToolbar
AppBuilder supplies a single version of the SmartToolbar. If you do not need to add additional functions, using it in your application is very straightforward.
To use the SmartToolbar:
1. Click SmartToolbar in the Object Palette.
2. Move the mouse cursor over a bare spot in your workspace and click to place the object. A menu bar and its corresponding toolbar have a well‑defined position in a window, so you need not be careful where you place it—it establishes itself in the right place automatically, in some cases even moving other objects out of the way.
3. Configure it, and adjust its size appropriately.
Figure 48, Figure 49, and Figure 50 show the SmartToolbar in different states with both components and all supplied functions enabled. The Filter button appears insensitive because there was nothing connected to it at the time these images were taken.
Figure 48: SmartToolbar fully enabled
Figure 49: SmartToolbar in record‑changed state
Figure 50: SmartToolbar in transaction‑pending state
Configuring a SmartToolbar instance
A default SmartToolbar has a few properties you can change without writing code. To open the Properties dialog box, select Instance Properties from the menu‑button menu. The SmartToolbar Properties dialog box appears:
Table 11 describes the use of each group of property settings.
Table 11: SmartToolbar properties
Deactivation of link to hidden targets.
This is used for performance tuning when you have a tab folder whose pages are not all linked to the toolbar. Select the Immediately on hide of target option when you have a mix of linked and unlinked tabs in a tab folder.
Use toolbar.
Controls if and how the toolbar portion of the toolbar visualizes.
Use menu.
Controls if and how the menu portion of the toolbar visualizes.
Controls which bands of actions are active on the toolbar.
Controls which individual actions in a given category are available.
Table 12 describes the settings in the Categories section of the property sheet.
Table 12: SmartToolbar Categories options 
When checked, the navigation actions are available.
When checked, table I/O actions appropriate to the selected options are available.
If the TableIOMode is “Save”, you can modify any updateable field.
The “Update” mode defines that a modal update mode is used. The fields are disabled until you click Update and becomes disabled again immediately on save or cancel.
Undo changes
When checked (default), the UndoChanges action controls what can be undone and the order that it happens. When unchecked, the older Reset action controls this. This option is available for backwards compatibility.
Undo add and copy mode
When checked, the functions of the Cancel button are incorporated into the Undo button. This option is only available when Undo changes is checked and the TableioMode is “Save”.
When checked, the Undo and Commit actions are available.
When checked, the Filter action is available.
Creating a new SmartToolbar
AppBuilder supplies a single, precompiled SmartToolbar that can replace all the SmartPanels that AppBuilder also supplies. If you choose to use the Toolbar in your application, you can elect to enable more or fewer of those virtual SmartPanels.
If you want to make other changes to the SmartToolbar, you must write code. See OpenEdge Development: ADM Reference for further information.
Adding a filter-control window
Displaying a SmartFilter object necessarily takes up a certain amount of space on the display. Since display space is typically in short supply, you might prefer to allow the user to control whether the filter is visible. One way to do this is to put the filter in a separate, callable SmartWindow. ADM makes this choice easier to implement by supplying a dedicated filter button as part of the SmartToolbar object.
To create a sample application that uses a Filter window:
1. Create a new SmartWindow instance to be the main window of this toy application. Populate it with a SmartDataObject, SmartDataViewer, and SmartToolbar. Allow the Advisor to create SmartLinks for you. Adjust sizes and positions as necessary. Your result should look similar to the following:
2. Right-click the SmartToolbar instance and choose Instance Properties from the context menu. When the dialog box appears, set the Filter check box:
3. Click OK to dismiss the dialog box.
4. Create a SmartWindow to be your Filter window. Populate it with a SmartFilter.
5. Right-click the filter instance and choose Instance Properties from the context menu. The SmartFilter Properties dialog box appears:
6. Identify the data source and the filterable fields. For the purposes of this example, accept the default style and view‑as settings. Click OK.
7. Right-click the instance and choose SmartLinks from the context menu. Add a Filter link from the filter object (represented by the handle identifier) to the window object (represented by THIS-PROCEDURE):
8. Close the SmartLinks editor. Resize the Filter window as necessary. Save it using a distinctive name.
9. Click on the SmartContainer tool in the Object Palette. When the Choose dialog box opens, select the Filter window that you just saved, and click OK. Place the object on any blank spot in your main window. Allow the Advisor to create the links it suggests. Your result should now look similar to the following:
10. Right-click the SmartContainer instance and choose Instance Properties from the context menu. When the dialog box opens, clear the View check box. This will prevent the Filter window from automatically displaying at startup. Click OK to dismiss the dialog box.
11. Run your sample application. When it starts up, click the Filter button to open the Filter window. Verify that you can filter the data stream:
The Filter button only opens the Filter window. To close the Filter window, you must click the Close button (the X) at the right end of its title bar.