space
Previous Page | Next Page

Adding Application Support Features

Implementing Custom Menus

SAS/AF software provides a menu-building facility to help you create menus for your applications. You can use the PMENU procedure to define custom menus.

To add a menu to your application:

  1. Create a PMENU catalog entry using PROC PMENU.

  2. In the SAS/AF build environment, use the Properties window to set the appropriate frame's pmenuEntry attribute to the PMENU catalog entry that you want to display.

  3. Set the frame's forcePmenuOn attribute to Yes and the frame's bannerType attribute to None.

For additional information about PMENU entries, see the SAS/AF online Help.


Using the PMENU Procedure to Create Menus

To create the structures and commands associated with your menu, you submit a source program that contains PMENU procedure statements. Because the source statements that are used to create a PMENU entry are not accessible in the PMENU catalog entry, you should save the statements in your development catalog as a SOURCE entry.

Consider the following example:

proc pmenu catalog=sasuser.corprpts;
  menu main;
  item 'File' menu=menuFile mnemonic='F';
  item 'View' menu=menuView mnemonic='V';
  item 'Help' menu=menuHelp mnemonic='H';
    menu menuFile;
      item 'Open Report' selection=fileOpen mnemonic='O';
      item 'Save Report' selection=fileSave mnemonic='S';
      separator;
      item 'End';
        selection fileOpen 'openrpt';
        selection fileSave 'saverpt';
    menu menuView;
      item 'View Table' selection=viewTbl mnemonic='T';
      item 'Options' selection=viewOpts mnemonic='p';
        selection viewTbl 'afa c=mylib.mycat.view.frame';
        selection viewOpts 'afa c=mylib.mycat.options.frame';
    menu menuHelp;
      item 'Contents' selection=helpCont mnemonic='C';
      item 'About...' selection=helpAbt mnemonic='A';
        selection helpCont 'wbrowse "http://myintranet.com/help.htm"';
        selection helpAbt  'afa c=mylib.mycat.about.frame';
run;
quit;

In this example,

The completed menu appears as follows:

[untitled graphic]

In the PMENU example, the menuFile menu contains two SELECTION statements that issue the custom commands openrpt and saverpt. Your frame SCL program can process commands that are not valid SAS commands if

For example, the SCL program for the frame associated with MAIN.PMENU could include the following code:

   dcl char(8) command;
   INIT:
      control always;
   return;

   MAIN:
      command=lowcase(word(1));
      if command='openrpt' then do;
         /* ...SCL to open reports... */
         call nextcmd();
         end;
      else if command='saverpt' then do;
         /* ...SCL to save reports... */
         call nextcmd();
         end;
   return;

For complete information on the PMENU procedure, refer to the SAS Procedures Guide.

space
Previous Page | Next Page | Top of Page