Screen Section Behavior

When the user selects a field in the Screen Section, the exact behavior depends on the field's underlying type. You can control the behavior of the mouse with regard to each field type with the MOUSE configuration variable. This variable takes as its arguments one of the field-type names, an equals (=) sign, and then two keywords separated by a comma, as shown:

field-type name=keyword, keyword

Depending on where you are setting the MOUSE variable, there are several methods of setting its configuration.

If you want to implement this variable in a configuration file, the variable can be set without using the equals sign. For example:

MOUSE-NUMERIC-SHAPE     Bar

If you are setting the variable as part of your environment in Windows, the variable would look this:

SET MOUSE-NUMERIC-SHAPE=Bar

If you are setting the variable in your program using COBOL syntax, the variable would look like this:

SET ENVIRONMENT "MOUSE-NUMERIC-SHAPE" TO "Bar"

Field-type name

The runtime system distinguishes between three classes of fields: numeric, numeric-edited, and all others. These are referred to respectively as NUMERIC, EDITED, and ALPHA.

First keyword

The first keyword defines how the field is selected when the user presses the left button. This keyword can be one of the following:

Keyword Description
NONE Indicates that this type of field may not be selected with the mouse. When this keyword is used, the second keyword (which defines the mouse's shape) is ignored. The mouse will adopt the shape used for areas of the screen that are not part of any field.
FIELD Indicates that pressing the left button anywhere in the field will cause the cursor to be positioned at the beginning of the field.
CHARACTER    Indicates that pressing the left button in the field will position the cursor at the character pointed to by the mouse. If this is past the last non-prompt character in the field, the cursor will be placed just after the last non-prompt character.

Second keyword

The second keyword is used only for graphical environments. It indicates the shape that the mouse pointer should take while in the field. It can be one of the following:

ARROW    The mouse pointer appears in the default arrow shape.
BAR The mouse appears as a vertical bar. This is the I-Bar shape typically used to indicate that the mouse can be positioned at a particular character.
CROSS The mouse pointer appears as cross-hairs.

In graphical environments such as Windows, you may also define the shape that the mouse will take when it is used in the current field. Because the action of the mouse is the same for all field types once they become the current field, the mouse shape is the same for all three types. You set the desired shape using the CURRENT keyword in the MOUSE configuration variable. This is followed by an equals sign and the desired shape. The default shape is the BAR shape.

The default configuration is as follows:

MOUSE    Alpha=Character, Bar
MOUSE Numeric=Field, Arrow
MOUSE Edited=Field, Arrow
MOUSE Current=Bar
Note: You may place multiple entries on the MOUSE configuration line, but you are not required to do so.

The following configuration variables can also be used to set the behavior of the mouse:

To set field selection: To set cursor shape:
MOUSE_ALPHA_SELECT MOUSE_ALPHA_SHAPE
MOUSE_EDITED_SELECT MOUSE_EDITED_SHAPE
MOUSE_NUMERIC_SELECT     MOUSE_NUMERIC_SHAPE
  MOUSE_CURRENT_SHAPE

With these variables, you need to set the first and second keywords separately. For example, to change the defaults shown above for a numeric field, you would enter:

MOUSE_NUMERIC_SELECT = character
MOUSE_NUMERIC_SHAPE = bar

The REQUIRED phrase is used in the Screen Section to ensure that a user cannot bypass required fields by jumping to the last field with the mouse.