GUI: Widget view module API. More...
Go to the source code of this file.
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_frame_element (Widget *widget, uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t radius) |
Add Frame Element. | |
GUI: Widget view module API.
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_frame_element | ( | Widget * | widget, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | 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 |
Add Icon Element.
widget | Widget instance |
x | top left x coordinate |
y | top left y coordinate |
icon | Icon instance |
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 |