EasyGUI  Version v1.0
Button

Button which can be pressed. More...

Data Structures

struct  gui_button_t
 Button object structure. More...
 

Enumerations

enum  gui_button_color_t { GUI_BUTTON_COLOR_BG = 0x00, GUI_BUTTON_COLOR_FG, GUI_BUTTON_COLOR_BORDER }
 Button color list enumeration. More...
 

Functions

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...
 

Detailed Description

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.

image_widget_button.png
Default button state with text

Enumeration Type Documentation

◆ 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

Function Documentation

◆ 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]idWidget unique ID to use for identity at callback processing
[in]xWidget X position relative to parent widget
[in]yWidget Y position relative to parent widget
[in]widthWidget width in units of pixels
[in]heightWidget height in units of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]evt_fnCustom widget callback function. Set to NULL to use default callback
[in]flagsflags 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]hWidget handle
[in]enableSet 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]hWidget handle
[in]sizeBorder radius size
Returns
1 on success, 0 otherwise

◆ gui_button_setcolor()

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.

Parameters
[in]hWidget handle
[in]indexColor index
[in]colorColor value
Returns
1 on success, 0 otherwise