CheckBox Component


Properties

backgroundColor
  Specifies the background color of the CheckBox as an red-green-blue-alpha RRGGBBAA or red-green-blue RRGGBB string.
Data type: color
Designer Writable true <checkbox name="checkboxName" backgroundColor="FFd9239f">
Code Writeable true checkboxName.backgroundColor = "FFd9239f"
Code Readable true let variable = checkboxName.backgroundColor

checked
  Set to true if the box is checked, false otherwise.
Data type: boolean
Designer Writable true <checkbox name="checkboxName" checked="true">
Code Writeable true checkboxName.checked = true
Code Readable true let variable = checkboxName.checked

enabled
  Specifies whether the CheckBox should be active and clickable.
Data type: boolean
Designer Writable true <checkbox name="checkboxName" enabled="true">
Code Writeable true checkboxName.enabled = true
Code Readable true let variable = checkboxName.enabled

fontBold
  Specifies whether the text of the CheckBox should be bold. Some fonts do not support bold.
Data type: boolean
Designer Writable true <checkbox name="checkboxName" fontBold="true">
Code Writeable false
Code Readable false

fontItalic
  Specifies whether the text of the CheckBox should be italic. Some fonts do not support italic.
Data type: boolean
Designer Writable true <checkbox name="checkboxName" fontItalic="true">
Code Writeable false
Code Readable false

fontSize
  Specifies the text font size of the CheckBox, measured in sp(scale-independent pixels).
Data type: number
Designer Writable true <checkbox name="checkboxName" fontSize="24">
Code Writeable true checkboxName.fontSize = 24
Code Readable true let variable = checkboxName.fontSize

fontTypeface
  Specifies the text font face of the CheckBox as 'serif', 'sans serif', or 'monospace'.
Data type: number
Designer Writable true <checkbox name="checkboxName" fontTypeface="monospace">
Code Writeable false
Code Readable false

height
  Specifies the CheckBox's vertical height, measured in pixels.
Data type: number
Designer Writable false
Code Writeable true checkboxName.height = 48
Code Readable true let variable = checkboxName.height

heightPercent
  Specifies the CheckBox's vertical height as a percentage of the Screen's Height.
Data type: number
Designer Writable false
Code Writeable true checkboxName.heightPercent = "25%"
Code Readable false

text
  Specifies the text displayed by the CheckBox.
Data type: string
Designer Writable true <checkbox name="checkboxName" text="Test text">
Code Writeable true checkboxName.text = "Test text"
Code Readable true let variable = checkboxName.text

textColor
  Specifies the text color of the CheckBox as an red-green-blue-alpha RRGGBBAA or red-green-blue RRGGBB string.
Data type: color
Designer Writable true <checkbox name="checkboxName" textColor="FF6ce0f7">
Code Writeable true checkboxName.textColor = "FF6ce0f7"
Code Readable true let variable = checkboxName.textColor

visible
  Specifies whether the CheckBox should be visible on the screen. Value is true if the CheckBox is showing and false if hidden.
Data type: boolean
Designer Writable true <checkbox name="checkboxName" visible="true">
Code Writeable true checkboxName.visible = true
Code Readable true let variable = checkboxName.visible

width
  Specifies the horizontal width of the CheckBox, measured in pixels.
Data type: number
Designer Writable false
Code Writeable true checkboxName.width = 155
Code Readable true let variable = checkboxName.width

widthPercent
  Specifies the horizontal width of the CheckBox as a percentage of the Screen's Width.
Data type: number
Designer Writable false
Code Writeable true checkboxName.widthPercent = "36%"
Code Readable false

class
  The styling class of the the component
Data type: string
Designer Writable true <checkbox name="checkboxName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <checkbox name="checkboxName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <checkbox name="checkboxName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
changed User tapped and released the CheckBox.
checkboxName.addEventListener(
    "changed",
    function () {
        //Your code here
    }
)
gotFocus CheckBox became the focused component.
checkboxName.addEventListener(
    "gotFocus",
    function () {
        //Your code here
    }
)
lostFocus CheckBox stopped being the focused component.
checkboxName.addEventListener(
    "lostFocus",
    function () {
        //Your code here
    }
)