How to Design a Custom Menu
Covers designing a custom menu, inserting an item in a menu, new menu entries, pre-defined menu items, etc..
To design a custom menu:
Activate the Control Panel and display the Code tab.
Click New and select Menu or select Code > New > Menu.
To give you a head start, you can start with one of the standard menus, or you can start from scratch with a blank menu. Select the menu type. The following menu types are available:
If the menu was previously modified, then you have the option of using it as is, or using the original default version of the menu. Check or clear Use customized menu? Alpha Anywhere opens the Menu Maker dialog box.
The Menu Maker displays the menu as an outline. To see the contents of the menu, expand the outline by clicking the + signs to the left of the menu items. Once a menu item is open, you can close it by clicking on the - sign to its left.
The right hand side of the screen shows the action associated with the menu entry. For example, the current selection in the picture above is "&Save Record". The action associated with this menu item is to play the built-in Records > Save command.
Place the cursor on an existing menu item. Click the green '+' icon to display the Add New Item dialog box. Picture
Set the Position of the new entry. The options are:
"Above the current item"
"Below the current item"
"As a sub-menu of the current item"
Optionally, if you clicked Above current item or Below current item, you may click Separator to insert a separator line.
You have three options for adding new menu entries.
Enter the text of the new menu entry
Use a Pre-Defined Menu Item
Use a Menu Macro
Optionally, enter the text of the new menu entry into the Item name field.
Optionally, place an ampersand "&" in front of the character that you would like to use as an accelerator key.
Optionally, click Pre-Defined Menu Item. If you have not already selected a context for the new menu, you will see an error message.
Click OK to display the Pre-Defined Menu Item dialog box.
Click Set Context... and select one of the following options.
Click Pre-Defined Menu Item to display the Select Menu Item dialog box.
Select a menu entry and click OK to add the item or Cancel to discard your selection.
Optionally, click the Edit button to display the Edit Menu Item dialog box.
1. Optionally, change the text of the menu entry.
2. Optionally, click Menu Macros to replace the current entry with a menu macro.
3. Click OK to continue or Cancel to discard your inputs.
Optionally, check Has Bitmap? to add an image to the menu entry.
Click to display the Insert Image dialog box.
Select an image.
Click Insert to continue or Cancel to discard your selection.
Optionally, enter bubble help text in the Prompt field.
Optionally, define an accelerator key sequence in the Accelerator field.
1. Click the '...' button to display the Keys dialog box.
2. Check Alt, Control, and/or Shift and select a key from the drop-down list.
3. Click OK to insert the key sequence or Cancel to discard your inputs.
Optionally, enter an expression in the Enable field that defines when the menu entry will be available. The expression must evaluate to TRUE (.T.) or FALSE (.F.).
1. Click the 'xy' button to display the Expression dialog box.
2. If the Expression field at the top of the dialog box is grayed out, click Change Table/Set... to display the Table/Set Name dialog box.
3. Select a table or set and click OK.
4. Enter an expression. Click the 'xy' button to display the Expression Builder to help you define the expression.
5. Click OK to continue or Cancel to discard your selection.
Select the Type of action to run when the menu item is clicked. The options are:
"Run a saved script"
If you selected "Built-in action" in step 22, click Select... to display the Built-in Action dialog box.
1. Click OK to display the Pre-Defined Menu Item dialog box.
2. If you have not already selected a context for the new menu, the Select Action... button will be hidden.
3. Click Set Context... and select one of the following options.
4. Click Select Action... and select a menu entry from the resulting menus.
5. Click OK.
If you selected "Run a saved script" in step 22, click the 'down' button to select a script.
Optionally, click to edit the saved script.
Make your changes and click to return to the Menu Maker.
If you selected "Xbasic", enter the Xbasic commands in the text box.
You can press the F4 key to compile your script to test if you have made any syntax errors.
Click to edit the saved script in a larger window.
Enter the name of the new menu in the Save Menu As dialog box.
Click Menu Macros and make a selection from the resulting menu. Note : Menu macro selections do not appear when you click to preview the menu.
Click the left or right button to promote or demote an entry in the hierarchy of entries.
Click the up or down button to change the location of an entry in the menu.
Click 'X' to remove an entry.
Click the scissor icon and paper icon to cut and paste an entry from one location to another.
Alpha Anywhere lets you specify drop-down menus for the following form modes:
View mode (i.e., viewing, entering, or editing records)
Query by Form mode
Find by Form mode
For example, if you specify a custom drop-down menu for View mode and Query by Form mode, the view menu will display when the form is in View mode. If you select Query by Form, the menu will change to the specified query menu. If no menu is specified for Query by Form mode, then when the user selects Query by Form, the standard menus are displayed.
Design the custom menu and save it.
Place the layout in edit mode.
Right click on the form, browse or report (letter, label) background and select Properties... .
In the resulting Properties dialog, display the Menus/Toolbars tab.
Select the name of the menu to use in one of the menu list boxes. Specify "" to turn off a menu, or specify "" to use the system default menu. See Custom Menus for Various Forms Modes.
Click OK to exit from the Properties dialog.