Arduino menU-Ui magic 1.0
Arduino menu user interface library
|
#include <menu.h>
Public Member Functions | |
menu () | |
virtual void | init (Stream *userSerialTerminal) |
void | addscreen (screenMenu *pantalla) |
void | run () |
Parses the userTty, check user interaction or display query. More... | |
bool | msgTxtInputSimple (const char *prompt, char *result, unsigned int maxLength, unsigned int minLength=0) |
void | msgSmallWait (const char *text) |
void | msgPause (const char *prompt) |
bool | msgYes (const char *text) |
void | msgPause () |
void | setscreen (int targetScreenMenu, bool setWhereICame=true) |
void | refresh () |
void | doBack () |
void | show (bool resetCursor=true) |
![]() | |
virtual void | doClearScreen () |
virtual void | doMoveCursor (int line, int column) |
virtual void | doCUU (unsigned int amount=1) |
virtual void | doCUD (unsigned int amount=1) |
virtual void | doCUF (unsigned int amount=1) |
virtual void | doCUB (unsigned int amount=1) |
virtual void | doEL (bool wholeLine=true) |
virtual void | doHideCursor (bool hide=true) |
void | invertColors (char *entrada, unsigned int allargadaMax) |
void | invertColors (String *cadena) |
virtual void | init (Stream *pantalla) |
bool | doGuess (char caracter) |
virtual void | tab () |
virtual void | lf () |
virtual void | cr () |
virtual void | backSpace () |
virtual void | beep () |
virtual void | del () |
virtual void | insert (bool setDisplayInsert=false) |
virtual void | start () |
virtual void | end () |
virtual void | avPg () |
virtual void | rePg () |
virtual void | cHA (unsigned int argc, int *argv) |
virtual void | cUU (unsigned int argc, int *argv) |
virtual void | cUD (unsigned int argc, int *argv) |
virtual void | cUF (unsigned int argc, int *argv) |
virtual void | cUB (unsigned int argc, int *argv) |
virtual void | eL (unsigned int argc, int *argv) |
virtual void | sGR (unsigned int argc, int *argv) |
virtual void | dSR (unsigned int argc, int *argv) |
virtual void | rM (unsigned int argc, int *argv) |
virtual void | sM (unsigned int argc, int *argv) |
virtual void | dA (unsigned int argc, int *argv) |
virtual void | cUP (unsigned int argc, int *argv) |
virtual void | eD (unsigned int argc, int *argv) |
virtual void | vPA (unsigned int argc, int *argv) |
virtual void | dCH (unsigned int argc, int *argv) |
Public Attributes | |
int | totalScreenMenus = 0 |
unsigned int | screenMenuOptions = displayMenuOptionsDefault |
screenMenu * | pantalles [screenMenuMax] |
![]() | |
Stream * | userTty |
Protected Member Functions | |
void | show (unsigned int index) |
virtual void | cUU (unsigned int argc, int *argv) |
virtual void | cUD (unsigned int argc, int *argv) |
virtual void | cUF (unsigned int argc, int *argv) |
virtual void | cUB (unsigned int argc, int *argv) |
virtual void | cr () |
Protected Attributes | |
char | charTmp |
unsigned int | selectedMenuOption |
unsigned long | nextEscBack = 0 |
unsigned long | nextRefresh = 0 |
bool | runningOption = false |
int | activeScreenMenu = -1 |
The menu main container
contains the screenMenu display screens, add it via addscreen works on a Stream which shows a console VT100/ANSI terminal style inherits terminalParser to parse keystrokes
menu::menu | ( | ) |
constructor has no code
void menu::addscreen | ( | screenMenu * | pantalla | ) |
adds a screen, change it using changeScreenMenuOption or setscreen do it after screenMenu.addMenuOption
Add available menu screen to the array
pantalla | pointer to menu screen |
|
protectedvirtual |
inherited from terminalParser. enter
Reimplemented from terminalParser.
|
protectedvirtual |
inherited from terminalParser. cursor backward left handler
Reimplemented from terminalParser.
|
protectedvirtual |
inherited from terminalParser. cursor Up handler
Cursor Down, inherited from terminalParser dragons be here
Reimplemented from terminalParser.
|
protectedvirtual |
inherited from terminalParser. cursor forward right handler
Reimplemented from terminalParser.
|
protectedvirtual |
inherited from terminalParser. cursor Dn handler
Cursor Up, inherited from terminalParser pantalles[activeScreenMenu]->offsetFromTop
Reimplemented from terminalParser.
void menu::doBack | ( | ) |
sets the display to the previous one
|
virtual |
kickstart stuff and shows menu, do it at the end os setup(), after addscreen
Reimplemented from terminalParser.
void menu::msgPause | ( | ) |
shows default text and waits any keypress to continue
void menu::msgPause | ( | const char * | prompt | ) |
shows a text and waits any keypress to continue
void menu::msgSmallWait | ( | const char * | text | ) |
shows ¿alert? temporary color-inverted text for cliMsgWait milliseconds
bool menu::msgTxtInputSimple | ( | const char * | prompt, |
char * | result, | ||
unsigned int | maxLength, | ||
unsigned int | minLength = 0 |
||
) |
simple text prompt, allows (a-Z) && (A-Z) && (0-9)
result | might not be empty, resulting text will be there |
bool menu::msgYes | ( | const char * | text | ) |
asks yes/no to given text, return true if (y || Y) is press
void menu::refresh | ( | ) |
to force screen refresh
void menu::run | ( | ) |
Parses the userTty, check user interaction or display query.
to be called at loop()... AOAP As Often As Possible, not to abuse reception buffer
void menu::setscreen | ( | int | pantallaDesti, |
bool | setWhereICame = true |
||
) |
change the showing screen
Gracefully switch menu screen si ve des de un run no cal qua faci show();
pantallaDesti | where to go |
void menu::show | ( | bool | resetCursor = true | ) |
draws menu on screen
Show menu on screen, using userTty object member
resetCursor | move cursor to starting point |
|
protected |
redraws selected menuoption text
refresca la linia
|
protected |
the actual displayed menu
|
protected |
temporal character
|
protected |
move screen back using esc control
|
protected |
screen refresh control
screenMenu* menu::pantalles[screenMenuMax] |
pointers to display menus
|
protected |
esta excutant una opcio
unsigned int menu::screenMenuOptions = displayMenuOptionsDefault |
menuoptions to be displayed
|
protected |
the actual selected menu index option on display
int menu::totalScreenMenus = 0 |
total amount of displayable/showAble display menus