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


13318
13319
# File 'Monkeybrains.rb', line 13318

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


13352
13353
# File 'Monkeybrains.rb', line 13352

def draw(dc)
end

isFocusedToybox::Lang::Boolean

Get the CustomMenuItem focus state.

Returns:

Since:

  • 3.0.0


13344
13345
# File 'Monkeybrains.rb', line 13344

def isFocused()
end

isSelectedToybox::Lang::Boolean

Get the CustomMenuItem selected state.

Returns:

Since:

  • 3.0.0


13336
13337
# File 'Monkeybrains.rb', line 13336

def isSelected()
end

setDrawable(drawable) ⇒ Object

Set a CustomMenuItem Drawable.

Parameters:

Raises:

Since:

  • 3.0.0


13328
13329
# File 'Monkeybrains.rb', line 13328

def setDrawable(drawable)
end