


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 three 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 DOS or Windows, the variable would look this 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"
For more information, see the section on "MOUSE*", Appendix H, Book 4, "Appendices."
Field-type name
The runtime 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. It can be one of the following:
NONE Indicates that this type of field may not be selected with the mouse. When this keyword is used, then 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 shapeis 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
|
| 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 |
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.