Class: Toybox.WatchUi.ToggleMenuItem
- Inherits:
-
Toybox.WatchUi.MenuItem
Overview
A representation of a toggle item in a Menu2.
A ToggleMenuItem is a element of a Menu2 View that represents one of the options in the menu, and includes an indicator on the menu item that appears in one of two states: enabled or disabled. When selected, the state of the ToggleMenuItem changes to the state opposite of the state prior to the onSelect delegate callback invocation.
A ToggleMenuItem can be added to a Menu2 using the addItem() method.
See Also:
Instance Method Summary collapse
-
getSubLabel() as Lang.String or Lang.Dictionary<Lang.Symbol, Lang.String or Null> or Null
Get a ToggleMenuItem label substring.
-
initialize(label as Lang.String or Lang.ResourceId, subLabel as Lang.String or Lang.ResourceId or { :enabled as Lang.String or Lang.ResourceId or Null, :disabled as Lang.String or Lang.ResourceId or Null } or Null, identifier as Lang.Object or Null, enabled as Lang.Boolean, options as { :alignment as MenuItem.Alignment, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId } or Null)
Constructor.
-
isEnabled() as Lang.Boolean
Get a ToggleMenuItem state.
-
setEnabled(enabled as Lang.Boolean) as Void
Set a ToggleMenuItem state.
-
setSubLabel(subLabel as Lang.String or Lang.ResourceId or { :enabled as Lang.String or Lang.ResourceId or Null, :disabled as Lang.String or Lang.ResourceId or Null } or Null) as Void
Set a ToggleMenuItem label substring.
Instance Method Details
getSubLabel() as Lang.String or Lang.Dictionary<Lang.Symbol, Lang.String or Null> or Null
Get a ToggleMenuItem label substring.
initialize(label as Lang.String or Lang.ResourceId, subLabel as Lang.String or Lang.ResourceId or { :enabled as Lang.String or Lang.ResourceId or Null, :disabled as Lang.String or Lang.ResourceId or Null } or Null, identifier as Lang.Object or Null, enabled as Lang.Boolean, options as { :alignment as MenuItem.Alignment, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId } or Null)
Constructor
The :icon
option is only used on ConnectIQ 3.4.0 devices with subscreen support.
isEnabled() as Lang.Boolean
Get a ToggleMenuItem state.
setEnabled(enabled as Lang.Boolean) as Void
Set a ToggleMenuItem state.
setSubLabel(subLabel as Lang.String or Lang.ResourceId or { :enabled as Lang.String or Lang.ResourceId or Null, :disabled as Lang.String or Lang.ResourceId or Null } or Null) as Void
Set a ToggleMenuItem label substring.