Library which creates a serial test console, it supports pages and menu items. The items are added and the pages are added as necessary when the user sets it up. This is a great too for creating an easy to maintain menu system, whether for a test sytem, or anything else.

Dependencies:   Terminal

menuitem.cpp

Committer:
glansberry
Date:
2015-07-24
Revision:
9:b1fdd7ea6f72
Parent:
6:e992366d0684

File content as of revision 9:b1fdd7ea6f72:

#include "menuitem.h"
#include "page.h"


MenuItem::MenuItem() :
    name(NULL),
    level(0),
    type(display),
    action(NULL),
    name_len(0),
    data_col(0),
    target_page(-1)
{}


MenuItem::MenuItem(const char * name_p, MenuAction *action_p,  int level_p, MenuType type_p, int target_page_p):
    name(name_p),
    level(level_p),
    type(type_p),
    action(action_p),
    name_len(strlen(name_p)),
    data_col(0),
    target_page(target_page_p)
{}

MenuItem::MenuItem(Page &target_page_p):
    name(target_page_p.name),
    level(0),
    type(menu),
    action(NULL),
    name_len(strlen(name)),
    data_col(0),
    target_page(target_page_p.page_num)
{}