Class: Toybox.WatchUi.Menu2
- Inherits:
-
Toybox.WatchUi.View
Overview
A representation of an on-screen menu. A Menu2 is a special View, similar to a Toybox::WatchUi::Menu, that presents the user with a list of options. A Menu2 offers more capabilities than a Toybox::WatchUi::Menu, like graphical titles, menu items that can be updated dynamically, and additional menu elements such as check boxes.
After an option is selected, the registered onSelect() method will be called. While a Menu2 can be generated programmatically, they should generally be created as a resource.
A Menu2 is pushed using pushView(), which provides a Menu2InputDelegate as the input delegate.
See Also:
The look and feel of a Menu2 is device-specific.
Direct Known Subclasses
WatchUi.CheckboxMenu, WatchUi.CustomMenu
Instance Method Summary collapse
-
addItem(item as WatchUi.MenuItem) as Void
Add a MenuItem to a Menu2.
-
deleteItem(index as Lang.Number) as Lang.Boolean or Null
Delete a MenuItem from a Menu2.
-
findItemById(identifier as Lang.Object) as Lang.Number
Find a MenuItem by ID in a Menu2.
-
getIcon() as Graphics.BitmapType or WatchUi.Drawable or Null
Get the icon The icon that is used for the subscreen area will be returned If an icon is not been specified, this function will return
null
. -
getItem(index as Lang.Number) as WatchUi.MenuItem or Null
Get a MenuItem from a Menu2.
-
initialize(options as { :title as Lang.String or Lang.Symbol or WatchUi.Drawable, :focus as Lang.Number, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol, :theme as WatchUi.MenuTheme or Null } or Null)
Constructor.
-
setFocus(focus as Lang.Number or Null) as Void
Set the focus of a MenuItem in a Menu2.
-
setIcon(icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol or Null) as Void
Set the icon The specified icon will be displayed in the subscreen area when this Menu2 item is visible.
-
setTheme(theme as WatchUi.MenuTheme or Null) as Void
Set the theme.
-
setTitle(title as Lang.String or Lang.Symbol or WatchUi.Drawable or Null) as Void
Set a Menu2 title.
-
updateItem(item as WatchUi.MenuItem, index as Lang.Number) as Void
Update a MenuItem in a Menu2.
Instance Method Details
addItem(item as WatchUi.MenuItem) as Void
Add a MenuItem to a Menu2.
deleteItem(index as Lang.Number) as Lang.Boolean or Null
Delete a MenuItem from a Menu2.
findItemById(identifier as Lang.Object) as Lang.Number
Find a MenuItem by ID in a Menu2.
getIcon() as Graphics.BitmapType or WatchUi.Drawable or Null
Get the icon
The icon that is used for the subscreen area will be returned
If an icon is not been specified, this function will return null
getItem(index as Lang.Number) as WatchUi.MenuItem or Null
Get a MenuItem from a Menu2.
initialize(options as { :title as Lang.String or Lang.Symbol or WatchUi.Drawable, :focus as Lang.Number, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol, :theme as WatchUi.MenuTheme or Null } or Null)
Constructor
The :icon
option is only used on ConnectIQ 3.4.0 devices with subscreen support.
The :theme
option is only used on ConnectIQ 4.1.8 devices with menu theme support.
setFocus(focus as Lang.Number or Null) as Void
Set the focus of a MenuItem in a Menu2.
setIcon(icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol or Null) as Void
Set the icon
The specified icon will be displayed in the subscreen area when this Menu2 item is visible. If an icon is not been specified, the app icon will be shown instead.
setTheme(theme as WatchUi.MenuTheme or Null) as Void
Set the theme
setTitle(title as Lang.String or Lang.Symbol or WatchUi.Drawable or Null) as Void
Set a Menu2 title.
updateItem(item as WatchUi.MenuItem, index as Lang.Number) as Void
Update a MenuItem in a Menu2.