Basic widget and core parent to all other widgets.
More...
Basic widget and core parent to all other widgets.
Core functions capable of encoding and decoding UTF-8 UNICODE format.
Decoding of raw unicode bytes can take up to 4 bytes in a row and stores value to 32-bit variable
- UNICODE structure table
| Number of bytes | Bits for code point | First code points | Last code point | Byte 1 | Byte 2 | Byte 3 | Byte 4 |
| 1 | 7 | U+0000 | U+007F | 0xxxxxxx | - | - | - |
| 2 | 11 | U+0080 | U+07FF | 110xxxxx | 10xxxxxx | - | - |
| 3 | 16 | U+0800 | U+FFFF | 1110xxxx | 10xxxxxx | 10xxxxxx | - |
| 4 | 21 | U+10000 | U+10FFFF | 11110xxx | 10xxxxxx | 10xxxxxx | 10xxxxxx |
https://en.wikipedia.org/wiki/UTF-8
Window is the Win98 styled widget which can support children widgets.
Default window widget
Example code of image above:
◆ gui_window_color_t
Window color list enumeration.
| Enumerator |
|---|
| GUI_WINDOW_COLOR_BG | Background color index
|
| GUI_WINDOW_COLOR_TEXT | Text color index
|
| GUI_WINDOW_COLOR_TOP_BG_FOC | Top background color when widget in focus
|
| GUI_WINDOW_COLOR_TOP_BG_NOFOC | Top background color when widget not in focus
|
◆ gui_window_create()
| gui_handle_p gui_window_create |
( |
gui_id_t |
id, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
width, |
|
|
float |
height, |
|
|
gui_handle_p |
parent, |
|
|
gui_widget_evt_fn |
evt_fn, |
|
|
uint16_t |
flags |
|
) |
| |
Create new window widget.
- Parameters
-
| [in] | id | Widget unique ID to use for identity for callback processing |
| [in] | x | Widget X position relative to parent widget |
| [in] | y | Widget Y position relative to parent widget |
| [in] | width | Widget width in units of pixels |
| [in] | height | Widget height in units of pixels |
| [in] | parent | Parent widget handle. Set to NULL to use current active parent widget |
| [in] | evt_fn | Custom widget callback function. Set to NULL to use default callback |
| [in] | flags | flags for widget creation |
- Returns
- Widget handle on success,
NULL otherwise
◆ gui_window_getdesktop()
| gui_handle_p gui_window_getdesktop |
( |
void |
| ) |
|
Get desktop window.
- Returns
- Widget handle of desktop window
◆ gui_window_setactive()
| uint8_t gui_window_setactive |
( |
gui_handle_p |
h | ) |
|
Set active window for future widgets and for current top window.
- Parameters
-
| [in] | h | Widget handle to set as active window |
- Returns
1 on success, 0 otherwise
◆ gui_window_setcolor()
Set color to specific part of widget.
- Parameters
-
| [in] | h | Widget handle |
| [in] | index | Color index |
| [in] | color | Color value |
- Returns
1 on success, 0 otherwise