-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuItem.h
More file actions
31 lines (26 loc) · 908 Bytes
/
MenuItem.h
File metadata and controls
31 lines (26 loc) · 908 Bytes
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
#ifndef MenuItem_h
#define MenuItem_h
#include "Arduino.h"
#include "UIItem.h"
typedef void (menuFn)(void); //does the things
typedef char *(updateFn)(void); //updates the display string
class MenuItem : public UIItem {
//a UIItem that can be clicked
public:
MenuItem();
// updatable but not clickable
MenuItem(char dString[5], updateFn *onUpdFn);
// clickable but not updatable
MenuItem(char dString[5], menuFn *onCkFn, bool clickable);
MenuItem(char dString[5], menuFn *onCkFn, bool clickable, bool autoclickable);
// clickable, updateable
MenuItem(char dString[5], menuFn *onCkFn, updateFn *onUpdFn, bool clickable);
MenuItem(char dString[5], menuFn *onCkFn, updateFn *onUpdFn, bool clickable, bool autoclickable);
void click(void);
void autoclick(void);
private:
bool _canBeAutoClicked;
bool _isClickable;
menuFn *_onClickFn;
};
#endif