The csTextProgressMeter class displays a simple percentage-style textual progress meter.
By default, the meter is presented to the user by passing CS_MSG_INITIALIZATION to the system print function. This setting may be changed with the SetMessageType() method. After constructing a progress meter, call SetTotal() to set the total number of steps represented by the meter. The default is 100. To animate the meter, call the Step() method each time a unit of work has been completed. At most Step() should be called 'total' times. Calling Step() more times than this will not break anything, but if you do so, then the meter will not accurately reflect the progress being made. Calling Reset() will reset the meter to zero, but will not update the display. Reset() is provided so that the meter can be re-used, but it is the client's responsibility to ensure that the display is in a meaningful state. For instance, the client should probably ensure that a newline '
' has been printed before re-using a meter which has been reset. The complementary method Restart() both resets the meter and prints the initial tick mark ("0%"). The meter does not print a newline after 100% has been reached, on the assumption that the client may wish to print some text on the same line on which the meter appeared. If the client needs a newline printed after 100% has been reached, then it is the client's responsibility to print it.
Member Function Documentation
void csTextProgressMeter::SetGranularity (
int ) [virtual]
Set the refresh granularity.
Valid values are 1-100, inclusive. Default is 10. The meter is only refreshed after each "granularity" * number of units have passed. For instance, if granularity is 20, then * the meter will only be updated at most 5 times, or every 20%.
Valid values are 1-100, inclusive. Default is 2. A value of 1 means that each printed tick represents one unit, thus a total of 100 ticks will be printed. A value of 2 means that each tick represents two units, thus a total of 50 ticks will be printed, etc.
The documentation for this class was generated from the following file: