EasyGUI  Version v1.0
Button

Button which can be pressed. More...

Data Structures

struct  GUI_BUTTON_t
 GUI button 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, GUI_iDim_t x, GUI_iDim_t y, GUI_Dim_t width, GUI_Dim_t height, GUI_HANDLE_p parent, GUI_WIDGET_CALLBACK_t cb, 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...
 

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,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_Dim_t  width,
GUI_Dim_t  height,
GUI_HANDLE_p  parent,
GUI_WIDGET_CALLBACK_t  cb,
uint16_t  flags 
)

Create new button widget.

Parameters
[in]idWidget unique ID to use for identity for 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 uints of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]cbPointer to GUI_WIDGET_CALLBACK_t callback function. Set to NULL to use default widget callback
[in]flagsFlags for widget creation
Return values
>0: GUI_HANDLE_p object of created widget
0Widget creation failed

◆ gui_button_setborderradius()

uint8_t gui_button_setborderradius ( GUI_HANDLE_p  h,
GUI_Dim_t  size 
)

Set border radius size.

Parameters
[in,out]hWidget handle
[in]sizeBorder radius size
Return values
1Border radius was set ok
0Border radius was not set

◆ 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,out]hWidget handle
[in]indexColor index. This parameter can be a value of GUI_BUTTON_COLOR_t enumeration
[in]colorColor value
Return values
1Color was set ok
0Color was not set