-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.h
More file actions
39 lines (35 loc) · 937 Bytes
/
Menu.h
File metadata and controls
39 lines (35 loc) · 937 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
32
33
34
35
36
37
38
39
#ifndef _MENU_H
#define _MENU_H
#include <Arduino.h>
#include <U8g2lib.h>
#include "SimpleList.h"
#include "BaseMenuItem.h"
#include "MenuItem.h"
#include "MenuItemLoading.h"
#include "MenuItemBack.h"
class Menu
{
private:
SimpleList<BaseMenuItem *> *items;
int activeIndex;
int translateY;
U8G2 dsp;
int getOffsetTop(int itemIndex);
bool hasBack;
String title;
public:
Menu();
void render();
void addItem(String title, bool selectable = true);
void addBack();
void updateItem(int index, String title, bool selectable = true);
void addLoading(bool loading = false);
void setTitle(String _title);
void startLoading(int index);
void stopLoading(int index);
void setDisplay(U8G2 _dsp);
void selectNextItem();
void selectPreviousItem();
int getActiveIndex();
};
#endif