Class: Toybox::WatchUi::TextPickerDelegate

Inherits:
Lang::Object show all

Overview

TextPickerDelegate responds to a TextPicker selection.

This class should be extended to handle the specified text.

Examples:

using Toybox.WatchUi;

// A string to display on the screen
var screenMessage = "Press Menu to Enter Text";
var lastText = "";

class MyTextPickerDelegate extends WatchUi.TextPickerDelegate {

    function initialize() {
        TextPickerDelegate.initialize();
    }

    function onTextEntered(text, changed) {
        screenMessage = text + "\n" + "Changed: " + changed;
        lastText = text;
    }

    function onCancel() {
        screenMessage = "Canceled";
    }
}

See Also:

Since:

  • 1.1.0

Supported Devices:

  • All devices except Approach S60 / vivoactive / vivoactive HR / Edge 130

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Method Details

onCancelObject

Text entry has been canceled.

Since:

  • 1.1.0


13934
13935
# File 'Monkeybrains.rb', line 13934

def onCancel()
end

onTextEntered(text, changed) ⇒ Object

A text string was entered into a TextPicker.

This method is called when text has been specified by a TextPicker, and receives the text String as an argument.

Parameters:

Since:

  • 1.1.0


13929
13930
# File 'Monkeybrains.rb', line 13929

def onTextEntered(text, changed)
end