discoverpixy
button.h
Go to the documentation of this file.
1 /**************************************************************************************************************************************
2 * Project: discoverpixy
3 * Website: https://github.com/t-moe/discoverpixy
4 * Authors: Aaron Schmocker, Timo Lang
5 * Institution: BFH Bern University of Applied Sciences
6 * File: common/gui/button.h
7 *
8 * Version History:
9 * Date Autor Email SHA Changes
10 * 2015-04-27 timolang@gmail.com 7c9eabc Added button support.
11 * 2015-04-27 timolang@gmail.com cf72baa Introduced a Screen (sub) module and divided app into multiple screens.
12 * 2015-05-11 timolang@gmail.com 08d9fe0 More work on doxygen module structure
13 * 2015-05-12 timolang@gmail.com 1402598 Added doxygen stuff for button module and some minor changes to touch, screen_main and tft module.
14 * 2015-05-15 timolang@gmail.com 9a16865 Added doxgen comments to filesyste, checkbox, numupdown and screen module. And some minor changes to the other modules.
15 * 2015-05-17 timolang@gmail.com 2d46336 Improved comments in implementation of button, checkbox, numupdown, tft, touch and screen modules/submodules.
16 *
17 **************************************************************************************************************************************/
18 
19 #ifndef BUTTON_H
20 #define BUTTON_H
21 
22 #include "touch.h"
23 
29 
37 
42 
43 
49 typedef void (*BUTTON_CALLBACK)(void* button);
50 
51 
55 typedef struct {
57  uint16_t bgcolor;
59  uint16_t txtcolor;
60  uint8_t font;
61  const char* text;
63 
64 
65 #define AUTO 0
66 
67 
72 bool gui_button_add(BUTTON_STRUCT* button);
73 
78 void gui_button_remove(BUTTON_STRUCT* button);
79 
84 void gui_button_redraw(BUTTON_STRUCT* button);
85 
86 
89 #endif /* BUTTON_H */
const char * text
The label of the button.
Definition: button.h:61
void gui_button_redraw(BUTTON_STRUCT *button)
Definition: button.c:164
uint16_t txtcolor
The 16-bit text color.
Definition: button.h:59
bool gui_button_add(BUTTON_STRUCT *button)
Definition: button.c:133
uint16_t bgcolor
The 16-bit background color of the button.
Definition: button.h:57
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:56
void gui_button_remove(BUTTON_STRUCT *button)
Definition: button.c:184
BUTTON_CALLBACK callback
Callback which is executed when the button is pressed.
Definition: button.h:58
uint8_t font
The number of the font to use.
Definition: button.h:60
void(* BUTTON_CALLBACK)(void *button)
Definition: button.h:49