GUI: Widget view module API. More...
Go to the source code of this file.
Macros | |
#define | widget_add_frame_element(widget, x, y, width, height, radius) |
Add Frame Element. | |
Typedefs | |
typedef struct Widget | Widget |
typedef struct WidgetElement | WidgetElement |
Functions | |
Widget * | widget_alloc (void) |
Allocate Widget that holds Widget Elements. | |
void | widget_free (Widget *widget) |
Free Widget. | |
void | widget_reset (Widget *widget) |
Reset Widget. | |
View * | widget_get_view (Widget *widget) |
Get Widget view. | |
void | widget_add_string_multiline_element (Widget *widget, uint8_t x, uint8_t y, Align horizontal, Align vertical, Font font, const char *text) |
Add Multi String Element. | |
void | widget_add_string_element (Widget *widget, uint8_t x, uint8_t y, Align horizontal, Align vertical, Font font, const char *text) |
Add String Element. | |
void | widget_add_text_box_element (Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, Align horizontal, Align vertical, const char *text, bool strip_to_dots) |
Add Text Box Element. | |
void | widget_add_text_scroll_element (Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, const char *text) |
Add Text Scroll Element. | |
void | widget_add_button_element (Widget *widget, GuiButtonType button_type, const char *text, ButtonCallback callback, void *context) |
Add Button Element. | |
void | widget_add_icon_element (Widget *widget, uint8_t x, uint8_t y, const Icon *icon) |
Add Icon Element. | |
void | widget_add_rect_element (Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t radius, bool fill) |
Add Rect Element. | |
void | widget_add_circle_element (Widget *widget, uint8_t x, uint8_t y, uint8_t radius, bool fill) |
Add Circle Element. | |
void | widget_add_line_element (Widget *widget, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) |
Add Line Element. | |
GUI: Widget view module API.
#define widget_add_frame_element | ( | widget, | |
x, | |||
y, | |||
width, | |||
height, | |||
radius ) |
Add Frame Element.
widget | Widget instance |
x | top left x coordinate |
y | top left y coordinate |
width | frame width |
height | frame height |
radius | frame radius |
void widget_add_button_element | ( | Widget * | widget, |
GuiButtonType | button_type, | ||
const char * | text, | ||
ButtonCallback | callback, | ||
void * | context ) |
Add Button Element.
widget | Widget instance |
button_type | GuiButtonType instance |
text | text on allocated button |
callback | ButtonCallback instance |
context | pointer to context |
void widget_add_circle_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | radius, | ||
bool | fill ) |
Add Circle Element.
widget | Widget instance |
x | center x coordinate |
y | center y coordinate |
radius | circle radius |
fill | whether to fill the circle or not |
Add Icon Element.
widget | Widget instance |
x | top left x coordinate |
y | top left y coordinate |
icon | Icon instance |
void widget_add_line_element | ( | Widget * | widget, |
uint8_t | x1, | ||
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2 ) |
Add Line Element.
widget | Widget instance |
x1 | first x coordinate |
y1 | first y coordinate |
x2 | second x coordinate |
y2 | second y coordinate |
void widget_add_rect_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | radius, | ||
bool | fill ) |
Add Rect Element.
widget | Widget instance |
x | top left x coordinate |
y | top left y coordinate |
width | rect width |
height | rect height |
radius | corner radius |
fill | whether to fill the box or not |
void widget_add_string_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
Align | horizontal, | ||
Align | vertical, | ||
Font | font, | ||
const char * | text ) |
Add String Element.
widget | Widget instance | |
x | x coordinate | |
y | y coordinate | |
horizontal | Align instance | |
vertical | Align instance | |
font | Font instance | |
[in] | text | The text |
void widget_add_string_multiline_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
Align | horizontal, | ||
Align | vertical, | ||
Font | font, | ||
const char * | text ) |
Add Multi String Element.
widget | Widget instance | |
x | x coordinate | |
y | y coordinate | |
horizontal | Align instance | |
vertical | Align instance | |
font | Font instance | |
[in] | text | The text |
void widget_add_text_box_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
Align | horizontal, | ||
Align | vertical, | ||
const char * | text, | ||
bool | strip_to_dots ) |
Add Text Box Element.
widget | Widget instance | |
x | x coordinate | |
y | y coordinate | |
width | width to fit text | |
height | height to fit text | |
horizontal | Align instance | |
vertical | Align instance | |
[in] | text | Formatted text. The following formats are available: "\e#Bold text\e#" - bold font is used "\e*Monospaced text\e*" - monospaced font is used "\e!Inversed text\e!" - white text on black background |
strip_to_dots | Strip text to ... if does not fit to width |
void widget_add_text_scroll_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
const char * | text ) |
Add Text Scroll Element.
widget | Widget instance | |
x | x coordinate | |
y | y coordinate | |
width | width to fit text | |
height | height to fit text | |
[in] | text | Formatted text. Default format: align left, Secondary font. The following formats are available: "\e#Bold text" - sets bold font before until next ' ' symbol "\e*Monospaced text\e*" - sets monospaced font before until next ' ' symbol "\ecCenter-aligned text" - sets center horizontal align until the next ' ' symbol "\erRight-aligned text" - sets right horizontal align until the next ' ' symbol |
Widget * widget_alloc | ( | void | ) |
Allocate Widget that holds Widget Elements.
void widget_free | ( | Widget * | widget | ) |
Free Widget.
widget | Widget instance |
Get Widget view.
widget | Widget instance |
void widget_reset | ( | Widget * | widget | ) |
Reset Widget.
widget | Widget instance |