Menu object
In PowerBuilder, you use the Menu painter to create menus and
toolbars. Typically, menus are lists of items (usually commands or
options) that a user can select in the currently active window. Menus can
display in a menu bar, in a drop-down or cascading menu, or as pop-up
menus. A toolbar is associated with a menu, and its toolbar buttons act as
shortcuts for choosing items from the menu.
PowerBuilder provides a Menu system object used to develop menus. A
Menu object can contain other Menu objects that appear, for example, as
the items in a drop-down or cascading menu. When the user clicks a Menu
object, a Clicked event is triggered. If there is a drop-down or cascading
menu under the clicked object, the script for the Clicked event for the
object is executed, and then the menu displays. If there is no menu under
the object, the script for the Clicked event for the object is
executed.
Menus that you import or upgrade from earlier versions of
PowerBuilder use the Traditional menu style by default. Menus with a
Contemporary style have a three-dimensional menu appearance similar to
those in Microsoft Office 2003 and Visual Studio 2005, and can include
bitmap and menu title bands.
Properties
|
Menu property |
Datatype |
Description |
|---|---|---|
|
BitmapBackColor |
Long |
Background color of the bitmap band of the menu. |
|
BitmapGradient |
Boolean |
Background of the bitmap band to a gradient |
|
Boolean |
Specifies whether the Menu object is selected. The TRUE — Object is FALSE — Object is not |
|
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing |
|
Default |
Boolean |
Specifies whether the menu item is the default and In context menus, the Default The property is also used Values are: TRUE — FALSE — Menu item is not |
|
Boolean |
Specifies whether the Menu object is enabled (can TRUE — Object is FALSE — Object is not |
|
|
FaceName |
String |
Font face name. |
|
Italic |
Boolean |
Italic font. |
|
Menu |
Specifies the Menu objects under a Menu |
|
|
MenuAnimation |
Boolean |
Visual sizing cue to the menu item bitmap when the |
|
MenuBackColor |
Long |
Background color of the menu. |
|
MenuBitmaps |
Boolean |
Bitmap band for the menu. |
|
MenuHighlightColor |
Long |
Menu highlight color. The default is the default |
|
MenuImage |
String |
Bitmap image to be used with the menu item. This |
|
MenuItemType |
MenuItemType (enumerated) |
Allows you to identify special Menu objects that MenuItemTypeAbout! MenuItemTypeExit! MenuItemTypeHelp! MenuItemTypeNormal! |
|
MenuStyle |
MenuStyle (enumerated) |
Overall menu style. Values are: contemporarymenu! |
|
MenuTextColor |
Long |
Menu text color. (Default is the Windows menu text |
|
MenuTitles |
Boolean |
Menu title band. |
|
MenuTitleText |
String |
Label for a menu item that has a cascading submenu. |
|
MergeOption |
MenuMergeOption (enumerated) |
Specifies how the object is affected when an OLE EditMenu! Exclude! FileMenu! HelpMenu! Merge! WindowMenu! For |
|
MicroHelp |
String |
Specifies the text of the MicroHelp for the |
|
ParentWindow |
Window |
Specifies the window that owns the Menu |
|
ShiftToRight |
Boolean |
Specifies whether the Menu object shifts down or to TRUE — Object shifts to FALSE — Object shifts down. |
|
Shortcut |
Integer |
Specifies the shortcut key for the Menu object. |
|
String |
Specifies the tag value assigned to the Menu |
|
|
String |
Specifies the text in the Menu |
|
|
Integer |
Font character size in points for menu items. This |
|
|
TitleBackColor |
Long |
Background color of the title panel. |
|
TitleGradient |
Boolean |
Background gradient style for the title |
|
ToolbarAnimation |
Boolean |
Specifies animation for the toolbar image. You can |
|
ToolbarBackColor |
Long |
Background color of the menu |
|
ToolbarGradient |
Boolean |
Gradient of the menu toolbar |
|
ToolbarHighlightColor |
Long |
Highlight color for the toolbar buttons when they |
|
ToolbarItemBarIndex |
Integer |
Specifies which toolbar the Menu object is on when |
|
ToolbarItemDown |
Boolean |
Specifies how the toolbar button appears. Values TRUE — Toolbar button appears FALSE — Toolbar button appears This property is automatically reset when any |
|
ToolbarItemDownName |
String |
Specifies the name of the toolbar icon associated |
|
ToolbarItemName |
String |
Specifies the name of a stock toolbar picture you |
|
ToolbarItemOrder |
Integer |
Specifies the order of the item in the |
|
ToolbarItemSpace |
Integer |
Specifies the amount of empty space before the item |
|
ToolbarItemText |
String |
Specifies the text that displays in the toolbar |
|
ToolbarItemVisible |
Boolean |
Specifies whether the toolbar item displays. Values TRUE — The toolbar item is FALSE — The toolbar item is not If any toolbar item has a ToolbarItemName |
|
ToolbarStyle |
ToolbarStyle (enumerated) |
Overall style of the menu toolbar. Values are: |
|
ToolbarTextColor |
Long |
Color of the text in menu toolbar. |
|
Underline |
Boolean |
Underline font. |
|
Boolean |
Specifies whether the Menu object is visible. TRUE — Object is FALSE — Object is not |
|
|
Weight |
Integer |
Font weight. |
Events
Functions
|
Menu function |
Datatype returned |
Description |
|---|---|---|
|
Integer |
Displays a check mark next to the Menu object and |
|
|
String |
Returns the class of the Menu |
|
|
Integer |
Disables (and grays) the Menu object so that it |
|
|
Integer |
Enables the Menu object so that it can be selected |
|
|
Integer |
Creates a reference to a context-specific instance |
|
|
PowerObject |
Returns a reference to the name of the parent |
|
|
Integer |
Makes the Menu object invisible. |
|
|
Integer |
Displays the Menu object at the specified |
|
|
Integer |
Adds an event to the end of the message queue for |
|
|
Integer |
Makes the Menu object visible. |
|
|
Integer |
Triggers a specified event in the Menu object and |
|
|
Object |
Returns the type of the control. |
|
|
Integer |
Removes the check mark next to the Menu object and |