-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplayGUI.h
85 lines (62 loc) · 1.53 KB
/
DisplayGUI.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* DisplayGUI.h
*
* Created: 11.05.2016 11:28:59
* Author: Andre Eberhard
*/
#ifndef __DISPLAYGUI_H__
#define __DISPLAYGUI_H__
#include "Arduino.h"
#include "PCD8544_SPI.h"
#include "MenuClasses.h"
//TODO: Move all Bitmaps to external file and ban into PROGMEM >:)
const uint8_t LINE[][2] = {{0b10, 0b10}, {0b10, 0b00}, {0b10, 0b01}};
const uint8_t CURSOR[] = {0x0E, 0x0E, 0x0E, 0x1F, 0x0E, 0x04}; // Code for char cursor
const uint8_t pinA = 2;
const uint8_t pinB = 3;
const uint8_t pinClick = 5;
class DisplayGUI
{
//variables
public:
enum LINETYPE {SOLID, DOTTED, DOUBLEDOTTED};
protected:
private:
Menu* root;
Menu* currentMenu;
//Needed for scrolling through Menus
byte firstMenuPoint;
public: PCD8544_SPI_FB *display;
//Variables for Input
bool lastAValue;
bool lastBValue;
bool lastClickValue;
//functions
public:
//TEST
byte currentSelection;
DisplayGUI();
~DisplayGUI();
void addScreen(Menu *parentMenu, char* screenTitle);
void addMenu(Menu *parentMenu, char* menuTitle);
void setRootMenu(Menu* rootMenu);
void initInterupt();
void drawMenu();
void drawEntrys();
void drawSlider(byte numberOfItems, byte selectedItem);
void drawCursor();
void drawStatusBar();
void drawOutline(LINETYPE linetype);
void drawIcon(byte icon[]);
void drawMenuTitle();
//GUI Elements
void drawSwitchButton();
void handleInput();
void PinA();
void PinB();
protected:
private:
DisplayGUI( const DisplayGUI &c );
DisplayGUI& operator=( const DisplayGUI &c );
}; //DisplayGUI
#endif //__DISPLAYGUI_H__