How to Design a Custom Menu

To design a custom menu:

  1. Activate the Control Panel and display the Code tab.

  2. Click New and select Menu or select Code > New > Menu.

  3. 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: [Picture]

  1. 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 Five opens the Menu Maker dialog box. [Picture]

  1. 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.

Inserting an Item in a Menu

  1. Place the cursor on an existing menu item. Click to display the Add New Item dialog box.   [Picture]

  1. Set the Position of the new entry. The options are:

  2. 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.

New Menu Entries

  1. Optionally, enter the text of the new menu entry into the Item name field.

  2. Optionally, place an ampersand "&" in front of the character that you would like to use as an accelerator key.

  3. Click OK.

Pre-Defined Menu Items

  1. Optionally, click Pre-Defined Menu Item. If you have not already selected a context for the new menu, you will see an error message.

    1. Click OK to display the Pre-Defined Menu Item dialog box.

    2. Click Set Context... and select one of the following options.

  2. Click Pre-Defined Menu Item to display the Select Menu Item dialog box.

  1. Select a menu entry and click OK to add the item or Cancel to discard your selection.

  2. Optionally, click Edit 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.

  3. Optionally, check Has Bitmap? to add an image to the menu entry.

    1. Click to display the Insert Image dialog box.

    2. Select an image.

    3. Click Insert to continue or Cancel to discard your selection.

  4. Optionally, enter bubble help text in the Prompt field.

  5. Optionally, define an accelerator key sequence in the Accelerator field.

    1. Click to display the Keys dialog box. [Picture]

    1. Check Alt, Control, and/or Shift and select a key from the drop-down list.

    2. Click OK to insert the key sequence or Cancel to discard your inputs.

  6. 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 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 to display the Expression Builder to help you define the expression.

    5. Click OK to continue or Cancel to discard your selection.

  7. Optionally, enter an expression in the Checked field that defines when the menu entry will be checked. The expression must evaluate to TRUE (.T.) or FALSE (.F.).

    1. Click 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 to display the Expression Builder to help you define the expression.

    5. Click OK to continue or Cancel to discard your selection.

  8. Select the Type of action to run when the menu item is clicked. The options are:

  9. 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.

  10. If you selected "Run a saved script" in step 22, click to select a script.

    1. Optionally, click to edit the saved script.

    2. Make your changes and click to return to the Menu Maker.

  11. If you selected "Xbasic", enter the Xbasic commands in the text box.

    1. You can press the F4 key to compile your script to test if you have made any syntax errors.

    2. Click to edit the saved script in a larger window.

  12. Click Save.

  13. Enter the name of the new menu in the Save Menu As dialog box.

  14. Click OK.

Menu Macros

  1. 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.

Arranging Menu Entries

  1. Click or to promote or demote an entry in the hierarchy of entries.

  2. Click or to change the location of an entry in the menu.

  3. Click to remove an entry.

  4. Click and to cut and paste an entry from one location to another.

Attaching the Menu to the Layout

Alpha Five lets you specify drop-down menus for the following form modes:

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.

  1. Design the custom menu and save it.

  2. Place the layout in edit mode.

  3. Right click on the form, browse or report (letter, label) background and select Properties... .

  4. In the resulting Properties dialog, display the Menus/Toolbars tab.

  5. Select the name of the menu to use in one of the menu list boxes. Specify "<none>" to turn off a menu, or specify "<System Menu>" to use the system default menu. See Custom Menus for Various Forms Modes. [Picture]

  1. Click OK to exit from the Properties dialog.

  2. Click .

See Also

Display a Pick-List of Scripts, Menu Capabilities, Changing Custom Menus at Runtime, Methods for Controlling Menus at Runtime