FormCheckBox

A check box item. Check boxes are used mainly in two cases. The first case is when a simple yes/no response is required. The second case is when multiple selections from a number options is permitted. In this case each option will be presented by a separate check box.

Example

form = cf.Form.New("Export settings")

    -- Create check boxes
    
checkbox1 = cf.FormCheckBox.New("Export electric near fields.")
checkbox1.Checked = true
checkbox2 = cf.FormCheckBox.New("Export magnetic near fields.")

    -- Add check boxes to 'Form' layout
    
form:Add(checkbox1)
form:Add(checkbox2)

    -- Run the form and retrieve the user input

form:Run()
mustExportEFields = checkbox1.Checked 
mustExportHFields = checkbox2.Checked 

Inheritance

The FormCheckBox object is derived from the FormItem object.

Usage locations

The FormCheckBox object can be accessed from the following locations:

Property List

Checked
The state of the check box. True indicates that the box is checked, false indicates that it is unchecked. (Read/Write boolean)
Enabled
Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents. (Read/Write boolean)
FixedHeight
The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set. (Read/Write number)
FixedWidth
The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set. (Read/Write number)
ItemHeight
The height of the item in pixels. (Read only number)
ItemWidth
The width of the item in pixels. (Read only number)
Label
The label of the push button. (Read/Write string)
MinimumHeight
The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced. (Read/Write number)
MinimumWidth
The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced. (Read/Write number)
Type
The object type string. (Read only string)
Visible
Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents. (Read/Write boolean)

Method List

ClearCallBack ()
Clear the function that will be called when the check box state changes.
SetCallBack (callback function)
Set the function that will be called when the check box state changes.

Constructor Function List

New (label string)
Create a new check box item. The text describing the check box is determined by the specified label. (Returns a FormCheckBox object.)
New ()
Create a new check box item. (Returns a FormCheckBox object.)

Property Details

Checked
The state of the check box. True indicates that the box is checked, false indicates that it is unchecked.
Type
boolean
Access
Read/Write
Enabled
Controls the item enabled state. Setting the enabled state of an item to false will also disable items or their contents.
Type
boolean
Access
Read/Write
FixedHeight
The fixed height of the item in pixels. When the fixed height is set to a positive value, it is the height of the item. Setting the fixed height to zero or a negative value will restore the default/auto setting and the height will be dynamically determined. The fixed height takes precedence over the minimum height and thus the minimum height is ignored when a fixed height is set.
Type
number
Access
Read/Write
FixedWidth
The fixed width of the item in pixels. When the fixed width is set to a positive value, it is the width of the item. Setting the fixed width to zero or a negative value will restore the default/auto setting and the width will be dynamically determined. The fixed width takes precedence over the minimum width and thus the minimum width is ignored when a fixed width is set.
Type
number
Access
Read/Write
ItemHeight
The height of the item in pixels.
Type
number
Access
Read only
ItemWidth
The width of the item in pixels.
Type
number
Access
Read only
Label
The label of the push button.
Type
string
Access
Read/Write
MinimumHeight
The minimum height of the item in pixels. When the height is dynamically determined, it will not be less than the minimum height setting. The minimum height value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum height to zero or a negative value will restore the default/auto setting where no minimum height is enforced.
Type
number
Access
Read/Write
MinimumWidth
The minimum width of the item in pixels. When the width is dynamically determined, it will not be less than the minimum width setting. The minimum width value will only be used when the FixedWidth is not set (restored to the default/auto setting). Setting the minimum width to zero or a negative value will restore the default/auto setting where no minimum width is enforced.
Type
number
Access
Read/Write
Type
The object type string.
Type
string
Access
Read only
Visible
Controls the item visibility. Setting the visibility of an item to false will also hide items or their contents.
Type
boolean
Access
Read/Write

Method Details

ClearCallBack ()
Clear the function that will be called when the check box state changes.
SetCallBack (callback function)
Set the function that will be called when the check box state changes.
Input Parameters
callback(function)
The function call back.

Static Function Details

New (label string)
Create a new check box item. The text describing the check box is determined by the specified label.
Input Parameters
label(string)
The label describing the check box.
Return
FormCheckBox
A check box form item created with the specified label.
New ()
Create a new check box item.
Return
FormCheckBox
A check box form item created with the specified label.