SECTION 4 -- MENU DEFINITION

Menus in TAE are defined in menu definition files (MDF); one MDF corresponds to one menu. To add a menu to the system, it is only necessary to create an MDF--using the host system's text editor--and to link it into the menu tree. (Unlinked menus can also be accessed by using the "MENU name" command.)

An MDF contains:

An MDF is linked into the menu tree when the menu name is referenced in an entry of another MDF.

A sample MDF is shown in Figure 4-1; the associated menu is shown in Figure 4-2.



FIGURE 4-1

SAMPLE MENU DEFINITION FILE

!	MDF FOR TESTS
!
!	Note that the exclamation point may be used in
!	an MDF to denote commentary (which does not
!	appear on the menu display).
.TITLE
TAE Test Programs

.MENU CMDTESTS
Menu for command procedure testing
.PROC XPTEST
General test of parameter pickup
.PROC PRMDMP
General parameter block dumper
.PROC ARITH
Program to do arithmetic on two numbers
.PROC WAIT
A program to wait for user-specified intervals
.COMMAND TUTOR VGEN OUTFILE=standard.img
Image file pattern generator exerciser with primed OUTFILE
.PROC PARMGEX
Parameter passing self tester
.COMMAND DISPLAY $MENUS
Display current menu stack.
!
!	MENU HELP
!
.HELP
This menu consists of test, diagnostic, and demonstration
programs for TAE.  The  first selection is a menu entry for
additional procs which are command  procedures for testing
TCL control structures.
.END


FIGURE 4-2

Menu Displayed Using MDF in Figure 4-1

MENU DISPLAY: TESTS 

TAE Test Programs

1)  Menu for command procedure testing
2)  General test of parameter pickup
3)  General parameter block dumper
4)  Program to do arithmetic on two numbers
5)  A program to wait for user-specified intervals
6)  Image file pattern generator exerciser with primed OUTFILE.
7)  Parameter passing self tester
8)  Display current menu stack.




Enter:  selection number, HELP, BACK, TOP, MENU, COMMAND, or LOGOFF.
?

4.1 MENU DEFINITION FILE STRUCTURE

The general form of an MDF is:

.TITLE
header text line(s)

.PROC or .MENU or .COMMAND
entry text lines

.PROC or .MENU or .COMMAND
entry text lines
    .
    .
    .
.HELP
help text
.END

The capitalized words beginning with a period are menu definition directives, described below.

4.2 MENU DEFINITION DIRECTIVES

The definition directives consist of a directive to specify the title of the menu (.TITLE), directives to specify help text (.HELP, .EHELP, and .PAGE), and directives to specify the actual menu entries that appear on the menu screen (.PROC, .MENU, and .COMMAND). Entries on the screen are numbered by TAE according to the order in which the .PROC, .MENU, and .COMMAND directives appear in the MDF.

  1. .TITLE

    The .TITLE directive introduces the text lines to be used in the menu title; if .TITLE is present, it must be the first directive. Any number of lines may follow .TITLE and these lines are displayed exactly as they appear in the MDF. The maximum number of characters in any .TITLE text line is 80; characters beyond column 80 are ignored.

    .TITLE is not required.

  2. .PROC

    The .PROC directive defines a menu entry for a proc; the text that follows the .PROC line is the text that is to appear for the corresponding entry number. The .PROC directive contains the file specification of the PDF that is accessed if the user selects the corresponding menu entry. (See Section 2 for details on PDFs.)

    When the user selects a .PROC menu entry, TAE enters tutor mode for the proc.

    If the file specification does not include a proc library name, then the PDF is located according to the standard library hierarchy search as described in Section 2.13. The maximum number of characters in any PROC text line is 76; characters beyond column 76 are ignored.

  3. .MENU

    The .MENU directive creates a screen entry to refer to another menu; the text lines that follow the .MENU line are the text lines that are to appear for the corresponding entry number. The .MENU directive contains the specification of the MDF that is to be activated if the user selects the corresponding entry. If the library of the MDF is not specified, then TAE uses the hierarchy search (Section 2.13) to locate the MDF.

    The maximum number of characters in any MENU text line is 76; characters beyond column 76 are ignored.

    Because one menu may reference another menu, the root menu defines a "menu tree." A menu tree may have a maximum of 50 levels of menus. The root menu is, by default, the MDF in the TAE system menu library and is named ROOT. A user may select a root menu different from the default by referencing the menu from the ULOGON procedure as described in Section 2.14.

  4. .COMMAND

    The .COMMAND directive specifies a TCL command to be executed if the user selects the corresponding menu entry. The command may be any TCL command and the TCL line continuation convention (+) may be used to continue the command string from the initial .COMMAND directive; the ".COMMAND" directive is not repeated on continued lines.

  5. .EHELP

    The .EHELP directive specifies help text for a .COMMAND entry. The .EHELP directive and associated text must follow the .COMMAND directive and its associated text.

  6. .HELP

    The .HELP directive introduces lines of free-form text that are displayed when the menu user types "HELP *". These lines are treated identically to those in a .HELP paragraph in a help file. (See Section 2.15.)

  7. .PAGE

    The .PAGE directive is used within help text to force a new screen page.

  8. Comments

    Lines in an MDF beginning with an exclamation point are considered comments and are ignored by the menu processor.

