Class: Toybox.WatchUi.CustomMenuItem
- Inherits:
-
Toybox.WatchUi.MenuItem
Overview
A representation of a custom item in a CustomMenu.
A CustomMenuItem is a element of a CustomMenu View that represents one of the items in the menu. When selected, the onSelect() delegate callback will be invoked. The selected state of the item may change when it is being selected. This state can be evaluated using the isSelected() method and can be used to control the look of a selected item.
A CustomMenuItem can be added to a CustomMenu using the addItem() method.
See Also:
Instance Method Summary collapse
-
draw(dc as Graphics.Dc) as Void
Draw method for a CustomMenuItem.
-
getDividerIcon() as Graphics.BitmapType or WatchUi.Drawable or Null
Get the divider icon.
-
initialize(identifier as Lang.Object or Null, options as { :alignment as MenuItem.Alignment, :drawable as WatchUi.Drawable, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId, :dividerIcon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId })
Constructor.
-
isFocused() as Lang.Boolean
Get the CustomMenuItem focus state.
-
isSelected() as Lang.Boolean
Get the CustomMenuItem selected state.
-
setDividerIcon(icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId or Null) as Void
Set or change the menu icon.
-
setDrawable(drawable as WatchUi.Drawable or Null) as Void
Set a CustomMenuItem Drawable.
Instance Method Details
draw(dc as Graphics.Dc) as Void
Draw method for a CustomMenuItem.
This is called when a menu item is rendering.
getDividerIcon() as Graphics.BitmapType or WatchUi.Drawable or Null
Get the divider icon.
initialize(identifier as Lang.Object or Null, options as { :alignment as MenuItem.Alignment, :drawable as WatchUi.Drawable, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId, :dividerIcon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId })
Constructor
The :icon
option is only used on ConnectIQ 3.4.0 devices with subscreen support.
isFocused() as Lang.Boolean
Get the CustomMenuItem focus state.
isSelected() as Lang.Boolean
Get the CustomMenuItem selected state.
setDividerIcon(icon as Graphics.BitmapType or WatchUi.Drawable or Lang.ResourceId or Null) as Void
Set or change the menu icon.
If device support Menu2.DividerType and
parent menu is set to DIVIDER_TYPE_ICON,
icon
(if not +null+) will be rendered on the left side of the divider.
setDrawable(drawable as WatchUi.Drawable or Null) as Void
Set a CustomMenuItem Drawable.