Class: Toybox.WatchUi.MenuItem
- Inherits:
-
Toybox.Lang.Object
Overview
See Also:
Direct Known Subclasses
WatchUi.CheckboxMenuItem, WatchUi.CustomMenuItem, WatchUi.IconMenuItem, WatchUi.ToggleMenuItem
Constant Summary
-
Alignment
Name | Value | Since | Description | See Also |
---|---|---|---|---|
MENU_ITEM_LABEL_ALIGN_RIGHT | 0 | API Level 3.0.0 |
Right align a MenuItem label |
|
MENU_ITEM_LABEL_ALIGN_LEFT | 1 | API Level 3.0.0 |
Left align a MenuItem label |
Instance Method Summary collapse
-
getIcon() as Graphics.BitmapType or WatchUi.Drawable or Null
Get the icon Retrieve the icon for this MenuItem.
-
getId() as Lang.Object or Null
Get a MenuItem identifier.
-
getLabel() as Lang.String
Get a MenuItem label.
-
getSubLabel() as Lang.String or Lang.Dictionary<Lang.Symbol, Lang.String or Null> or Null
Get a MenuItem substring label.
-
initialize(label as Lang.String or Lang.ResourceId, subLabel as Lang.String or Lang.ResourceId or Null, identifier as Lang.Object or Null, options as { :alignment as MenuItem.Alignment, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId } or Null)
Constructor.
-
setIcon(icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId or Null) as Void
Set the icon Set the icon displayed in the subscreen area when this MenuItem has the focus.
-
setLabel(label as Lang.String or Lang.ResourceId) as Void
Set a MenuItem label.
-
setSubLabel(subLabel as Lang.String or Lang.ResourceId or Null) as Void
Set a MenuItem substring label.
Instance Method Details
getIcon() as Graphics.BitmapType or WatchUi.Drawable or Null
Get the icon
Retrieve the icon for this MenuItem.
getId() as Lang.Object or Null
Get a MenuItem identifier.
getLabel() as Lang.String
Get a MenuItem label.
getSubLabel() as Lang.String or Lang.Dictionary<Lang.Symbol, Lang.String or Null> or Null
Get a MenuItem substring label.
initialize(label as Lang.String or Lang.ResourceId, subLabel as Lang.String or Lang.ResourceId or Null, identifier as Lang.Object or Null, 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.
setIcon(icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId or Null) as Void
Set the icon
Set the icon displayed in the subscreen area when this MenuItem has the
focus. If the provided icon is null
, the icon from the Menu2 will be
shown instead.
setLabel(label as Lang.String or Lang.ResourceId) as Void
Set a MenuItem label.
setSubLabel(subLabel as Lang.String or Lang.ResourceId or Null) as Void
Set a MenuItem substring label.