HP OpenVMS Systems Documentation

OpenVMS RTL Screen Management (SMG$) Manual

The output for this VAX Pascal program is shown in the following
figures. In Figure SMG-49, the program is waiting for the user to make
a menu selection.

Figure SMG-49 Output Generated Before a Menu Selection Is
Made

Because the menu is created using the SMG$M_RETURN_IMMED attribute,
once the user makes a selection the menu is terminated, and control
returns to the program. The menu item selected by the user is displayed
in the upper virtual display. This output is shown in Figure SMG-50.

The vertical menu generated by this VAX BASIC program is shown in the
following figures. The default choice is set to the first item in the
menu: "ONE". In Figure SMG-51, the program is waiting for the
user to make a selection from the menu.

Figure SMG-51 Output Generated Before the User Selects a Menu
Item

Because the menu was created with the SMG$M_REMOVE_ITEM attribute, the
user cannot reselect a particular menu item. However, unlike Example 1,
the user can make multiple selections. In Figure SMG-52, the user has
selected "SIX" and "THIRTEEN", and the program has
again highlighted the default menu item and is waiting for the user to
make another selection.

Figure SMG-52 Output Generated After Two Selections

In Figure SMG-53, the user has selected "EXIT" and the menu
has been deleted, although it still appears on the screen. At this
point, no more selections can be made.

The horizontal menu generated by this Fortran example program is shown
in the following figures. In Figure SMG-54, the program displays all
menu items in reverse video except for the default choice. At this
point, the program is waiting for the user to make a selection.

Figure SMG-54 Output Generated Before a Menu Item Is
Selected

Because no attributes were specified when this menu was created, the
items in the menu can be reselected. Figure SMG-55 shows the screen
image after the user has made three selections, two of which are the
same.

Figure SMG-55 Output Generated After Three Menu
Selections

In Figure SMG-56, the user has selected "Exit this menu" and
the program has completed execution.

RETURNS

Arguments

pasteboard-id

Specifies the pasteboard for which broadcast messages are to be
trapped. The pasteboard-id argument is the address of
an unsigned longword that contains the pasteboard identifier.

The pasteboard identifier is returned by SMG$CREATE_PASTEBOARD.

AST-routine

OpenVMS usage:

ast_procedure

type:

procedure value

access:

read only

mechanism:

by value

The address of an AST routine to be called when a message is received
at the pasteboard. The AST-routine argument is the
address of the routine's procedure value.

When the AST-routine argument is either omitted or is
given a value of 0, the BROADCAST mode is set to synchronize. In this
mode, you must periodically call SMG$GET_BROADCAST_MESSAGE to see if
any broadcast messages have arrived.

The AST routine is called with five parameters:
AST-argument, R0, R1, PC, and PSL (on VAX systems) or
PS (on Alpha systems).

AST-argument

OpenVMS usage:

user_arg

type:

longword (unsigned)

access:

read only

mechanism:

by value

A value to be passed to the AST routine. The
AST-argument is an unsigned longword that contains the
value to be passed to the AST routine.

Description

SMG$SET_BROADCAST_TRAPPING enables the trapping of broadcast messages
sent to the specified pasteboard (terminal). When you disable broadcast
trapping, any broadcast messages that have been queued to the terminal
are lost. If you enable broadcast trapping with
SMG$SET_BROADCAST_TRAPPING but do not disable it with
SMG$DISABLE_BROADCAST_TRAPPING before the image exits, any messages
that have been broadcast to the terminal are lost when the image exits.

The system parameters DEFMBXBUFQUO and DEFMBXMXMSG are used when
creating the mailbox that receives broadcast messages.

Condition Values Returned

SS$_NORMAL

Normal successful completion.

SMG$_INVPAS_ID

Invalid
pasteboard-id.

SMG$_NOT_A_TRM

Informational message; the pasteboard is not a terminal.

SMG$_WRONUMARG

Wrong number of arguments.

Any condition values returned by $DASSGN, $CANCEL, or LIB$ASN_WTH_MBX.

Example

The Set Absolute Cursor Position routine moves the virtual cursor to
the specified position in a virtual display.

Format

SMG$SET_CURSOR_ABS display-id [,start-row] [,start-column]

RETURNS

OpenVMS usage:

cond_value

type:

longword (unsigned)

access:

write only

mechanism:

by value

Arguments

display-id

OpenVMS usage:

identifier

type:

longword (unsigned)

access:

read only

mechanism:

by reference

Specifies the virtual display in which to set the virtual cursor
position. The display-id argument is the address of an
unsigned longword that contains the display identifier.

The display identifier is returned by SMG$CREATE_VIRTUAL_DISPLAY.

start-row

OpenVMS usage:

longword_signed

type:

longword (signed)

access:

read only

mechanism:

by reference

Specifies the row position to which the virtual cursor moves. The
start-row argument is the address of a signed longword
that contains the row number. If omitted, the cursor remains at the
current row.

start-column

OpenVMS usage:

longword_signed

type:

longword (signed)

access:

read only

mechanism:

by reference

Specifies the column position to which the virtual cursor moves. The
start-column argument is the address of a signed
longword that contains the column number. If omitted, the virtual
cursor remains at the current column.

Description

SMG$SET_CURSOR_ABS moves the virtual cursor to the specified position
in the specified virtual display.

Condition Values Returned

The Move Cursor Relative to Current Position routine moves the virtual
cursor the specified number of rows and columns from the current
virtual cursor position in a virtual display.

Format

SMG$SET_CURSOR_REL display-id [,delta-row] [,delta-column]

RETURNS

OpenVMS usage:

cond_value

type:

longword (unsigned)

access:

write only

mechanism:

by value

Arguments

display-id

OpenVMS usage:

identifier

type:

longword (unsigned)

access:

read only

mechanism:

by reference

Specifies the virtual display in which to move the virtual cursor. The
display-id argument is the address of an unsigned
longword that contains the display identifier.

The display identifier is returned by SMG$CREATE_VIRTUAL_DISPLAY.

delta-row

OpenVMS usage:

longword_signed

type:

longword (signed)

access:

read only

mechanism:

by reference

Specifies the number of rows to move the virtual cursor. The
delta-row argument is the address of a signed longword
that contains the number of rows to move. If omitted, the virtual
cursor remains at the current row position. If
delta-row is positive, the virtual cursor moves
downward the specified number of rows. If delta-row is
negative, the virtual cursor moves upward the specified number of rows.

delta-column

OpenVMS usage:

longword_signed

type:

longword (signed)

access:

read only

mechanism:

by reference

Specifies the number of columns to move the cursor. The
delta-column argument is the address of a signed
longword that contains the number of columns to move. If omitted, the
virtual cursor remains at the current column position. If
delta-column is positive, the virtual cursor moves the
specified number of columns to the right. If
delta-column is negative, the virtual cursor moves the
specified number of columns to the left.

Description

SMG$SET_CURSOR_REL moves the virtual cursor the specified number of
rows and columns relative to the current virtual cursor position. If
the specified delta-row or
delta-column causes the cursor to move outside the
bounds of the virtual display, SMG$_INVROW or SMG$_INVCOL is returned.

Condition Values Returned

SS$_NORMAL

Normal successful completion.

SMG$_INVARG

Invalid argument.

SMG$_INVCOL

An invalid value of
delta-column caused the cursor to move outside the
bounds of the virtual display.

SMG$_INVDIS_ID

Invalid
display-id.

SMG$_INVROW

An invalid value of
delta-row caused the cursor to move outside the bounds
of the virtual display.