Button which can be pressed.
More...
|
| gui_handle_p | gui_button_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 button widget. More...
|
| |
| uint8_t | gui_button_setcolor (gui_handle_p h, gui_button_color_t index, gui_color_t color) |
| | Set color to specific part of widget. More...
|
| |
| uint8_t | gui_button_setborderradius (gui_handle_p h, gui_dim_t size) |
| | Set border radius size. More...
|
| |
| uint8_t | gui_button_set3dstyle (gui_handle_p h, uint8_t enable) |
| | Set 3D mode on widget. More...
|
| |
Button which can be pressed.
Button represents simple widget which can be pressed and can process events such as click, long click or double click.
Default button state with text
◆ gui_button_color_t
Button color list enumeration.
| Enumerator |
|---|
| GUI_BUTTON_COLOR_BG | Background color index
|
| GUI_BUTTON_COLOR_FG | Foreground color index
|
| GUI_BUTTON_COLOR_BORDER | Border color index in array
|
◆ gui_button_create()
| gui_handle_p gui_button_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 button widget.
- Parameters
-
| [in] | id | Widget unique ID to use for identity at 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_button_set3dstyle()
| uint8_t gui_button_set3dstyle |
( |
gui_handle_p |
h, |
|
|
uint8_t |
enable |
|
) |
| |
Set 3D mode on widget.
- Parameters
-
| [in] | h | Widget handle |
| [in] | enable | Set to 1 to enable 3D mode, 0 otherwise |
- Returns
1 on success, 0 otherwise
◆ gui_button_setborderradius()
| uint8_t gui_button_setborderradius |
( |
gui_handle_p |
h, |
|
|
gui_dim_t |
size |
|
) |
| |
Set border radius size.
- Parameters
-
| [in] | h | Widget handle |
| [in] | size | Border radius size |
- Returns
1 on success, 0 otherwise
◆ gui_button_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