Class: Toybox.WatchUi.CheckboxMenuItem

Overview

A representation of a check box item in a CheckboxMenu.

A CheckboxMenuItem is a element of a CheckboxMenu View that represents one of the options in the menu, and can appear in one of two states: checked or unchecked. When selected, the state of the CheckboxMenuItem changes to the state opposite of the state prior to the onSelect delegate callback invocation.

A CheckboxMenuItem can be added to a CheckboxMenu using the addItem() method.

See Also:

Since:

API Level 3.0.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

initialize(label as Lang.String or Lang.ResourceId, subLabel as Lang.String or Lang.ResourceId or Null, identifier as Lang.Object or Null, checked as Lang.Boolean, options as { :alignment as MenuItem.Alignment, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId } or Null)

Constructor

Note:

The :icon option is only used on ConnectIQ 3.4.0 devices with subscreen support.

Parameters:

Since:

API Level 3.0.0

isChecked() as Lang.Boolean

Get a CheckboxMenuItem state.

Returns:

  • Lang.Boolean

    The current state of the CheckboxMenuItem

Since:

API Level 3.0.0

setChecked(checked as Lang.Boolean) as Void

Set a CheckboxMenuItem state.

Parameters:

  • checked(Lang.Boolean)

    The intended state of the CheckboxMenuItem; checked if true, unchecked if false

Since:

API Level 3.0.0

Throws:


Generated Jun 26, 2024 1:13:56 PM