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:

  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:

    • images/MenuTypes.png
  4. 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.

    • images/Menu_Maker_dialog_box.gif
  5. 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.

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

  7. Inserting an Item in a Menu

    Place the cursor on an existing menu item. Click the green '+' icon to display the Add New Item dialog box. Picture

  8. 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"

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

  10. New Menu Entries

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

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

  12. Click OK.

  13. Pre-Defined Menu Items

    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.

      • "Form View"

      • "Browse View"

      • "Print Preview"

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

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

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

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

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

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

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

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

    • "Built-in action"

    • "Run a saved script"

    • "Xbasic"

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

      • "Form View"

      • "Browse View"

      • "Print Preview"

    • 4. Click Select Action... and select a menu entry from the resulting menus.

    • 5. Click OK.

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

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

  25. Click Save.

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

  27. Click OK.

  28. Menu Macros

    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.

  29. Arranging Menu Entries

    Click the left or right button to promote or demote an entry in the hierarchy of entries.

  30. Click the up or down button to change the location of an entry in the menu.

  31. Click 'X' to remove an entry.

  32. Click the scissor icon and paper icon to cut and paste an entry from one location to another.


Attaching the Menu to the Layout

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.

  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 "" to turn off a menu, or specify "" to use the system default menu. See Custom Menus for Various Forms Modes.

  6. Click OK to exit from the Properties dialog.

  7. Click Save.

See Also