added different GUI elements
This commit is contained in:
parent
cc7943305e
commit
f4917beb6a
2 changed files with 14 additions and 1 deletions
13
gui.c
13
gui.c
|
@ -83,9 +83,12 @@ static void guiThread(const uint16_t interval) {
|
||||||
|
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
for(node = firstGUI; node; node = node->next) {
|
for(node = firstGUI; node; node = node->next) {
|
||||||
|
// check if GUI element is active
|
||||||
if(*(node->active) == active) {
|
if(*(node->active) == active) {
|
||||||
x = tpReadX();
|
x = tpReadX();
|
||||||
y = tpReadY();
|
y = tpReadY();
|
||||||
|
|
||||||
|
// we got a button
|
||||||
if(node->type == button) {
|
if(node->type == button) {
|
||||||
if(x >= node->x0 && x <= node->x1 && y >= node->y0 && y <= node->y1)
|
if(x >= node->x0 && x <= node->x1 && y >= node->y0 && y <= node->y1)
|
||||||
*(node->state) = 1;
|
*(node->state) = 1;
|
||||||
|
@ -94,6 +97,16 @@ static void guiThread(const uint16_t interval) {
|
||||||
} else {
|
} else {
|
||||||
*(node->state) = 0;
|
*(node->state) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we got a slider
|
||||||
|
if(node->type == slider) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// we got a keymatrix
|
||||||
|
if(node->type == keymatrix) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
gui.h
2
gui.h
|
@ -22,7 +22,7 @@ static struct guiNode_t {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum {button};
|
enum {button, slider, keymatrix};
|
||||||
enum {horizontal, vertical};
|
enum {horizontal, vertical};
|
||||||
enum {inactive, active};
|
enum {inactive, active};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue