![]() |
Whenever there is a lengthy operation to be done in an
application, for a while there is apparently nothing happening on screen.
That's causing two problems:
In either case, what will it be that's put the blame on? - Your application! With
all the consequences for your future business success.
Therefore, a good thing to do is display anything on screen that shows the lengthy
operation is really making headway. If possible, to indicate the current grade of
completion. With the standard Windows Progress control, that's about that all you
can do.
The DLG Progress control, however, provides a broad range of information you can
get across to the user - some are rather overt, others are more subtle.
The following sections will give you some insight into
| Progress - linear, analog | |
| Progress - linear, digital | |
| Progress - circular, analog, with DisplayProc | |
| Progress - circular, digital | |
| Progress - vertical (analog, digital) |
After each section you will find a bookmark at the right edge of the screen (top). You can jump back to the top by clicking on it.
| Progress linear, analog |
The easiest way to use a Progress
is the linear, analog Progress. It is good for visualizing the progress of a lengthy
operation that will be perceived by the user as a rather continuous flow. Usually
it has a not-so-clear end criterion. If you can calculate any measure of "completion",
the user will be glad to see it - so put a Display
onto the Progress. If you know any number that stands for the operation being
"complete" - set the Progress to it.
If there is any color, brush or pattern the user will associate with the operation
- paint the Progress in it (foreground and/or background).
The example whose screenshot you see above was done by a single line of source code:
| CreateCtl (..., ..., "Progress", DYN_PROGRESS, ..., ..., ..., ..., "\bDisplay Max=... Color=%x", RGB_RED, " BkColor=%x", RGB_YELLOW, ...); |
| "Progress" | window class of this control |
| DYN_PROGRESS | style bit combination for a Progress |
| \b | DLG-specific separator to introduce options |
| Display | DLG option to have a Display field within the Progress bar (By default, the completion percentage is printed into the Display.) |
| Max=... | DLG option to set the maximum Progress value to number ... (Default maximum value: 100) |
| "Color=%x", RGB_RED | DLG option to paint foreground in red color (Default foreground color: current system highlight color) |
| "BkColor=%x", RGB_YELLOW | DLG option to paint background in yellow color (Default background color: gray) |
| Progress linear, digital |
Many operations will be perceived not as a continuous flow but
rather as a certain number of steps (esp. if there are only a few steps). If so,
it will be more clear to the user if the progress is visualized by a sequence of
discrete marks. Additionally, the user might also be interested to see a
Display of the grade of completion.
This was done in the example above. It was coded like the following line:
| CreateCtl (..., ..., "Progress", DYN_PROGRESS, ..., ..., ..., ..., "\bDigital Display Max=... BkColor=%x", RGB_YELLOW, ...); |
| "Progress" | window class of this control |
| DYN_PROGRESS | style bit combination for a Progress |
| \b | DLG-specific separator to introduce options |
| Digital | option to make Progress display in discrete steps (Default: analog) |
| Display | DLG option to have a Display field within the Progress bar (By default, the completion percentage is printed into the Display.) |
| Max=... | DLG option to set the maximum Progress value to number ... (Default maximum value: 100) |
| "BkColor=%x", RGB_YELLOW | DLG option to paint background in yellow color (Default background color: gray) |
| Progress circular, analog, with DisplayProc |
![]() |
If there is anything like a clear-cut "completion" of the
lengthy process, it will make more sense to provide a
circular Progress control. If a great number of
individual steps are involved, it will be more reasonable to let the Progress grow
continuously. The user might also be interested not so much in the percentage of
completion but, say, in the absolute number of steps performed already.
If so, you better use a circular Progress control with an application-specific
callback procedure - like in the following code line:
| CreateCtl (..., ..., "Progress", DYN_PROGRESS, ..., ..., ..., ..., "\bCircular Range=...,... Color=%x", RGB_GREEN, " BkColor=%x", RGB_YELLOW, " Display", " DisplayProc=%p", DisplayProc, ...); |
| "Progress" | window class of this control |
| DYN_PROGRESS | style bit combination for a Progress |
| \b | DLG-specific separator to introduce options |
| Circular | option to make Progress circular (Default: linear) |
| Range=...,... | option to set minimum and maximum value of Progress (Default minimum: 0, maximum: 100) |
| "Color=%x", RGB_GREEN | DLG option to paint foreground in green color (Default foreground color: current system highlight color) |
| "BkColor=%x", RGB_YELLOW | DLG option to paint background in yellow color (Default background color: gray) |
| Display | DLG option to have a Display field within the Progress bar (By default, the completion percentage is printed into the Display.) |
| "DisplayProc=%p", DisplayProc | DLG option to set callback procedure for Display (By default, the completion percentage is printed into the Display. By a callback procedure an application can print anything else, e.g. the absolute number.) |
| Progress circular, digital |
![]() |
If there are only a few individual steps to do until the
lengthy operation is "complete", it will make more sense to display the progress
in discrete steps. This can be done with a circular Progress control as well.
There might be times when you do not want to distract the user, the lengthy
operation should be something "going on in the background". If so, you can
subtly weaken the importance attached to it by an elliptic Progress control.
Something like in the above screenshot is created by the following code line:
| CreateCtl (..., ..., "Progress", DYN_PROGRESS, ..., ..., 50, 30, "\bCircular Digital Range=...,... Color=%x", RGB_AMBER, " BkColor=%x", RGB_YELLOW, ...); |
| "Progress" | window class of this control |
| DYN_PROGRESS | style bit combination for a Progress |
| ..., ..., 50, 30, | width and height are different, to get elliptic Progress |
| \b | DLG-specific separator to introduce options |
| Circular | option to make Progress circular (Default: linear) |
| Digital | option to make Progress display in discrete steps (Default: analog) |
| Range=...,... | option to set minimum and maximum value of Progress | (Default minimum: 0, maximum: 100)
| "Color=%x", RGB_AMBER | DLG option to paint foreground in amber color (Default foreground color: current system highlight color) |
| "BkColor=%x", RGB_YELLOW | DLG option to paint background in yellow color (Default background color: gray) |
| Progress vertical (analog, digital) |
In some cases the user will perceive the progress of a
lengthy operation not so much like something "flowing" from left to right.
Rather as a
"rising" from bottom to top, or "piling up" one thing on top of the other.
So it would be more communicative if the Progress control is vertical.
Again you have the choice of visualizing a "continuous rising" or a "discrete
piling up".
This you can achieve by one of the following code lines:
| CreateCtl (..., ..., "Progress", DYN_PROGRESS, ..., ..., ..., ..., "\bVertical Max=... BkColor=%x", RGB_YELLOW, ...); |
| CreateCtl (..., ..., "Progress", DYN_PROGRESS, ..., ..., ..., ..., "\bVertical Digital Max=... BkColor=%x", RGB_YELLOW, ...); |
| "Progress" | window class of this control |
| DYN_PROGRESS | style bit combination for a Progress |
| \b | DLG-specific separator to introduce options |
| Vertical | option to make Progress vertical (Default: horizontal) |
| Digital | option to make Progress display in discrete steps (Default: analog) |
| Max=... | DLG option to set the maximum Progress value to number ... (By default, the maximum value of a Progress control is 100.) |
| "BkColor=%x", RGB_YELLOW | DLG option to paint background in yellow color (Default background color: gray) |