|
FabGL
ESP32 Display Controller and Graphics Library
|
LineEditor is a single-line / multiple-rows editor which uses the Terminal object as input and output. More...
#include <terminal.h>
Public Member Functions | |
| LineEditor (Terminal *terminal) | |
| Object constructor. More... | |
| char const * | edit (int maxLength=0) |
| Reads user input and return the inserted line. More... | |
| char const * | get () |
| Gets current content. More... | |
| void | setInsertMode (bool value) |
| Sets insert mode state. More... | |
| void | setText (char const *text, bool moveCursor=true) |
| Sets initial text. More... | |
| void | setText (char const *text, int length, bool moveCursor=true) |
| Sets initial text specifying length. More... | |
| void | typeText (char const *text) |
| Simulates user typing. More... | |
Public Attributes | |
| Delegate< int * > | onCarriageReturn |
| A delegate called whenever carriage return has been pressed. More... | |
| Delegate< int * > | onChar |
| A delegate called whenever a character has been received. More... | |
| Delegate< int * > | onRead |
| Read character delegate. More... | |
| Delegate< LineEditorSpecialChar > | onSpecialChar |
| A delegate called whenever a special character has been pressed. More... | |
| Delegate< int > | onWrite |
| Write character delegate. More... | |
LineEditor is a single-line / multiple-rows editor which uses the Terminal object as input and output.
The editor supports following control keys:
Example:
Terminal.write("> "); // show prompt
LineEditor ed(&Terminal);
char * txt = ed.get();
Terminal.printf("Your input is: %s\r\n", txt);
Definition at line 2043 of file terminal.h.