forked from DCC-EX/CommandStation-EX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenuobject.h
62 lines (52 loc) · 1.46 KB
/
menuobject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* La Box Project
* menu Classes
*
* Base class of the menu library.
* It allows recursively to select entries from lists and to chain menus.
* The up and down button allows you to scroll through the choices and the select button validates the choice.
*
* @Author : Cedric Bellec
* @Organization : Locoduino.org
*/
#ifndef MENUOBJECT
#define MENUOBJECT
#ifdef USE_HMI
#include "hmiConfig.h"
#define nbMaxSubmenu 15
class Adafruit_SSD1306;
class menuObject
{
public:
//----- Members
menuObject* parent;
menuObject* subMenu[nbMaxSubmenu];
menuObject* selectedMenu ;
int nbSubMenu ;
int value ;
bool exitAsk;
int position ;
char caption[HMI_MenueMessageSize];
int firstListIndex;
int ListIndexMaxVisible;
int SelectListIndex;
//----- functions
menuObject();
menuObject(Adafruit_SSD1306* screen, menuObject* parent, const char* title, int value);
virtual void begin();
virtual void update();
virtual void addChild(menuObject* sub);
virtual void eventUp();
virtual void eventDown();
virtual int eventSelect();
virtual void resetMenu();
virtual void start();
void displayOptionString(const char *str, bool selected, int x, int y);
protected:
//----- Members
Adafruit_SSD1306* display;
menuObject* endObject;
//----- functions
};
#endif
#endif