One of the first things you’ll want to do after you create a new project is add your application’s unique menu pads and options to the Main menu. You use the Visual FoxPro Menu builder to add and edit menu options.
To add, delete or change the options in a menu, highlight the menu on the VPME Menu Builder and click the Edit button. VPME displays the Visual FoxPro Menu Builder with the highlighted menu loaded.
Visual FoxPro Menu Builder with Main application menu loaded.
Tip: When you add an option to a menu, VPM Enterprise does much of the work for you. You only have to enter the menu prompt and select the menu result type. When you select the Command result type, VPME will enter the menu command for you when you use the Object Builder to create the object that the menu option runs.
Ø To add menu options to a menu
1. With the menu highlighted on the VPM Enterprise Menu Builder, click the Edit button. VPM Enterprise displays the Visual FoxPro Menu Builder with the menu loaded.
2. Enter the prompts for the menu pads, popups and options you want to add to the menu.
3. When you enter a prompt, select the result type for the option (Submenu, Command, Procedure, Pad Name or Bar Number).
4. Select the "Command" result type if you’re going to run a form, program, report, query or label from the menu option. When you select the Command result type for an option, you do not have to enter the Visual FoxPro command. VPME will create the command for you when you use the Object Builder to create the object that runs from the menu option.
Tip – C5 Error: When some Visual FoxPro users leave a menu command empty in the Menu Designer, they get the dreaded “C5” error. If that happens to you when you leave a menu command empty, enter an “*” (asterisk without the quotes) in the menu command. That will prevent the C5 error, and the Object Builder will treat an “*” as an empty menu command. You will then be able to use the Object Builder to create the object to be run from the menu command, and the Object Builder will automatically insert the appropriate call for the object into the menu command.
Tip – Form Menu Commands: VPM Enterprise creates the following menu command for forms:
DO FORM <Formname>
If you need to call a form with parameters, you modify the command line to look like this:
DO FORM <Formname> WITH <parameters>
Put quotes around “<Formname>” if the form name contains spaces.
5. If the menu option you add is a Procedure, Pad Name or Bar Number result type, you can enter the Procedure code, Pad Name or Bar Number when you add the option to the menu, but you don’t have to. You can wait and select the menu option from the Object Builder and make your entries there.
6. When you’ve finished entering prompts and result types, double-click the close box and save your changes.
When You Close the VFP Menu Builder
When you close the Visual FoxPro Menu Builder, VPM Enterprise:
· Inserts menu security code in the Comment clause of menu options that don’t already have the code.
· Assigns unique identification numbers to each menu pad, popup and option. The menu numbers are used to identify menu options to the VPM Enterprise Menu Security routines.
Tip: The next time the Object Builder is activated, the Object Builder’s menu will reflect your changes.