Skip to content

Checkbox

A checkbox is a GUI widget that allows the user to make a binary choice, i.e. a choice between one of two possible mutually exclusive options. For example, the user may have to answer 'yes' (checked) or 'no' (not checked) on a simple yes/no question.

Often, a series of checkboxes are presented, each representing different options. Then the user may select several of the choices.

The difference between a Radio button and a checkbox is that a checkbox allows the user to select multiple options from a set, while a Radio Button allows the user to select only one option from a set.

Properties

Background Color

( Getter + Setter )
Type: Color

The background color with which the text of the Checkbox is shown.

Checkbox Color

( Getter + Setter )
Type: Color

The color of the checkbox displayed. This determines only the color of the checkbox and not its text. See Text Color for the color of the text.

Checked

( Getter + Setter )
Type: Boolean

Determines whether the Checkbox is checked or not. true if checked, false otherwise.

Enabled

( Getter + Setter )
Type: Boolean

Determines whether the Checkbox is enabled or not. A disabled component does not execute any of the Events. It does not respond to any interactions with it by the user.

Options
true The Checkbox is enabled and will execute Events when they occur.
false The Checkbox is disabled and will not execute Events when they occur.

Text

( Getter + Setter )
Type: Text

The text displayed for the Checkbox.

Text Alignment

( Setter only | Designer)
Type: Number

The alignment of the Text displayed for the Checkbox.

Options
0. Left The Checkbox text is aligned to the left.
1. Center The Checkbox text is centered.
2. Right The Checkbox text is aligned to the right.

Text Color

( Getter + Setter )
Type: Color

The color of the Text displayed for the Checkbox.

Height

( Getter + Setter )
Type: Number

The height with which the Checkbox is displayed.

Height Percent

( Setter Only )
Type: Number

The height with which the Checkbox is displayed in terms of precentage of the whole screen height.

Width

( Getter + Setter )
Type: Number

The width with which the Checkbox is displayed.

Width Percent

( Setter Only )
Type: Number

The width with which the Checkbox is displayed in terms of precentage of the whole screen width.

Visible

( Getter + Setter )
Type: Boolean

Determines whether the Checkbox is visible on the screen and shown to the user or not.

Options
true The Checkbox is shown to the user.
false The Checkbox is not shown to the user.

Methods

Set Shadow

( Number x, Number y, Number radius, Color color )

Adds a shadow to the checkbox.

Params
x Number: The x-displacement of the shadow.
y Number: The y-displacement of the shadow.
radius Number: The radius of the shadow.
color Color: The color of the shadow.

Events

Changed

( None )

Indicates that the user has checked or unchecked the Checkbox. Use the Getter block of Checked property inside this Event's block to know the current status.

Got Focus

( None )

Indicates the has been cursor moved over the Checkbox so it is now possible to click it.

Lost Focus

( None )

Indicates the cursor moved away from the Checkbox so it is now no longer possible to click it.