Overview of Graphical Controls

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). See Control Types Handles and IDs for a list of control types.
  2. Each control has a handle that uniquely distinguishes the control. Handles are also discussed in the Control Types Handles and IDs.
  3. Each control has a set of common properties defined for it. These common properties are described in Common Screen Options.

    Common properties that apply to virtually all controls include:

    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.
    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. Controls can also be given minimum and maximum size specifications. This is useful if you want to change the size of a control when the window changes size. Layout managers frequently use this information. See Layout Managers for more information.
    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.
    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.
    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.
    font Most controls have a font that is used when text is displayed in conjunction with the control.
    event lists For any control that generates events, you can create an event list that specifies for that control the types of events that must be received or filtered out.
    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: 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. Each style is described in Control Types Reference.

    Certain Operating System styles or themes have an effect on the appearance of controls. For details on how ACUCOBOL-GT applications behave when certain styles are in effect, see Visual Styles and Differences Among Operating Systems.

    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 Common Screen Options in the ACUCOBOL-GT Reference Manual for more informtion. For a list of each control's special properties, see Control Types Reference.
  5. ActiveX and .NET 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. ActiveX controls can also take optional parameters (that is, parameters that can be omitted). For more information, see Methods.

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.