PMENU Procedure

Example 5: Associating Menus with a FRAME Application

Features:

ITEM statement

MENU statement

Other features:

SAS/AF software

Details

This example creates menus for a FRAME entry and gives the steps necessary to associate the menus with a FRAME entry from SAS/AF software.

Program

libname proclib
'SAS-data-library';
proc pmenu catalog=proclib.menucat;
   menu frame;
      item 'File' menu=f;
      item 'Help' menu=h;
      menu f;
         item 'Cancel';
         item 'End';
      menu h;
         item 'About the application' selection=a;
         item 'About the keys'   selection=k;
            selection a 'sethelp proclib.menucat.app.help;help';
            selection k 'sethelp proclib.menucat.keys.help;help';
run;
quit;

Program Description

Declare the PROCLIB library. The PROCLIB library is used to store menu definitions.
libname proclib
'SAS-data-library';
Specify the catalog for storing menu definitions. Menu definitions will be stored in the PROCLIB.MENUCAT catalog.
proc pmenu catalog=proclib.menucat;
Specify the name of the catalog entry. The MENU statement specifies FRAME as the name of the catalog entry. The menus are stored in the catalog entry PROCLIB.MENUS.FRAME.PMENU.
   menu frame;
Design the menu bar. The ITEM statements specify the items in the menu bar. The value of MENU= corresponds to a subsequent MENU statement.
      item 'File' menu=f;
      item 'Help' menu=h;
Design the File menu. The MENU statement equates to the MENU= option in a preceding ITEM statement. The ITEM statements specify the selections that are available under File on the menu bar.
      menu f;
         item 'Cancel';
         item 'End';
Design the Help menu. The MENU statement equates to the MENU= option in a preceding ITEM statement. The ITEM statements specify the selections that are available under Help on the menu bar. The value of the SELECTION= option equates to a subsequent SELECTION statement.
      menu h;
         item 'About the application' selection=a;
         item 'About the keys'   selection=k;
Specify commands for the Help menu. The SETHELP command specifies a HELP entry that contains user-written information for this application. The semicolon that appears after the HELP entry name enables the HELP command to be included in the string. The HELP command invokes the HELP entry.
            selection a 'sethelp proclib.menucat.app.help;help';
            selection k 'sethelp proclib.menucat.keys.help;help';
run;
quit;

Steps to Associate Menus with a FRAME

  1. In the BUILD environment for the FRAME entry, from the menu bar, select Viewthen selectProperties Window.
  2. In the Properties window, select the Value field for the pmenuEntry Attribute Name. The Select An Entry window appears.
  3. In the Select An Entry window, enter the name of the catalog entry that is specified in the PROC PMENU step that creates the menus.
  4. Test the FRAME as follows from the menu bar of the FRAME:Buildthen selectTest Notice in the following display that the menus are now associated with the FRAME.
    FRAME Window
    For more information about programming with FRAME entries, see Getting Started with SAS/AF(R) 9.3 and Frames .