Class: Toybox.WatchUi.Menu2InputDelegate

Overview

Menu2InputDelegate responds to a Menu2 selection.

This class should be extended to handle selected Menu2 items.

See Also:

Example:

using Toybox.WatchUi;
using Toybox.System;

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

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

Since:

API Level 3.0.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

onBack() as Void

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

Since:

API Level 3.0.0

onDone() as Void

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:

API Level 3.0.0

onFooter() as Void

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:

API Level 3.0.0

onSelect(item as WatchUi.MenuItem) as Void

A Menu2 MenuItem was selected.

Parameters:

Since:

API Level 3.0.0

onTitle() as Void

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:

API Level 3.0.0

onWrap(key as WatchUi.Key) as Lang.Boolean

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:

  • key(Lang.Number)

    The key from the WatchUi.KEY_* enumeration that is triggering the menu wrap.

Returns:

Since:

API Level 3.0.0


Generated Apr 17, 2024 9:40:39 AM