C
void PbSetPos( PROGRESSBAR * pPb, WORD position );
Overview
This function sets the position of the progress bar. Position should be in the given range inclusive.
Input Parameters
|
Input Parameters |
Description |
|
PROGRESSBAR * pPb |
Pointer to the object |
|
WORD position |
New position. |
Returns
none
Preconditions
none
Side Effects
none
Example
PROGRESSBAR *pPb;
BYTE direction = 1;
// this code increments and decrements the progress bar by 1
// assume progress bar was created and initialized before
while (1) {
if(direction) {
if(pPb ->pos == pPb ->range)
direction = 0;
else
PbSetPos(pPb,PbGetPos(pPb)+1);
} else {
if(pPb ->pos == 0)
direction = 1;
else
PbSetPos(pPb,PbGetPos(pPb)-1);
}
}