In the Menu painter, you specify the menu items you want to display in the toolbar, the text for the toolbar button and tip, the pictures to use to represent the menu items, and other characteristics of the toolbar.
To specify the display characteristics of a toolbar item:
Open the menu in the Menu painter and select the menu item you want to display in the toolbar.
Select the Toolbar property page and set properties of the toolbar item as shown in Table 14-5.
Property |
What to specify |
---|---|
ToolbarItemText |
Specify two different text values for the toolbar button and PowerTip with a comma-delimited string, as follows: Text in button, PowerTip |
ToolbarItemName |
Choose a stock picture from the drop-down list or browse to select a bitmap, GIF, JPEG or icon file. If you choose a stock picture, PowerBuilder uses the up version when the item is not clicked and the down version when the item is clicked. (The up version appears raised and the down version appears indented.) If you are specifying a file, the picture should be 16 pixels wide and 15 pixels high. For the best result, use 16*16 icons on a toolbar. |
ToolbarItemDownName |
Specify a different picture to display when the item is clicked (optional). |
ToolbarItemVisible |
Clear if you want the toolbar button to be hidden. The default is visible. |
ToolbarItemDown |
Check if you want the down version of the button to display initially. |
ToolbarAnimation |
If you want the toolbar image to be animated when selected, select the check box. |
ToolbarItemSpace |
Specify any integer if you want to leave space before the picture in the toolbar. Experiment with values to get the spacing the way you want it. If you leave the value at 0, there will be no spacing before the picture. (Spacing is used only when the toolbar is not displaying text.) |
ToolbarItemOrder |
Specify the order in which the item displays in the toolbar. If you leave the value 0, PowerBuilder places the item in the order in which it goes through the menu to build the toolbar. |
ToolbarItemBarIndex |
Specify a number other than 1 if you want multiple toolbars to display for this menu. The number you specify determines which toolbar the current menu item appears on. All items that have the same index number appear on the same toolbar. |
ObjectType |
Specify Menu or MenuCascade. |
Columns |
(This property displays only if you choose MenuCascade in the ObjectType drop-down list.) Indicate the number of columns you want to display in the cascading toolbar. |
Drop Down |
(This property displays only if you choose MenuCascade in the ObjectType drop-down list.) If you want the button to be a drop-down toolbar button, select the check box. |
A menu item can have a toolbar button associated with it that displays a drop-down toolbar. When the user clicks on the button, PowerBuilder displays a drop-down toolbar that shows all of the toolbar buttons for menu items defined at the next level. For example, if you define a drop-down toolbar for the File menu item, the drop-down toolbar will show the buttons defined for the items on the File menu (such as New, Open, Close, and Exit).
PowerBuilder displays a drop-down toolbar at runtime by default if the Object Type of the menu item is MenuCascade. You can specify programmatically whether submenu items display in a drop-down toolbar or as normal toolbar items by setting the DropDown property of the menu item. For example, if you want a descendent menu item to have a drop-down toolbar, but not its ancestor, clear the DropDown check box on the ancestor’s Toolbar property page, and set the DropDown property of the descendent menu item to TRUE in a script.
To specify a drop-down toolbar for a menu item:
In the Menu painter, select the menu item for which you want to add a drop-down toolbar.
On the Toolbar property page, change the Object Type to MenuCascade.
(Optional) Specify the number of columns you want to display in the Columns box.
The default is a single column. If there are many items on the submenu, as there are on the toolbar item for inserting controls in the Window painter, you will probably want to specify three or four columns.