Class: Toybox.WatchUi.CustomMenu
- Inherits:
-
Toybox.WatchUi.Menu2
Overview
A representation of a custom menu.
A CustomMenu is a specialized Menu2 View that presents the user with a list of custom rendered options. After an option is selected, the registered onSelect() method will be called.
A CustomMenu is pushed using pushView(), which provides a Menu2InputDelegate as the input delegate.
See Also:
Instance Method Summary collapse
-
addItem(item as WatchUi.CustomMenuItem) as Void
Add a CustomMenuItem to a CustomMenu.
-
drawFooter(dc as Graphics.Dc) as Void
Draw the CustomMenu footer.
-
drawForeground(dc as Graphics.Dc) as Void
Draw the CustomMenu foreground.
-
drawTitle(dc as Graphics.Dc) as Void
Draw the CustomMenu title.
-
initialize(itemHeight as Lang.Number, backgroundColor as Graphics.ColorType, options as { :focus as Lang.Number, :focusItemHeight as Lang.Number or Null, :title as WatchUi.Drawable, :footer as WatchUi.Drawable, :foreground as WatchUi.Drawable, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol, :titleItemHeight as Lang.Number or Null, :footerItemHeight as Lang.Number or Null } or Null)
Constructor.
-
setBackgroundColor(color as Graphics.ColorType) as Void
Set the background color.
-
setFooter(drawable as WatchUi.Drawable) as Void
Set the footer drawable.
-
setForeground(drawable as WatchUi.Drawable) as Void
Set the foreground drawable.
-
setTitle(drawable as WatchUi.Drawable or Null) as Void
Set the title drawable.
Instance Method Details
addItem(item as WatchUi.CustomMenuItem) as Void
Add a CustomMenuItem to a CustomMenu.
drawFooter(dc as Graphics.Dc) as Void
Draw the CustomMenu footer.
This is called to render the menu footer region.
drawForeground(dc as Graphics.Dc) as Void
Draw the CustomMenu foreground.
This is called after a menu's items and title have been rendered. It can be used to draw overlay content for the menu.
drawTitle(dc as Graphics.Dc) as Void
Draw the CustomMenu title.
This is called to render the menu title region.
initialize(itemHeight as Lang.Number, backgroundColor as Graphics.ColorType, options as { :focus as Lang.Number, :focusItemHeight as Lang.Number or Null, :title as WatchUi.Drawable, :footer as WatchUi.Drawable, :foreground as WatchUi.Drawable, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol, :titleItemHeight as Lang.Number or Null, :footerItemHeight as Lang.Number or Null } or Null)
Constructor
The options :titleItemHeight
and :footerItemHeight
are only supported with ConnectIQ 4.0.0 and later.
The :icon
option is only used on ConnectIQ 3.4.0 devices with subscreen support. background color will not be used if themes are supported and the theme is non-null.
setBackgroundColor(color as Graphics.ColorType) as Void
Set the background color.
setFooter(drawable as WatchUi.Drawable) as Void
Set the footer drawable.
setForeground(drawable as WatchUi.Drawable) as Void
Set the foreground drawable.
setTitle(drawable as WatchUi.Drawable or Null) as Void
Set the title drawable.