Class: Toybox::WatchUi::Menu2InputDelegate

Inherits:
Lang::Object show all

Overview

Menu2InputDelegate responds to a Menu2 selection.

This class should be extended to handle selected Menu2 items.

Examples:

using Toybox.WatchUi;
using Toybox.System;

class MyMenu2InputDelegate extends WatchUi.Menu2InputDelegate {
    function initialize() {
        Menu2InputDelegate.initialize();
    }

    function onSelect(item) {
        System.println(item.getId());
    }
}

See Also:

Since:

  • 3.0.0

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Method Details

onBackObject

A Menu2 Back key was pressed. If this method is not overridden, it will pop the active view.

Since:

  • 3.0.0


13498
13499
# File 'Monkeybrains.rb', line 13498

def onBack()
end

onDoneObject

A Menu2 Done item was selected. This method is only triggered by a CheckboxMenu If this method is not overridden, it will pop the active view.

Since:

  • 3.0.0


13506
13507
# File 'Monkeybrains.rb', line 13506

def onDone()
end

onFooterObject

A CustomMenu footer was selected.

This method is triggered on products with touch input when the user selects the footer area of a CustomMenu. This method is only triggered by a CustomMenu.

Since:

  • 3.0.0


13538
13539
# File 'Monkeybrains.rb', line 13538

def onFooter()
end

onSelect(item) ⇒ Object

A Menu2 MenuItem was selected.

Parameters:

Since:

  • 3.0.0


13492
13493
# File 'Monkeybrains.rb', line 13492

def onSelect(item)
end

onTitleObject

A CustomMenu title was selected.

This method is triggered on products with touch input when the user selects the title area of a CustomMenu. This method is only triggered by a CustomMenu.

Since:

  • 3.0.0


13529
13530
# File 'Monkeybrains.rb', line 13529

def onTitle()
end

onWrap(key) ⇒ Object

A Menu2 is preparing to wrap.

This method is triggered on button-based products when the user attempts to navigate off the end of a menu. If this method returns false the list will not wrap to the opposite end. If this method is not overridden, it will return true and allow the menu to wrap.

Parameters:

Since:

  • 3.0.0


13520
13521
# File 'Monkeybrains.rb', line 13520

def onWrap(key)
end