Class defining and handling one menu tree. More...
#include <menu.h>
Classes | |
struct | arg |
struct | command |
Public Types | |
typedef int8_t(* | func )(uint8_t argc, const struct arg *argv) |
typedef bool(* | preprompt )(void) |
Public Member Functions | |
Menu (const char *prompt, const struct command *commands, uint8_t entries, preprompt ppfunc=0) | |
void | run (void) |
menu runner |
Class defining and handling one menu tree.
Definition at line 24 of file menu.h.
typedef int8_t(* Menu::func)(uint8_t argc, const struct arg *argv) |
menu command function
Functions called by menu array entries are expected to be of this type.
argc | The number of valid arguments, including the name of the command in argv[0]. Will never be more than MENU_ARGS_MAX. | |
argv | Pointer to an array of Menu::arg structures detailing any optional arguments given to the command. argv[0] is always the name of the command, so that the same function can be used to handle more than one command. |
typedef bool(* Menu::preprompt)(void) |
Menu::Menu | ( | const char * | prompt, | |
const struct command * | commands, | |||
uint8_t | entries, | |||
preprompt | ppfunc = 0 | |||
) |
constructor
Note that you should normally not call the constructor directly. Use the MENU and MENU2 macros defined below.
prompt | The prompt to be displayed with this menu. | |
commands | An array of command structures in program memory (PROGMEM). | |
entries | The number of entries in the menu. |