To create or edit a menu, open the form definition window for the form where the menu will be attached. Click the Menus tab to display the list of menus that have been defined for the form.
Click New to create a new menu, or select a menu and click Open to edit an existing menu definition. The Menu Definition window will appear.
Two names are required for a menu. The Menu Name is the name used in scripts, while the Display Name is the name displayed in the menu bar.
You can specify the access key for the menu by placing an ampersand (&) in the display name. The character immediately following the ampersand will be underlined. To choose the menu at runtime, press the ALT key and the underlined character at the same time.
If you’re creating an application-level menu (one attached to the Main Menu form), choose which groups of menu items you want the menu to inherit, if any. Do this by clicking the Options button to display the Inheritable Menu Options window and marking the appropriate check boxes.
To add additional menu items, click New and type the menu item name in the Item Name field. Include an ampersand (&) character in the name to define a Windows access key for the menu item. Use the pound sign (#) to include an ellipsis in the name. Use the tilde (~) to include a slash in the name.
Select an item in the Shortcut field if you want to specify a shortcut key for the menu item. The shortcut key is CTRL + the selected character.
You can use a separator line to group the items in the menu. To add a separator, add a menu item between the items to be separated. Enter a hyphen (-) as the menu item’s name. At runtime, the item will appear as a separator line in the menu.
To remove an item from the menu, select the item and click Delete. The item will be deleted.
To rearrange items in the menu, select an item and click the Move Up or Move Down buttons to move the menu item. Use the Move Left and Move Right buttons to create cascading menu items.
Mark the Unfocus option to indicate that the menu items should pull the focus from the current window field when it is chosen. Pulling the focus causes any pending field scripts to be run before the menu item’s action is carried out. If the application is in a state such that the menu action can’t be performed, the field’s scripts can then prevent the action from being performed.
You can specify an action for a menu item by selecting one of the predefined actions or by attaching an application script. To specify a predefined action, select one from the Action drop-down list. The following table lists the actions.
Action |
Description |
---|---|
Application Script |
Runs the script attached to the menu item. |
Delete Row |
Runs the line delete script for a scrolling window. |
Help Contents |
Displays the help contents topic. |
Help on Help |
Displays help for the Windows help system. |
Help on Item |
Displays help for the currently focused item. |
Help on Window |
Displays help for the current window. |
Help Search |
Displays the search window for the help system. |
Insert Row |
Runs the line insert script for a scrolling window. |
Lookup |
Opens the lookup form for the current field or runs the change script linked to the current field using Link Lookup. |
Modifier |
Provides access to the Modifier. |
|
Runs the print script for the current window. |
Print Setup |
Displays the Print Setup window for the current operating system. |
Process Monitor |
Opens the Process Monitor window. |
Quit Application |
Closes the application. |
Report Writer |
Provides access to the Runtime Report Writer. |
Show Required |
Displays the required fields for the application. |
A specific predefined action should be assigned to only one menu item in the application. If an action is assigned to more than one menu item, only the last menu item assigned the action will actually perform it. |
To attach a script to the menu item, choose Application Script in the Action drop-down list, and then click the Script button. The script editor will appear, allowing you to enter a script that will be run each time the menu item is chosen.
The menu will appear in the list of menus in the Form Definition window.