ContentsIndexPreviousNext

3.1 Overview

ACUCOBOL-GT allows you to create, display, and process graphical controls. Graphical controls are also commonly called graphical objects or widgets. Some examples of common graphical controls include push buttons, list boxes, radio buttons, check boxes, and entry fields (text entry boxes). ACUCOBOL-GT provides a consistent method for specifying and handling graphical controls. Several common control types are supported. Future versions of ACUCOBOL-GT may incorporate additional control types.

Graphical controls have several important components:

1. Each control has an underlying type, such as push button or check box (this is also called the control's class). For a list of control types, see section 3.2.

2. Each control has a handle that uniquely distinguishes the control. Handles are also discussed in section 3.2.

3. Each control has a set of common properties defined for it. These common properties are described in section 6.4.9, Book 3, "Reference Manual." If a common property is handled uniquely by a control type, that special handling is described in Chapter 5, "Control Types Reference."

Common properties that apply to virtually all controls include:

a) location Each control has a screen location. The location is given as row and column coordinates that specify the position of the upper left-hand corner of the control on the screen. The character coordinate phrases CLINE and CCOL can be used to specify an alternate control location for use on a non-graphical system.

b) size Controls have size information. The size information is given as width and height. The exact meaning of the width and height depends on the control type. Some control types have a predefined size (in one or both dimensions). The character coordinate phrases CSIZE and CLINES can be used to specify an alternate control size for use on a non-graphical system.

c) titles Controls can have titles. This usually appears as a text label attached to the control. Examples include the text on a push button or the text beside a check box. Some controls, such as entry fields, do not use titles.

d) value A control also has a value. The value of a control is the user-modifiable portion of that control. For an entry field, this is the text entered into the box. For check boxes, the value is whether the box is checked or not. Some controls, such as push buttons, do not have values. The exact range of values allowed is determined by the control type.

e) color Controls have color. Both foreground and background colors apply. The exact meaning of the color information depends on the control type. Some controls or host systems may limit the choice of colors.

f) font Most controls have a font that is used when text is displayed in conjunction with the control.

g) styles Controls also have style properties. Style properties typically affect the visual presentation of the control. For example, a push button may be assigned the DEFAULT style, which causes the push button to be drawn with a thick border to indicate that it is the default action.


Note that styles do not take a value. They are either applied (on), or not applied (off).
Some styles apply to all controls. However, each control has its own additional styles (see the table titled Styles Table, in Chapter 5, section 5.1). Each style is described in Chapter 5, "Control Types Reference".

There are also common properties that determine whether a control is displayed (VISIBLE), whether a control will respond to the user (ENABLED), or whether a control has a key letter that the user can use to activate the control with the keyboard (KEY).

4. In addition to the common properties, each control defines its own set of special properties. These special properties give the control a special attribute or capability. Special properties are specified with the "PROPERTY" and "Property-Name" phrases of the "DISPLAY Control-Type" statement (see section 6.4.9, Book 3, "Reference Manual"). For a list of each control's special properties, see the entry for that control type in Chapter 5. See also the table titled Special Properties Table in Chapter 5, Section 5.1.

5. ActiveX controls define their own set of methods. Methods (or object methods) specify the functions that the control provides. They are invoked using the MODIFY verb, and they can take any number of parameters or no parameters. They can also take optional parameters (i.e., parameters that can be omitted). Refer to section 4.5 of this book for more information.

Rather than using a unique syntax to define each control type, ACUCOBOL-GT provides a generic method for specifying a control's characteristics. The programmer then selects the attributes that are applicable to each desired control.


Note that a control's internal behavior may be different with various operating systems. In Windows systems, some configuration file entries have no effect on the control's behavior. On the other hand, in character-based systems, controls are defined using the runtime's configuration file and editing capabilities. For example, the following configuration file entry causes Function Key 7 to erase the contents of an entry field under DOS, but not under Windows:

KEYSTROKE Edit=Erase-field k7