discoverpixy
button.h
Go to the documentation of this file.
1 #ifndef BUTTON_H
2 #define BUTTON_H
3 
4 #include "touch.h"
5 
11 
19 
24 
25 
31 typedef void (*BUTTON_CALLBACK)(void *button);
32 
33 
37 typedef struct {
39  uint16_t bgcolor;
41  uint16_t txtcolor;
42  uint8_t font;
43  const char *text;
45 
46 
47 #define AUTO 0
48 
49 
54 bool gui_button_add(BUTTON_STRUCT* button);
55 
60 void gui_button_remove(BUTTON_STRUCT* button);
61 
66 void gui_button_redraw(BUTTON_STRUCT* button);
67 
68 
71 #endif /* BUTTON_H */
const char * text
The label of the button.
Definition: button.h:43
void gui_button_redraw(BUTTON_STRUCT *button)
Definition: button.c:130
uint16_t txtcolor
The 16-bit text color.
Definition: button.h:41
Definition: button.h:37
bool gui_button_add(BUTTON_STRUCT *button)
Definition: button.c:99
uint16_t bgcolor
The 16-bit background color of the button.
Definition: button.h:39
TOUCH_AREA_STRUCT base
Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct...
Definition: button.h:38
Definition: touch.h:50
void gui_button_remove(BUTTON_STRUCT *button)
Definition: button.c:150
BUTTON_CALLBACK callback
Callback which is executed when the button is pressed.
Definition: button.h:40
uint8_t font
The number of the font to use.
Definition: button.h:42
void(* BUTTON_CALLBACK)(void *button)
Definition: button.h:31