_msmktpl.utl Utility - Make Menu Template Record

Syntax

call "_msmktpl.utl",number_of_items,menu_record$

Description

The _msmktpl.utl utility creates a dynamic menu template that is to be loaded with detail information by an application program and processed with _msdrv.utl. The detail information is stored in repeating fields of the main template according to a secondary template described below.

Parameter

Description

number_of_items

Number of detail items in this menu.

menu_record$

Returned string dimensioned using the template as shown.

Example

The following returns menu_record$ dimensioned as identified below the example:

LET BBEXT$=STBL("BBEXT")
CALL BBEXT$+"_msmktpl.utl",6,MENU$

This is only a raw data structure; to use this data structure, assign values to the various parameters, and invoke the menu using_msdrv.utl.

Header Data

Field

Description

KEY:C(12),

Record key in the menu file. This has no special meaning to the Menu System.

CONVERTED:C(1),

Reserved for internal use only.

NO_ITEMS:N(4),

Number of menu items. (In the above example, 6).

TYPE:N(1),

Menu Type, as follows:

 

0 Horizontal.

 

1 Horizontal, Spreadsheet style.

 

2 Horizontal, Linked Submenus.

 

3 Vertical.

 

4 Vertical, Spreadsheet style.

 

5 Vertical, Linked Submenus.

 

6 Two-dimensional.

 

7 Two-dimensional, Linked Submenus.

 

8 Traditional Menu (Select using numbers).

STYLE:N(1),

Menu style, as follows:

 

0 Plain (No Box)

 

1 Boxed

COL:N(4),

Override the default column for the left border. -1 centers the menu horizontally centered. -100 places the menu at the current column position.

ROW:N(4),

Override the default row for the top border. -1 centers the menu vertically. -100 places the menu at the current column position.

BORDER:N(2),

Override the default border color.

WINDOW:N(2),

Override the default menu color.

SELECT:N(2),

Override the default selection color.

COLS:N(4),

Override the default number of columns. 0 calculates the columns at run time.

ROWS:N(4),

Override the default number of rows. 0 calculates the rows at run time.

DEFAULT:C(1),

Default selection.

HIGHLIGHT_CHAR:C(1),

Character that indicates the NEXT character should be highlighted.

NEWLINE_CHAR:C(1),

Character to indicate line breaks in menu titles and/or menu items.

COLUMN_CHAR:C(1),

Character to indicate column breaks in menu titles and/or menu items.

ARGS:C(1*=1),

Case-sensitive flags to control menu behavior:

 

S=# Sliding menu:

 

 1 Down.

 

 2 Up.

 

 3 Right.

 

 4 Left.

 

C=# Cascading menu:

 

 1 Down and right.

 

 2 2=Up and right.

 

 3 3=Down and left.

 

 4 4=Up and left

 

o=## Cascade offset

 

 a No auto menu

 

 c 2D columnwise

 

 s Shadow

 

 r Reverse

 

 P Pop on Select

 

 p Pop on Exit

 

 d## 2D columns

 

 e No Escape

 

 w No Wrap

 

 f Falloff

 

 h## Spacing

 

 ! Secure

 

 k Pushkey

TITLE:C(1*=1),

Menu title.

GHELP:C(1*=1),

Global help prompt (message).

GHELPFILE:C(1*=1),

Global help file (either a TAOS form object, or in the format helpfile;helpitem, if using _help.pub., or helpfile@helpitem for indexed help.)

ITEMS:C(1*=0)

This field must be dimensioned for the number of items in the menu; for example, ITEMS[6]:C(1*=0) for 6 items. The ITEMS parameter determines this number. The data stored in each of these fields must conform to the detail template given below.

Detail Template

Because it is not possible to assign a template to a field within a templated string, the data in each occurring entry of MENU.ITEMS$ must be passed to a temporary variable dimensioned with the following template. After the appropriate values have been assigned, the data must be passed back to the main record, menu_record$.

Field

Description

CHAR_COL:N(3),

Letter to be highlighted in DISPLAY$[].

COLOR:N(2),

Override color code for this item. Refer to Color Codes.

HIGHLIGHT:N(2),

Override highlight color code for this item. Refer to Color Codes.

DISP_COL:N(3),

Force display column (0 to calculate).

DISP_ROW:N(3),

Force display row (0 to calculate).

ACT_TYPE:N(1),

Action

 

0 Return item number to the calling program.

 

1 Return item number to the calling program, and pop the menu.

 

2 Call a menu item.

 

3 Call a program.

 

4 Reserved.

 

5 Call a program after clearing the screen.

 

6 RUN a program.

 

7 Call an operating system function.

 

8 RELEASE PRO/5 (Use with caution!).

DISPLAY:C(1*=1),

Menu Item Description.

HELP:C(1*=1),

Display Help prompt at the bottom of the screen.

HELPFILE:C(1*=1),

Help file (either a TAOS form object or in the format helpfile;helpitem, if using _help.pub, or helpfile@helpitem for indexed help.)

ACT_NAME:C(1*=1),

Primary action field.

ACT_PARAM:C(1*=1),

Secondary action field.

SECURITY:C(1*=1)

Contains a security code string.

Example

LET BBEXT$=STBL("BBEXT")
CALL BBEXT$+"_msmktpl.utl",3,MENU$
DIM TRASH$:STBL("!MENU_ITEM.TPL")
LET TRASH$=MENU.ITEMS$[1]
LET TRASH.DISPLAY$="FILE"
LET MENU.ITEMS$[1]=TRASH$
LET TRASH$=MENU.ITEMS$[2]
LET TRASH.DISPLAY$="EDIT"
LET MENU.ITEMS$[2]=TRASH$
LET TRASH$=MENU.ITEMS$[3]
LET TRASH.DISPLAY$="EXIT"
LET MENU.ITEMS$[3]=TRASH$
LET MENU.NO_ITEMS=3
LET MENU.STYLE=1
LET MENU.TYPE=3
CALL BBEXT$+"_msdrv.utl",$$,$$,0,RET_VAL,CTLVAL,MENU$,1,0,0,0,0,0,DESCR$

See Also

Alphabetical EUS Utilities

Functional Listing of EUS Utilities

_msdrv.utl