User Tools

Site Tools


tplcodepreparepopup.htm
Navigation:  Templates > Guide to all Templates > Code Templates >====== DisplayPopupMenu ====== Previous pageReturn to chapter overviewNext page

The DisplayPopupMenu template generates code to define and display a popup menu, and optionally, act on the end user's selection. You can set the popup menu items to mimic existing buttons on the window so that the associated menu item text matches the button text, is enabled only when the button is enabled, and, when selected, invokes the button action.

The DisplayPopupMenu template relies on the PopupClass to accomplish its tasks.

String variable for Press the ellipsis (…) button to select or define a string variable to receive the end user's popup menu selection. After the popup menu displays, this variable contains the selected item's text minus any special characters. That is, the variable contains only characters 'A-Z', 'a-z', and '0-9'. If the resulting value is not unique for the menu, the PopupClass appends a sequence number to the value to make it unique.You may interrogate this variable and perform actions depending on its value. If you rely on the PopupClass mimic capability to perform appropriate actions, then you can leave this field blank. See Item Properties for more information on mimic.
Build Menu From Choose how the popup menu and its items are defined. Choose from:
Menu String Use the Menu String field to type the menu definition, then use the Item Properties to define each item's behavior.
Item List Use the Menu Items button to define menu items one at a time.
INI File Use the Menu Description field to name the INI file section which contains the menu definition. By default, the template code uses the global INIMgr object declared by the ABC Application template. If you have not specified an INI file to use, the INIMgr object uses Windows INI file. See Template Overview'Global Options Tab.
Menu Description Type the INI file section which contains the menu definition.
Menu String Type a menu definition string. The Language Reference describes the syntax for the menu definition string under the selections parameter for the POPUP command.
Item Properties Press this button to define the properties for each popup menu item. Only items specified in the Menu String are valid. You can set the popup menu items to mimic existing buttons on the window so that the associated menu item text matches the button text, is enabled only when the button is enabled, and, when selected, invokes the button action. You can also set the popup menu items to post an event to a control.
Menu Items Press this button to define the text for each popup menu item. You can set the popup menu items to mimic existing buttons on the window so that the associated menu item text matches the button text, is enabled only when the button is enabled, and, when selected, invokes the button action. You can also set the popup menu items to post an event to a control.

Classes Tab

Use the Classes tab to override the global settings for the Class. See Classes Tab.

tplcodepreparepopup.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1