Checkbox Control

Checkboxes are the Windows GUI equivalent of yes/no questions.

Typically several checkboxes are presented as a group, either within a groupbox, or in a dialog as in this example below:

xtra3dlg

When the group of checkboxes has no other input fields which require real-time support by the application, the easiest way to implement them may be to just display them, then use the EVENTWAIT class to wait for a button action (Apply or Cancel in the above dialog), then query the buttons to see which ones are checked. In the Windows environment, you do not even need to query them, since one of the parameters passed to AUI CONTROL to create the checkbox is the actual variable which gets updated automatically as the box is checked/unchecked. But in the ATE environment, direct linkage between the checkbox on the screen and the control variable is not possible, so the technique of querying the checkboxes is more universal. See the following topic for sample code showing how to create a query a group of checkboxes like is shown above.

The other way to manage checkboxes is INFLD, which makes them act like yes/no fields from the point of view of the application. To turn an existing INFLD yes/no field into a checkbox, just add the TYPE code ||c. In this case, you will need to process exitcodes like for any other field in order to allow the user to move up and down or among the fields.

Note that although INFLD does a reasonable job of hiding the idiosyncrasies of checkboxes from the application (making them act like yes/no fields), it is hard to overlook the fact that unlike other field types, with a checkbox, the label or prompt is actually part of the control, so you need to specify it to INFLD if you want it to create the checkbox with the text. To do so, put the label text in the setdef parameter, and you must set the field width to accommodate the text plus the checkbox. However, as a convenience to programs that are used to displaying the field prompts in one operation, and editing the fields in another, when INFLD is given a standard one-character-wide yes/no setup with the ||c option added, it will scan the existing controls to see if this matches the left or right edge of an existing checkbox, and if so, uses the existing one rather than creating a new one. This allows you to create the checkboxes as part of your screen layout operation, but then edit them as if they were simply yes/no fields.