4.3 USE OF THE .COMMAND MDF DIRECTIVE

The .COMMAND directive is a generalization of the .MENU and .PROC directives.

With .COMMAND, an MDF author has considerable flexibility. For example, whereas a .PROC entry always starts in tutor mode, .COMMAND may execute a proc directly, supplying proc parameters in the .COMMAND directive. Programmers are cautioned to use .COMMAND carefully, because users are often confused by the inconsistency that some menu entries start in tutor and some entries do not. The following is an MDF that demonstrates some .COMMAND techniques:

.TITLE
This menu demonstrates .COMMAND techniques.

.COMMAND LET $SWITCH = 1
Set the TAE switch word so that programs start in the debugger.

.COMMAND DCL SHOW TIME
Display time of day.

.COMMAND DISPLAY $MENUS
Display current menu stack.

.COMMAND RADCOR IMAGE=STANDARD WINDOW=(0,511,0,511)
Execute the RADCOR proc with the standard image and for
the upper left side of the screen.

.COMMAND TUTOR RADCOR |RUN=BATCH|
Tutor on RADCOR. The tutor RUN will execute RADCOR in batch mode.

.COMMAND RADCOR |RESTORE=RADCOR|
Execute RADCOR using parameters from the most recent tutor SAVE.

4.4 MDF/HLP TEXT STRING SUBSTITUTION

Menu and help displays may be made sensitive to the current run-time session. See Section 2.15.3.

4.5 NOTES ON MENU PROCESSING

The Terminal Monitor processes a menu definition file as follows:

  1. The screen is cleared and a header line with the menu name is displayed.

  2. The TITLE text (if present) is displayed.

  3. The text for the first menu entry is displayed with entry number "1"; the next entry is shown with the number "2", and so on.

  4. When all entries have been shown, the menu prompt is written at the bottom of the screen and the user response is requested.

A menu must fit on one screen. If the entries exceed the screen limit, TAE displays only the entries that fit, ignoring the remaining entries.

4.6 PERSONALIZED MENU TREES

Because MDFs are located via the hierarchy search (Section 2.13), a user has a "personalized menu tree" if an MDF named ROOT exists in the user's directory. MDF references from this root directory may exist in the user's directory, in application libraries, or in the system menu library.

4.7 SUBMISSION OF BATCH OR ASYNC JOBS FROM MENU MODE

The -SUBMIT subcommand of the TAE BATCH and TAE ASYNC proc exists so that a menu user may submit a batch or asynchronous job. The procedure to submit a job from menu mode is:

  1. The user selects the .PROC menu entry of interest.

  2. In tutor mode, the user sets parameters as desired for execution of the proc. The user saves the parameters on disk with the tutor SAVE command.

  3. The user EXITs from tutor without executing the proc.

  4. The user selects a menu entry defined as ".PROC BATCH-SUBMIT" or ".PROC ASYNC-SUBMIT".

  5. The BATCH-SUBMIT and ASYNC-SUBMIT procs accept as parameters the name of the proc to be executed and the name of the SAVE file.

  6. When the BATCH-SUBMIT proc is RUN, the user's proc is submitted for batch execution. When the ASYNC-SUBMIT proc is RUN, the user's proc is submitted for asynchronous execution.

4.8 CAPTIVE MENU

There are features available in TAE to capture a user in menu mode and prevent entry to the operating system. The MENU-CLOSED TCL command puts the user in menu mode, while instructing TAE to prevent re-entry to command mode. See the "TAE Command Language (TCL) User's Manual" and the "TAE Plus System Manager's Guide" for details of captive menu.