Class: $.CheckBox

Inherits:
WatchUi.Selectable show all

Overview

Implementation of a CheckBox using Selectable, with the following rules:

  1. A CheckBox is "checked" if selected

  2. A CheckBox is only "unchecked" if selected again

  3. Only one CheckBox may be highlighted at a time

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var stateHighlightedSelected as WatchUi.Bitmap or Null

Default state Drawable or color/number

Instance Method Details

highlight(previousState as Lang.Symbol) as Void

Handle onSelectable() returning stateHighlighted

Parameters:

  • previousState —

    The previous check box state

initialize(options as { :locX as Lang.Number, :locY as Lang.Number, :width as Lang.Number, :height as Lang.Number, :stateDefault as Graphics.ColorType or WatchUi.Drawable, :stateHighlighted as Graphics.ColorType or WatchUi.Drawable, :stateSelected as Graphics.ColorType or WatchUi.Drawable, :stateDisabled as Graphics.ColorType or WatchUi.Drawable, :stateHighlightedSelected as WatchUi.Bitmap })

Constructor

Parameters:

  • options —

    A Dictionary of check box options

    • :locX —

      The x-coordinate for the check box

    • :locY —

      The y-coordinate for the check box

    • :width —

      The clip width of the check box

    • :height —

      The clip height of the check box

    • :stateDefault —

      The Drawable or color to display in default state

    • :stateHighlighted —

      The Drawable or color to display in highlighted state

    • :stateSelected —

      The Drawable or color to display in selected state

    • :stateDisabled —

      The Drawable or color to display in disabled state

    • :stateHighlightedSelected —

      The Drawable or color to display in the selected and highlighted state

reset(previousState as Lang.Symbol) as Void

Handle onSelectable() returning stateDefault

Parameters:

  • previousState —

    The previous check box state

select(previousState as Lang.Symbol) as Void

Handle onSelectable() returning stateSelected

Parameters:

  • previousState —

    The previous check box state

unHighlight() as Void

Handle unhighlighting of a check box


Generated Oct 20, 2026, 8:21:01 AM