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


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

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


14753
14754
# File 'Monkeybrains.rb', line 14753

def draw(dc)
end

isFocusedToybox::Lang::Boolean

Get the CustomMenuItem focus state.

Returns:

Since:

  • 3.0.0


14745
14746
# File 'Monkeybrains.rb', line 14745

def isFocused()
end

isSelectedToybox::Lang::Boolean

Get the CustomMenuItem selected state.

Returns:

Since:

  • 3.0.0


14737
14738
# File 'Monkeybrains.rb', line 14737

def isSelected()
end

setDrawable(drawable) ⇒ Object

Set a CustomMenuItem Drawable.

Parameters:

Raises:

Since:

  • 3.0.0


14729
14730
# File 'Monkeybrains.rb', line 14729

def setDrawable(drawable)
end