Are you ready for the exam? The computer level exam column is sincerely organized? 2017 Computer Level 2 VFP Tutorial: Menu Design and Application? Candidates are welcome to come and learn.
Menu design and application
Knowledge points
1. Menu design process The complete process of designing a menu has four steps:
( 1) Call the menu designer
(2) Define the menu
(3) Generate the menu program
(4) Run the menu
?Each menu option can optionally be set with a hotkey and a shortcut key.
A hotkey is usually a character that allows you to quickly select a menu item by pressing its hotkey when the menu is activated.
?The shortcut key is usually a key combination composed of CTRL and another character key. Regardless of whether the menu is activated, you can select the corresponding menu option through shortcut keys.
? Any type of menu, when one of the options is selected, there will be a certain action. This action can be one of the following three situations:
Only option name: Execute a command
Also an ellipsis? Execute a process
There is also a black triangle ▲: Activate another menu
? The SET SYSMENU command can allow or prohibit access to the system menu during program execution, and you can also reconfigure the system menu:
SET SYSMENU ON|OFF| AUTOMATIC|TO[
|TO[
|TO[DEFAULT]|SAVE|NOSAVE
< p> Description:ON: Allow access to the system menu when the program is executed
OFF: Disable access to the system menu when the program is executed
AUTOMATIC: Allow the system menu to be displayed out, you can access the system menu
TO[
TO[
TO DEFAULT: Restore the system menu to the default settings
TO SAVE: Restore the system menu to the default settings
TO NOSAVE: Restore the default configuration to the standard configuration of the VISUAL FOXPRO system menu
Submenu (Submenu): If the current configuration defined by the user If the menu item also has submenus, this item should be selected. When this item is selected, a "Me" button will appear on the right side of it. After pressing the "Me" button, a new screen will be entered to design the submenu (the level of the menu can be changed from the "Menu Level" on the right side of the design window ? as seen in the pop-up list).
Command: If the function of the current menu item is to perform a certain action, this item should be selected. When this item is selected, a text box appears on the right side of it. Enter the command to be executed in this text box. This option only corresponds to executing a command or calling another program. If the action to be performed requires multiple commands and no corresponding program is available, then "Process" should be selected here.
? Main menu name/menu item # (Pad Name/Bar#): The main menu name (Pad Name) item appears when defining the main menu, and the menu item # (B a r#) appears when defining the submenu. menu item. When this item is selected, a text box appears on the right side of it, and the user can enter a name in the text box. The purpose of selecting this item is mainly to reference it in the program, for example, use it to design dynamic menus. In fact, if the user does not select this item, the system will also assign a name to each main menu and submenu item, but the user will not know it.
Procedure: Used to define a process associated with a menu item. This process will be executed when the user selects the menu item. If this is selected, a "Create" button will appear on the right side of it. Pressing this button will bring up the My window for entering process code.
Option button: Press this button to pop up the Prompt Options dialog box.
? Menu level: This pop-up list displays the current menu level. When the menu has many levels, you can use this item to know the current position. This item is also used to return to any level menu above from a submenu.
?Preview? button: Use this button to observe the image of the designed menu.
You can make selections in the displayed menus and check whether the hierarchical relationships and prompts of the menus are correct. However, this selection will not perform the corresponding actions of each menu.
?Insert? button: Insert a new menu item in front of the current menu item.
?Delete? button: delete the current menu item.
Menu code, which includes the following two check boxes:
Settings: Selecting this item will open a window where you can add a piece of initialization code to the menu system. To enter the open initialization code window, press the OK button to close the dialog box;
Cleanup: Selecting this option will open a window where you can add a closing code to the menu system. To access the open End Code I window, press the OK button to close the dialog box.
Top-level form: If this checkbox is selected, the menu will be allowed to be used in the top-level form (SDI). If unchecked, this menu is only allowed in Visual FoxPro page frames. 2. Menu options dialog box
1) Name: The name of the menu is displayed here. If the user is currently in the main menu, the file name here cannot be changed (its name is? Menu bar?), that is, all main menus share one process. If the user is currently in the submenu, the file name here can be changed. By default, the file name here is the same as the content in the user prompt column in the menu design window. When using Chinese character prompts, it is best to change the file name here.
2) Process: This I box is used to enter or display the process code of the menu. If there is a lot of code that exceeds the size of my box, the scrollbar on the right will be activated.
3) Me button: Pressing this button will open a text Me window so that the user does not have to enter code in the menu options dialog box.
Example questions
1. In Visual FoxPro, the extension of the menu file is ______.
A..MNX B..MNT C..IDX D..PJT
Analysis The knowledge point tested in this question is the extension of the menu file. In Visual FoxPro, menu files have the extension .MNX.
Answer A is the menu file extension. Option B is the menu comment file extension. Option C is the index file extension. Option D is the project file extension.
Answer A
2. To design a drop-down menu for the top-level form, you first need to select "Top-level Form" in the ____ dialog box with the menu designer open. check box; secondly, set the ____ attribute value of the form to 2 to make it a top-level form; finally, you need to set the command to call the menu program in the ____ event code of the form.
Analysis of the knowledge point tested in this question is the operation of designing a drop-down menu for a form. In Visual FoxPro, the steps to add a drop-down menu to the top-level form are:
(1) Design the drop-down menu in the menu designer window.
(2) Click "General Options" in the "Show" menu and select "Top Form".
(3) Set the form's Show Windows property value to 2 to make it a top-level form.
(4) Add the command to call the menu program in the Init event code of the form, the format is:
DO
(5) Add a command to clear the menu in the Destroy event code of the form, so that the menu can be cleared at the same time when the form is closed, releasing the memory space used by it.
The command format is:
RELEASE MENU