#include "tft.h"
#include "touch.h"
#include "button.h"
#include <string.h>
Go to the source code of this file.
void buttons_cb |
( |
void * |
touchArea, |
|
|
TOUCH_ACTION |
triggeredAction |
|
) |
| |
Definition at line 92 of file button.c.
97 uint16_t c_light, c_dark;
100 switch (triggeredAction) {
Receive an event when the pen goes down inside the region.
Receive an event when the pen goes up inside the region.
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.
uint16_t x1
Top Left X-Coordinate of Area.
uint16_t bgcolor
The 16-bit background color of the button.
TOUCH_AREA_STRUCT base
Basic geometry of the button. You only need to set the x1, y1, x2, y2 members of this struct...
uint16_t y2
Bottom Right Y-Coordinate of Area.
uint16_t x2
Bottom Right X-Coordinate of Area.
TOUCH_ACTION hookedActions
Actions to listen to.
BUTTON_CALLBACK callback
Callback which is executed when the button is pressed.
Receive an event when the pen leaves the region (pen was inside region before)
void calculate_shadows |
( |
uint16_t |
bgcolor, |
|
|
uint16_t * |
light_shadow, |
|
|
uint16_t * |
dark_shadow |
|
) |
| |
Definition at line 34 of file button.c.
36 #define BRIGHTNESS_VAL 3 //How much the Brightness is in/decreased for button shadows (3 -> Add/Subtract 1/3 off Full Value)
38 uint16_t c_light, c_dark;
42 r = (bgcolor & 0xF800) >> 11;
43 g = (bgcolor & 0x07E0) >> 5;
44 b = (bgcolor & 0x001F) >> 0;
81 if (light_shadow != NULL) {
82 *light_shadow = c_light;
85 if (dark_shadow != NULL) {
86 *dark_shadow = c_dark;