29 #define ACTIVE_COLOR RGB(251,208,123) //shadow color (inside of border)
30 #define BORDER_COLOR RGB(29,82,129) //1px border color
31 #define BACKGROUND_COLOR WHITE //Background color
39 switch (triggeredAction) {
73 unsigned char size = 0;
130 unsigned int xcent = checkbox->
base.
x1 + (checkbox->
base.
x2 - checkbox->
base.
x1) * 6 / 14;
131 unsigned int yleft = checkbox->
base.
y2 - (xcent - checkbox->
base.
x1) - 1 ;
132 unsigned int yright = checkbox->
base.
y2 - (checkbox->
base.
x2 - xcent) - 1 ;
133 unsigned int ybot = checkbox->
base.
y2 - 4;
bool touch_register_area(TOUCH_AREA_STRUCT *area)
Receive an event when the pen goes down inside the region.
Receive an event when the pen goes up inside the region.
bool gui_checkbox_add(CHECKBOX_STRUCT *checkbox)
void tft_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
uint16_t y1
Top Left Y-Coordinate of Area.
void gui_checkbox_update(CHECKBOX_STRUCT *checkbox)
void gui_checkbox_remove(CHECKBOX_STRUCT *checkbox)
uint16_t x1
Top Left X-Coordinate of Area.
bool checked
A boolean which indicates whether or not the checkbox is currently checked.
void touch_unregister_area(TOUCH_AREA_STRUCT *area)
uint16_t y2
Bottom Right Y-Coordinate of Area.
TOUCH_CALLBACK callback
Callback which is executed when an event occurred in this Area.
uint16_t x2
Bottom Right X-Coordinate of Area.
void tft_fill_rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
TOUCH_ACTION hookedActions
Actions to listen to.
void tft_draw_rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
TOUCH_AREA_STRUCT base
Basic geometry of the Checkbox. You only need to set the x1, y1, x2, y2 members of this struct...
uint16_t fgcolor
The 16-bit color of the tickmark.
bool touch_have_empty(unsigned char num)
void gui_checkbox_redraw(CHECKBOX_STRUCT *checkbox)
void checkboxes_cb(void *touchArea, TOUCH_ACTION triggeredAction)
CHECKBOX_CALLBACK callback
Callback which is executed when the checkbox changes state.
Receive an event when the pen leaves the region (pen was inside region before)