µGFX  2.9
version 2.9
Progressbar

Detailed Description

ProgressBar widget.

Precondition
GFX_USE_GWIN must be set to GFXON in your gfxconf.h
GWIN_NEED_PROGRESSBAR must be set to GFXON in your gfxconf.h

Modules

 Renderings
 Built-in rendering functions for the progressbar widget.
 

Functions

GHandle gwinGProgressbarCreate (GDisplay *g, GProgressbarObject *gb, const GWidgetInit *pInit)
 Create a progressbar window. More...
 
void gwinProgressbarSetRange (GHandle gh, int min, int max)
 Set the progressbar range. More...
 
void gwinProgressbarSetPosition (GHandle gh, int pos)
 Set the progressbar position. More...
 
void gwinProgressbarSetResolution (GHandle gh, int res)
 Set the resolution for the incrementation and decrementation of the progressbar. More...
 
void gwinProgressbarIncrement (GHandle gh)
 Increment the progressbar value. More...
 
void gwinProgressbarDecrement (GHandle gh)
 Decrement the progressbar value. More...
 
void gwinProgressbarStart (GHandle gh, gDelay delay)
 Automatically increments the progress bar. More...
 
void gwinProgressbarStop (GHandle gh)
 Stop the timer which is started by gwinProgressbarStart() More...
 

Macros

#define gwinProgressbarGetPosition(gh)   (((GProgressbarObject *)(gh))->pos)
 Get the current progressbar position. More...
 
#define gwinProgressbarReset(gh)   gwinProgressbarSetPosition(gh, ((GProgressbarObject *)(gh))->min)
 Reset the progressbar to the minimum position. More...
 

Function Documentation

◆ gwinGProgressbarCreate()

GHandle gwinGProgressbarCreate ( GDisplay *  g,
GProgressbarObject *  gb,
const GWidgetInit pInit 
)

Create a progressbar window.

Returns
NULL if there is no resultant drawing area, otherwise a window handle.
Parameters
[in]gThe GDisplay to display this window on
[in]gbThe GProgressbarObject structure to initialise. If this is NULL the structure is dynamically allocated.
[in]pInitThe initialization parameters to use
Note
The drawing color and the background color get set to the current defaults. If you haven't called gwinSetDefaultColor() or gwinSetDefaultBgColor() then these are GFX_WHITE and GFX_BLACK respectively.
The font gets set to the current default font. If you haven't called gwinSetDefaultFont() then there is no default font and text drawing operations will no nothing.
A progressbar remembers its normal drawing state. If there is a window manager then it is automatically redrawn if the window is moved or its visibility state is changed.
The initial progressbar range is from 0 to 100 with an initial position of 0.
A progressbar does not take any GINPUT inputs.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 78 of file gwin_progressbar.c.

◆ gwinProgressbarDecrement()

void gwinProgressbarDecrement ( GHandle  gh)

Decrement the progressbar value.

Decrements by the resolution set through gwinProgressbarSetResolution()

Parameters
[in]ghThe window handle (must be a progressbar window)
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 165 of file gwin_progressbar.c.

References GWindowObject::vmt.

◆ gwinProgressbarIncrement()

void gwinProgressbarIncrement ( GHandle  gh)

Increment the progressbar value.

Increments by the resolution set through gwinProgressbarSetResolution()

Parameters
[in]ghThe window handle (must be a progressbar window)
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 149 of file gwin_progressbar.c.

References GWindowObject::vmt.

◆ gwinProgressbarSetPosition()

void gwinProgressbarSetPosition ( GHandle  gh,
int  pos 
)

Set the progressbar position.

Parameters
[in]ghThe window handle (must be a progressbar window)
[in]posThe new position
Note
If the new position is outside the progressbar range then the position is set to the closest end of the range.
The progressbar is not automatically drawn. Call gwinProgressbarDraw() after changing the position.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 122 of file gwin_progressbar.c.

References GWindowObject::vmt.

◆ gwinProgressbarSetRange()

void gwinProgressbarSetRange ( GHandle  gh,
int  min,
int  max 
)

Set the progressbar range.

Parameters
[in]ghThe window handle (must be a progressbar window)
[in]minThe minimum value
[in]maxThe maximum value
Note
The defaults are 0 and 100
Sets the position to the minimum value.
The progressbar is not automatically drawn. Call gwinProgressbarDraw() after changing the range.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 97 of file gwin_progressbar.c.

References GWindowObject::vmt.

◆ gwinProgressbarSetResolution()

void gwinProgressbarSetResolution ( GHandle  gh,
int  res 
)

Set the resolution for the incrementation and decrementation of the progressbar.

Note
Default is set to 1
Parameters
[in]ghThe window handle (must be a progressbar window)
[in]resThe resolution to be set
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 138 of file gwin_progressbar.c.

References GWindowObject::vmt.

◆ gwinProgressbarStart()

void gwinProgressbarStart ( GHandle  gh,
gDelay  delay 
)

Automatically increments the progress bar.

Note
The delay is generated using the GTIMER module which is based on software/virtual timer. Therefore, the delay is totally unprecise.
The progressbar incrementation starts at the current level. It is not reset to the minimum value.
An event is generated once the maximum value has been reached (ToDo)
Parameters
[in]ghThe window handle (must be a progressbar window)
[in]delayThe incrementation delay (in milliseconds)
Function Class: Normal API, this function can be invoked by regular system threads.

◆ gwinProgressbarStop()

void gwinProgressbarStop ( GHandle  gh)

Stop the timer which is started by gwinProgressbarStart()

Parameters
[in]ghThe window handle (must be a progressbar window)
Function Class: Normal API, this function can be invoked by regular system threads.

Macro Definition Documentation

◆ gwinProgressbarGetPosition

#define gwinProgressbarGetPosition (   gh)    (((GProgressbarObject *)(gh))->pos)

Get the current progressbar position.

Returns
The progressbar position
Parameters
[in]ghThe window handle (must be a progressbar window)
Note
The use of a listener to get the progressbar position is recommended if you want continuous updates on the progressbar position.
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 135 of file gwin_progressbar.h.

◆ gwinProgressbarReset

#define gwinProgressbarReset (   gh)    gwinProgressbarSetPosition(gh, ((GProgressbarObject *)(gh))->min)

Reset the progressbar to the minimum position.

Parameters
[in]ghThe window handle (must be a progressbar window)
Function Class: Normal API, this function can be invoked by regular system threads.

Definition at line 144 of file gwin_progressbar.h.