Added num up down support.

This commit is contained in:
t-moe
2015-04-30 23:22:30 +02:00
parent 77e6d0e061
commit 76ea9d8972
5 changed files with 170 additions and 6 deletions

22
common/gui/numupdown.h Normal file
View File

@@ -0,0 +1,22 @@
#include "button.h"
typedef void (*NUMUPDOWN_CALLBACK)(void *numupdown, int16_t value); //!< Function pointer used...
typedef struct {
uint16_t x;
uint16_t y;
uint16_t fgcolor;
int16_t value;
int16_t min;
int16_t max;
NUMUPDOWN_CALLBACK callback; //Callback
//Internally used:
BUTTON_STRUCT buttonUp;
BUTTON_STRUCT buttonDown;
} NUMUPDOWN_STRUCT;
bool gui_numupdown_add(NUMUPDOWN_STRUCT* numupdown);
void gui_numupdown_remove(NUMUPDOWN_STRUCT* numupdown);
void gui_numupdown_update(NUMUPDOWN_STRUCT* numupdown);
void gui_numupdown_redraw(NUMUPDOWN_STRUCT* numupdown);