Arduino menU-Ui magic 1.0
Arduino menu user interface library
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
menu Class Reference

#include <menu.h>

Inheritance diagram for menu:
terminalParser

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)
 
- Public Member Functions inherited from terminalParser
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
 
screenMenupantalles [screenMenuMax]
 
- Public Attributes inherited from terminalParser
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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ menu()

menu::menu ( )

constructor has no code

Member Function Documentation

◆ addscreen()

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

Parameters
pantallapointer to menu screen

◆ cr()

void menu::cr ( )
protectedvirtual

inherited from terminalParser. enter

Reimplemented from terminalParser.

◆ cUB()

void menu::cUB ( unsigned int  argc,
int *  argv 
)
protectedvirtual

inherited from terminalParser. cursor backward left handler

Reimplemented from terminalParser.

◆ cUD()

void menu::cUD ( unsigned int  argc,
int *  argv 
)
protectedvirtual

inherited from terminalParser. cursor Up handler

Cursor Down, inherited from terminalParser dragons be here

Reimplemented from terminalParser.

◆ cUF()

void menu::cUF ( unsigned int  argc,
int *  argv 
)
protectedvirtual

inherited from terminalParser. cursor forward right handler

Reimplemented from terminalParser.

◆ cUU()

void menu::cUU ( unsigned int  argc,
int *  argv 
)
protectedvirtual

inherited from terminalParser. cursor Dn handler

Cursor Up, inherited from terminalParser pantalles[activeScreenMenu]->offsetFromTop

Reimplemented from terminalParser.

◆ doBack()

void menu::doBack ( )

sets the display to the previous one

◆ init()

void menu::init ( Stream *  userSerialTerminal)
virtual

kickstart stuff and shows menu, do it at the end os setup(), after addscreen

Reimplemented from terminalParser.

◆ msgPause() [1/2]

void menu::msgPause ( )

shows default text and waits any keypress to continue

◆ msgPause() [2/2]

void menu::msgPause ( const char *  prompt)

shows a text and waits any keypress to continue

◆ msgSmallWait()

void menu::msgSmallWait ( const char *  text)

shows ¿alert? temporary color-inverted text for cliMsgWait milliseconds

◆ msgTxtInputSimple()

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)

Parameters
resultmight not be empty, resulting text will be there

◆ msgYes()

bool menu::msgYes ( const char *  text)

asks yes/no to given text, return true if (y || Y) is press

◆ refresh()

void menu::refresh ( )

to force screen refresh

◆ run()

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

◆ setscreen()

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();

Parameters
pantallaDestiwhere to go

◆ show() [1/2]

void menu::show ( bool  resetCursor = true)

draws menu on screen

Show menu on screen, using userTty object member

Parameters
resetCursormove cursor to starting point

◆ show() [2/2]

void menu::show ( unsigned int  index)
protected

redraws selected menuoption text

refresca la linia

Member Data Documentation

◆ activeScreenMenu

int menu::activeScreenMenu = -1
protected

the actual displayed menu

◆ charTmp

char menu::charTmp
protected

temporal character

◆ nextEscBack

unsigned long menu::nextEscBack = 0
protected

move screen back using esc control

◆ nextRefresh

unsigned long menu::nextRefresh = 0
protected

screen refresh control

◆ pantalles

screenMenu* menu::pantalles[screenMenuMax]

pointers to display menus

◆ runningOption

bool menu::runningOption = false
protected

esta excutant una opcio

◆ screenMenuOptions

unsigned int menu::screenMenuOptions = displayMenuOptionsDefault

menuoptions to be displayed

◆ selectedMenuOption

unsigned int menu::selectedMenuOption
protected

the actual selected menu index option on display

◆ totalScreenMenus

int menu::totalScreenMenus = 0

total amount of displayable/showAble display menus


The documentation for this class was generated from the following files: