Full-View - Windows for Pick

(C) Copyright 1985-1996 Modular Software Corporation. All rights reserved.

Version 2.0 for AP - February 14, 1996

   Goto:  Table of Contents   Index
Chapter:  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

8: THE MENUING SYSTEM

The menuing system provides an attractive utility which can be used both from within an application or as a stand-alone utility for system flow control. Menus are designed using an interactive painter.

  1. The menuing system provides functions to create and utilize pop-up menus which allow the user to make a selection in three different ways:


  1. Each selection on the menu may have several keys associated with it.


  2. Whenever a selection is highlighted, optional descriptive help text for that selection is automatically displayed. Pressing RETURN actually executes the selection.


  3. Menus are created with an interactive painter which provides for entry of static menu elements and for menu selections including entry of:


  1. Menus are optimized for maximum visual appeal and make full utilization of available video attributes, color, and line graphics.

8.1: BUILDING MENU DEFINITIONS

Menus are created using a menu painter which allows menus to be created in two portions. First, static menu elements or labels are entered.

The menu painter is activated by:

    ENTER-MENU menu.name
The Menu Painter has an Option Menu which allows you to move forward and back through the steps of a particular menu. Each menu step corresponds to a selection. Menus always operate in Windowing mode and the X,Y display position of each step is set relative to the window. After all the menu steps have been created, the entire window may be moved by setting the X and Y coordinates in the Header portion of the Menu Painter.

The Header section is also used to establish the relative location of the Help Window. The relative position must be entered into the menu Header fields as an X and Y value which will place the help text.

8.1.1: MENU STEP DEFINITIONS

Each step in the FULL-VIEW menu definition function defines a single selection for the menu being defined. The fields that are entered for each menu definition are:

Selection text
This is the text that will display on the menu for this selection. It is also the text that will highlight when this selection is chosen.
Display location
This is the location on the menu (relative to the upper-left hand corner of the menu) where this selection will display.
Selection keys
These are keys which will activate the selection. One or more keys (or no keys) may be specified for a particular selection. It is customary to specify both upper and lower case letters when defining a menu with letter selection keys. You can also specify control keys such as function keys by entering F1, F2, . . . F11 etc.
Help text
These fields are used to enter help text specific to the selection, to be displayed when the menu is used. The selection help text will appear within the menu at the position specified in the menu header when the selection is highlighted.
TCL commands
This is the command that the menu will actually execute in order to perform this step's function. Any valid TCL command in the run-time account (verb or proc) can be specified. The command should complete by returning control to the calling program and need not link back to the menu processor explicitly.
Window?
This field is used to specify whether the menu processor itself is to save and restore the screen prior to executing this command. Typically, this selection is 'Y' for everything unless the function being run will restore the screen to it's original form upon completion.

8.2: EXECUTING STAND-ALONE MENUS

In order to use stand alone menus, the following TCL command must be executed:

    MENU {menu.file} menu.name {/option.letters}
The 'menu.name' is the name of the first menu that is to run. The command MENU is actually a PROC, so when calling this from another PROC it is important to follow proper PROC linkage conventions. For example:

    PQ
    HMENU MENU.MAIN /O
    P
    O  The PROC continues
will not execute correctly because MENU is in itself a PROC.

The following commands would work correctly however:

    PQ
    RI
    IHMENU MENU.MAIN /O
    [MD MENU]
    O  The PROC continues
As a convenience, a FULL-VIEW utility PROC is included which can make interfacing with PROCS and VERBS much easier from PROC. The above example would be:

    PQ
    HMENU MENU.MAIN /O
    [FV.PQ EXECUTE]
    O  The PROC continues
The PROC EXECUTE acts in much the same way as the P PROC command but will correctly link to both VERBS and PROCS.

The available options for menus are:

/O
Overwrite the previous screen, i.e. Do not perform a clear screen before executing the menu.
/Q
Quick menu, no border or graphics characters. Usually prints a little quicker.
/R
Return required. Menu selections on the menu will not execute until the return key is pressed.
/W
Window option. When this option is specified (usually along with the O option), the menu itself is responsible for restoring the original screen. It does so by only re-painting the portion of the screen that the menu itself overwrites.
/Z
Do not "walk" though menu steps as selections are made instead of returning to step 1 each time.
/@
Begin menu execution at step 2 instead of step 1.
CLEARING THE MENU RETURN STACK

When using the stand alone menu processor, a return stack is maintained in the file FV.CONTROL, both by port number and by BASIC EXECUTE level. In order for this stack to be properly initialized a verb is supplied which will clear the stack. This verb is:

    MENU-CLEAR
This function should always be executed when a user logs on to a FULL-VIEW enabled account to insure that the menu return stack begins empty.

You should use this verb upon any entry into a menu where there has not already been previous use of the menu processor. For example, a logon PROC might appear as:

    PQ
    HFV-INITPORT
    P
    [USER.PROCLIB USER.SECURITY]
    [USER.PROCLIB SETUP.HOT.KEYS]
    HMENU-CLEAR
    P
    HMENU MENU.LOGON
    [FV.PQ EXECUTE]
    HOFF
    P
The MENU-CLEAR program only clears the menu return stack for the current and higher EXECUTE levels and is safe to use re-entrantly.

8.3: CALLING MENUS FROM BASIC

A subroutine is provided which utilizes the formatted menu functions from within BASIC. The menu painter itself uses this function for it's operation. This function is called as:

    CALL MENU.SUB(menu.name,x,y,options,command)
menu.name
The name of a compiled menu definition item in the MENU.OBJ file.
x,y
The offset position where you wish the menu to display. If you wish to display the menu at the location where it was defined, enter these values as 0,0. The availability of these values allows a single menu definition which is defined at the top-left hand corner of the screen to be used anywhere on the screen.
Options
O
The menu will overlay whatever is currently on the screen.

Q
A "quick" menu (a menu with no border).

R
Pressing the [return] key is required to make a menu selection.

Z
Menu re-entry. The menu function is entered, but the menu itself is not re-displayed. This is used to re-enter a menu which is already on the screen.
command
The menu command. This variable is used both upon entry and upon exit of MENU.SUB. Upon entry, it specifies which field of the menu you wish to be initially highlighted. Upon exit, it informs the application of which selection the user chose.
   Goto:  Table of Contents   Index
Chapter:  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15