EasyGUI  Version v1.0
Progress bar

Progress bar for progress visualization. More...

Data Structures

struct  gui_progbar_t
 Progress bar object structure. More...
 

Enumerations

enum  gui_progbar_color_t { GUI_PROGBAR_COLOR_BG = 0x00, GUI_PROGBAR_COLOR_FG = 0x01, GUI_PROGBAR_COLOR_BORDER = 0x02 }
 Progress bar color list enumeration. More...
 

Functions

gui_handle_p gui_progbar_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 progress bar widget. More...
 
uint8_t gui_progbar_setcolor (gui_handle_p h, gui_progbar_color_t index, gui_color_t color)
 Set color to specific part of widget. More...
 
uint8_t gui_progbar_setmin (gui_handle_p h, int32_t val)
 Set progress bar minimal value. More...
 
uint8_t gui_progbar_setmax (gui_handle_p h, int32_t val)
 Set progress bar maximal value. More...
 
uint8_t gui_progbar_setvalue (gui_handle_p h, int32_t val)
 Set progress bar current value. More...
 
uint8_t gui_progbar_setanimation (gui_handle_p h, uint8_t anim)
 Set progress bar to animation mode. More...
 
int32_t gui_progbar_getmin (gui_handle_p h)
 Get progress bar minimal value. More...
 
int32_t gui_progbar_getmax (gui_handle_p h)
 Get progress bar maximal value. More...
 
int32_t gui_progbar_getvalue (gui_handle_p h)
 Get progress bar current value. More...
 
uint8_t gui_progbar_setpercentmode (gui_handle_p h, uint8_t enable)
 Sets percent mode. When in this mode, widget text is in percent according to current value between minimum and maximum. More...
 

Detailed Description

Progress bar for progress visualization.

Progress bar is used to show single progress value according to minimal, maximal and current values set to widget.

image_widget_progbar.png
Progress bars

Example code of image above:

Enumeration Type Documentation

◆ gui_progbar_color_t

Progress bar color list enumeration.

Enumerator
GUI_PROGBAR_COLOR_BG 

Background color index

GUI_PROGBAR_COLOR_FG 

Foreground (active part) color index

GUI_PROGBAR_COLOR_BORDER 

Border color index

Function Documentation

◆ gui_progbar_create()

gui_handle_p gui_progbar_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 progress bar 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 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 create procedure
Returns
Widget handle on success, NULL otherwise

◆ gui_progbar_getmax()

int32_t gui_progbar_getmax ( gui_handle_p  h)

Get progress bar maximal value.

Parameters
[in]hWidget handle
Returns
Maximal value

◆ gui_progbar_getmin()

int32_t gui_progbar_getmin ( gui_handle_p  h)

Get progress bar minimal value.

Parameters
[in]hWidget handle
Returns
Minimal value

◆ gui_progbar_getvalue()

int32_t gui_progbar_getvalue ( gui_handle_p  h)

Get progress bar current value.

Parameters
[in]hWidget handle
Returns
Current value

◆ gui_progbar_setanimation()

uint8_t gui_progbar_setanimation ( gui_handle_p  h,
uint8_t  anim 
)

Set progress bar to animation mode.

Parameters
[in]hWidget handle
[in]animNew animation value either 1 (enable) or 0 (disable)
Returns
1 on success, 0 otherwise

◆ gui_progbar_setcolor()

uint8_t gui_progbar_setcolor ( gui_handle_p  h,
gui_progbar_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

◆ gui_progbar_setmax()

uint8_t gui_progbar_setmax ( gui_handle_p  h,
int32_t  val 
)

Set progress bar maximal value.

Parameters
[in]hWidget handle
[in]valNew maximal value
Returns
1 on success, 0 otherwise

◆ gui_progbar_setmin()

uint8_t gui_progbar_setmin ( gui_handle_p  h,
int32_t  val 
)

Set progress bar minimal value.

Parameters
[in]hWidget handle
[in]valNew minimal value
Returns
1 on success, 0 otherwise

◆ gui_progbar_setpercentmode()

uint8_t gui_progbar_setpercentmode ( gui_handle_p  h,
uint8_t  enable 
)

Sets percent mode. When in this mode, widget text is in percent according to current value between minimum and maximum.

Parameters
[in]hWidget handle
[in]enableValue either to enable or disable mode
Returns
1 on success, 0 otherwise

◆ gui_progbar_setvalue()

uint8_t gui_progbar_setvalue ( gui_handle_p  h,
int32_t  val 
)

Set progress bar current value.

Parameters
[in]hWidget handle
[in]valNew current value
Returns
1 on success, 0 otherwise