Class: Toybox::WatchUi::CheckboxMenuItem

Inherits:
MenuItem show all

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:

  • 3.0.0

Constant Summary

Constants inherited from MenuItem

MenuItem::MENU_ITEM_LABEL_ALIGN_LEFT, MenuItem::MENU_ITEM_LABEL_ALIGN_RIGHT

Instance Method Summary collapse

Methods inherited from MenuItem

getId, getLabel, getSubLabel, setLabel, setSubLabel

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initialize(label, subLabel, identifier, checked, options) ⇒ CheckboxMenuItem

Returns a new instance of CheckboxMenuItem

Parameters:

Options Hash (options):

Since:

  • 3.0.0


14651
14652
# File 'Monkeybrains.rb', line 14651

def initialize(label, subLabel, identifier, checked, options)
end

Instance Method Details

isCheckedToybox::Lang::Boolean

Get a CheckboxMenuItem state.

Returns:

Since:

  • 3.0.0


14664
14665
# File 'Monkeybrains.rb', line 14664

def isChecked()
end

setChecked(checked) ⇒ Object

Set a CheckboxMenuItem state.

Parameters:

  • checked (Toybox::Lang::Boolean)

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

Since:

  • 3.0.0


14658
14659
# File 'Monkeybrains.rb', line 14658

def setChecked(checked)
end