MNUCNL (Menu-Cancel Key) keyword for display files

Use this file- or record-level keyword to assign a CA key to be the cancel key for menu bars or pull-down menus.

When the MNUCNL keyword is active and a pull-down menu is displayed, pressing the CA key cancels the pull-down menu and returns the cursor to the choice in the menu bar. If no pull-down menu is displayed and the cursor is located in the menu bar, pressing the CA key cancels the menu bar and returns the cursor to the application screen. If no pull-down menu is displayed and the cursor is on the application screen, pressing the CA key returns control to the application.

The format of the keyword is:
MNUCNL[(CAnn [response-indicator])]

The CAnn parameter is optional. If not specified, the default is CA12. Valid values are CA01 through CA24.

The response-indicator parameter is optional. The parameter is set on when the MNUCNL keyword is active on a record other than a menu bar or pull-down menu, and control is being returned to the application.

Within a record, the CAnn key specified by the MNUCNL keyword cannot be specified again using another keyword (such as MNUBARSW). Because MNUCNL at the file-level extends to all records in the file, this must be considered when assigning a CAnn key.

If the MNUCNL keyword is specified on the record, the CAnn key or default CA12 key can be used only as a CA key on other records, not as a CF key.

The MNUCNL keyword is allowed only in a file containing a menu-bar record.

Option indicators are valid for this keyword.

Example

The following example shows how to specify the MNUCNL keyword:

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A                                      MNUCNL(CA12 12)
     A          R MENUBAR                   MNUBAR
     A            MNUFLD         2Y 0B  1  2
     A                                      MNUBARCHC(1 PULLFILE +
     A                                         '>File        ')
     A  01                                  MNUBARCHC(2 PULLEDIT +
     A                                         '>Edit        ')
     A
     A          R PULLEDIT                  PULLDOWN
     A            F1             1D 0B  1  2RANGE(1 3)
     A                                  1  5'1. Undo        '
     A                                  2  4'2. Mark        '
     A                                  3  4'3. Copy        '
     A            :
     A            :
     A          R APPSCR                    MNUBARDSP(MENUBAR &MNUCHOICE);
     A            FIELD1        10A  B 10 12
     A            FIELD2         5S 0B 14 12
     A                                 24  1'F12=Cancel '
     A            MNUCHOICE      2S 0H

In this example, CA12 is defined as the cancel key for all records in the file. If CA12 is pressed while the pull-down menu, PULLEDIT, is displayed, the pull-down menu is canceled. If CA12 is pressed while the cursor is located on the menu bar (no pull-down menus are displayed), the menu bar is canceled and the cursor is moved back to the application record. If CA12 is pressed while the cursor is not located on the menu bar and no pull-down menu is displayed, response indicator 12 is set on and control is returned to the application program.