The Screen Designer lets you create multiple menus for a screen. You determine whether the menu appears as a menu bar at the top of the screen or as a right-click pop-up menu. Note that while a screen can have only one menu bar (or main menu), you can assign pop-up menus to any control on the screen that is not a display-only control. So your might assign one menu bar and one pop-up menu for your screen, then have additional pop-up menus associated with a grid control and an entry field that appear on the screen. You can also assign the same pop-up menu to multiple screens or controls.
To add a menu bar (main menu) to your screen:
Make a note of the Handle Variable property associated with the menu.
When you select a MAIN MENU handle, the generated code causes this menu to display at the top of your window. The code is put into the .cbl program generated. For example, if a screen is called form1 and the static menu handle is FORM1-MN-1-MENU, the code in form1.cbl is:
PERFORM BUILD-Form1-MN-1-MENU.
This code generates form1.mnu, which contains:
CALL "w$menu" USING WMENU-SHOW, MENU-HANDLE.
Pop-up menus do not display via calls to W$MENU like this. They show up automatically when you right-click the control. The code that is generated for the pop-up menu is just a single line of code in the form1.prd file, as follows:
MOVE menu-handle TO Form1-MN-2-Handle
To define a pop-up menu for use with a screen or control, do the following:
Make a note of the Handle Variable property associated with the menu.