class checkBox

superclass(es) control
subclass(es) -
description The checkbox control is a simple control which the user can select or unselect. It is also possible that a checkbox can be in a third state but this is only possible if the checkbox was created using the method createThreeState/7.

pl_img51.gif (1836 bytes)
see also panel - radioButton

tasks

A two state checkbox is created by the method create/7 and a three state checkbox is created by the method createThreeState/7. A normal checkbox has two states; checked or unchecked, a three-state checkbox adds to these states the grayed state (also called the undeterminate state). The methods putGray/1 and grayed/1 only work if the checbox is a threestate checkbox.
To determine if a checkbox has been checked the method checked/1 must be used, it assigns true to it's argument if the control has been checked..

methods

create(Parent, Checked, X, Y, Width, Height, Output)

func Create a checkbox control at a specified position with the specified dimensions. Because a control is a child window a parent window must always be specified. If the variable Checked contains true the checkbox is initially checked, else not. The coordinates X, Y, Width and Height determine the dimensions, in window coordinates, of the control.
pre The variable Parent must refer to a parent window. The Checked variable must contain true or false, the X, Y, Width and Height coordinates must specify a position and dimension for the control.
post If the control was successfully created then true is assigned to Output, else it will contain false.

createThreeState(Parent, State, X, Y, Width, Height, Output)

func Create a checkbox control that can have three states, at a specified position with the specified dimensions. Because a button is a child window a parent window must always be specified. The variable State must contain one of the following three atoms: 'checked', 'unchecked' or 'grayed'. The coordinates X, Y, Width and Height determine the dimensions , in window coordinates, of the control.
pre The variable Parent must refer to a parent window. The State variable must 'unchecked', 'checked' or 'grayed', the X, Y, Width and Height coordinates must specify a position and dimensions for the control.
post If the control was successfully created then true is assigned to Output, else it will contain false.

putCheck(YesNo)

func Add or remove the checkmark of the checkbox control.
pre The variable YesNo must contain true or false.
post If YesNo contains true the checkbox now displays a checkmark, else it does not display a checkmark.

checked(Output)

func Determine if the checkbox is checked or not.
pre TRUE.
post If YesNo contains true the checkbox is checked, else Output contains false.

threeState(Output)

func Determine if the checkbox is a three state checkbox.
pre TRUE.
post If YesNo contains true the checkbox is a three state checkbox, else Output contains false.

putGray

func Put a three state checkbox into the grayed state.
pre TRUE.
post The checkbox displays a grayed checkmark.

grayed(Output)

func Determine if the checkbox is in the grayed state.
pre TRUE.
post If YesNo contains true the checkbox is grayed, else Output contains false.