discoverpixy
numupdown.h
Go to the documentation of this file.
1 #ifndef NUMUPDOWN_H
2 #define NUMUPDOWN_H
3 
4 #include "button.h"
5 
10 
16 
21 
28 typedef void (*NUMUPDOWN_CALLBACK)(void *numupdown, int16_t value);
29 
33 typedef struct {
34  uint16_t x;
35  uint16_t y;
36  uint16_t fgcolor;
37  int16_t value;
38  int16_t min;
39  int16_t max;
41 
45 
51 bool gui_numupdown_add(NUMUPDOWN_STRUCT* numupdown);
52 
57 void gui_numupdown_remove(NUMUPDOWN_STRUCT* numupdown);
58 
63 void gui_numupdown_update(NUMUPDOWN_STRUCT* numupdown);
64 
69 void gui_numupdown_redraw(NUMUPDOWN_STRUCT* numupdown);
70 
73 #endif /* NUMUPDOWN_H */
uint16_t x
The x-Coordinate of the Top-Left Starting Point.
Definition: numupdown.h:34
Definition: button.h:37
NUMUPDOWN_CALLBACK callback
Callback which is executed when the value changes.
Definition: numupdown.h:40
uint16_t y
The y-Coordinate of the Top-Left Starting Point.
Definition: numupdown.h:35
int16_t max
The maximum possible value (inclusive)
Definition: numupdown.h:39
Definition: numupdown.h:33
void(* NUMUPDOWN_CALLBACK)(void *numupdown, int16_t value)
Definition: numupdown.h:28
void gui_numupdown_remove(NUMUPDOWN_STRUCT *numupdown)
Definition: numupdown.c:112
int16_t min
The minimum possible value (inclusive)
Definition: numupdown.h:38
void gui_numupdown_redraw(NUMUPDOWN_STRUCT *numupdown)
Definition: numupdown.c:120
uint16_t fgcolor
The 16-bit color of the value-text.
Definition: numupdown.h:36
BUTTON_STRUCT buttonDown
For internal use, don't change, don't initialize.
Definition: numupdown.h:43
void gui_numupdown_update(NUMUPDOWN_STRUCT *numupdown)
Definition: numupdown.c:130
int16_t value
The current/default value.
Definition: numupdown.h:37
BUTTON_STRUCT buttonUp
For internal use, don't change, don't initialize.
Definition: numupdown.h:42
bool gui_numupdown_add(NUMUPDOWN_STRUCT *numupdown)
Definition: numupdown.c:59