-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXUI_screen.cpp
More file actions
45 lines (38 loc) · 839 Bytes
/
XUI_screen.cpp
File metadata and controls
45 lines (38 loc) · 839 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
40
41
42
43
44
45
#include "XUI_Engine.h"
XUI_Screen::XUI_Screen(string title){
xuiTitle = title;
childrenCount = 0;
}
void XUI_Screen::addScreen(XUI_Screen* screen){
screen->init(xuiEngine, this);
xuiScreens.push_back(screen);
childrenCount++;
}
void XUI_Screen::init(XUI_Engine* xuiEngine, XUI_Screen* prevScreen){
this->xuiEngine = xuiEngine;
this->xuiDisplay = xuiEngine->xuiDisplay;
this->prevScreen = prevScreen;
}
void XUI_Screen::run(){
xuiDisplay->clear();
xuiDisplay->drawTitle(xuiTitle);
xuiDisplay->display();
}
void XUI_Screen::start(){
}
bool XUI_Screen::end(){
return true;
}
void XUI_Screen::bttn_event(uint8_t button){
switch (button){
case BTTN_UP:
break;
case BTTN_DOWN:
break;
case BTTN_LEFT:
xuiEngine->nav(prevScreen);
break;
case BTTN_RIGHT:
break;
}
}