Class: Toybox::WatchUi::CustomMenuItem

Inherits:
MenuItem show all

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:

Since:

  • 3.0.0

Constant Summary

Constants inherited from MenuItem

MenuItem::MENU_ITEM_LABEL_ALIGN_LEFT, MenuItem::MENU_ITEM_LABEL_ALIGN_RIGHT

Instance Method Summary collapse

Methods inherited from MenuItem

getId, getLabel, getSubLabel, setLabel, setSubLabel

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initialize(identifier, options) ⇒ CustomMenuItem

Returns a new instance of CustomMenuItem

Parameters:

Options Hash (options):

Raises:

Since:

  • 3.0.0


14692
14693
# File 'Monkeybrains.rb', line 14692

def initialize(identifier, options)
end

Instance Method Details

draw(dc) ⇒ Object

Draw method for a CustomMenuItem.

This is called when a menu item is rendering.

Parameters:

Since:

  • 3.0.0


14726
14727
# File 'Monkeybrains.rb', line 14726

def draw(dc)
end

isFocusedToybox::Lang::Boolean

Get the CustomMenuItem focus state.

Returns:

Since:

  • 3.0.0


14718
14719
# File 'Monkeybrains.rb', line 14718

def isFocused()
end

isSelectedToybox::Lang::Boolean

Get the CustomMenuItem selected state.

Returns:

Since:

  • 3.0.0


14710
14711
# File 'Monkeybrains.rb', line 14710

def isSelected()
end

setDrawable(drawable) ⇒ Object

Set a CustomMenuItem Drawable.

Parameters:

Raises:

Since:

  • 3.0.0


14702
14703
# File 'Monkeybrains.rb', line 14702

def setDrawable(drawable)
end