EasyGUI  v0.1
Platform independent GUI Library
Progress bar

Progress bar for progress visualization. More...

Data Structures

struct  GUI_PROGBAR_t
 Progress bar widget 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, 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 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:

handle = gui_progbar_create(2, 10, 10, 400, 40, h, 0, 0);
gui_widget_settext(handle, _GT("Progress bar with custom text"));
handle = gui_progbar_create(2, 10, 60, 400, 40, h, 0, 0);
gui_progbar_enablepercentages(handle);
gui_progbar_setmin(handle, 20);
gui_progbar_setmax(handle, 30);
gui_progbar_setvalue(handle, 22);

Enumeration Type Documentation

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_HANDLE_p gui_progbar_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 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 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 create procedure
Return values
>0: GUI_HANDLE_p object of created widget
0Widget creation failed
int32_t gui_progbar_getmax ( GUI_HANDLE_p  h)

Get progress bar maximal value.

Parameters
[in,out]hWidget handle
Return values
Maximalvalue
See also
gui_progbar_setmin, gui_progbar_setvalue, gui_progbar_setmax, gui_progbar_getvalue, gui_progbar_getmin
int32_t gui_progbar_getmin ( GUI_HANDLE_p  h)

Get progress bar minimal value.

Parameters
[in,out]hWidget handle
Return values
Minimalvalue
See also
gui_progbar_setmin, gui_progbar_setvalue, gui_progbar_setmax, gui_progbar_getvalue, gui_progbar_getmax
int32_t gui_progbar_getvalue ( GUI_HANDLE_p  h)

Get progress bar current value.

Parameters
[in,out]hWidget handle
Return values
Currentvalue
See also
gui_progbar_setmin, gui_progbar_setvalue, gui_progbar_setmax, gui_progbar_getmin, gui_progbar_getmax
uint8_t gui_progbar_setanimation ( GUI_HANDLE_p  h,
uint8_t  anim 
)

Set progress bar to animation mode.

Parameters
[in,out]hWidget handle
[in]animNew animation value either 1 (enable) or 0 (disable)
Return values
1Animation was set ok
0Animation vas not set
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,out]hWidget handle
[in]indexColor index. This parameter can be a value of GUI_PROGBAR_COLOR_t enumeration
[in]colorColor value
Return values
1Color was set ok
0Color vas not set
uint8_t gui_progbar_setmax ( GUI_HANDLE_p  h,
int32_t  val 
)

Set progress bar maximal value.

Parameters
[in,out]hWidget handle
[in]valNew maximal value
Return values
1Value was set ok
0Value vas not set
See also
gui_progbar_setmin, gui_progbar_setvalue, gui_progbar_getvalue, gui_progbar_getmin, gui_progbar_getmax
uint8_t gui_progbar_setmin ( GUI_HANDLE_p  h,
int32_t  val 
)

Set progress bar minimal value.

Parameters
[in,out]hWidget handle
[in]valNew minimal value
Return values
1Value was set ok
0Value vas not set
See also
gui_progbar_setvalue, gui_progbar_setmax, gui_progbar_getvalue, gui_progbar_getmin, gui_progbar_getmax
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,out]hWidget handle
[in]enableValue either to enable or disable mode
Return values
1Percentage mode was disabled ok
0Percange mode was not disabled
uint8_t gui_progbar_setvalue ( GUI_HANDLE_p  h,
int32_t  val 
)

Set progress bar current value.

Parameters
[in,out]hWidget handle
[in]valNew current value
Return values
1Value was set ok
0Value vas not set
See also
gui_progbar_setmin, gui_progbar_setmax, gui_progbar_getvalue, gui_progbar_getmin, gui_progbar_getmax