- #ifndef MenuItem_h
- #define MenuItem_h
-
- #include "Arduino.h"
-
- class MenuItem {
- public:
- MenuItem();
- MenuItem(const char* name);
- const char* name;
- MenuItem* parent;
- MenuItem* next;
- MenuItem* goBack();
- MenuItem* goDown();
- MenuItem* goRight();
- String display();
- // void addChild(MenuItem* c) {
- // if (!child) child = c;
- // c->parent = this;
- // }
- };
-
- class BranchMenuItem: public MenuItem {
- public:
- using MenuItem::MenuItem;
- BranchMenuItem(const char* name, const MenuItem* child);
- MenuItem* child;
- MenuItem* goRight();
- String display();
- };
-
- class IntValueItem: public MenuItem {
- public:
- IntValueItem(const char* name, const int initialValue);
- int value;
- MenuItem* IntValueItem::goRight();
- String IntValueItem::display();
- };
-
- class BoolValueItem: public MenuItem {
- public:
- BoolValueItem(const char* name, const bool initialValue);
- bool value;
- MenuItem* BoolValueItem::goRight();
- String BoolValueItem::display();
- };
-
- #endif