
Home |
|
PegProgressWindow
|

Examples |

Index |
|
|
|
 |
|
Overview |
Derived from class
PegMessageWindow
|
 |
|
The PegProgressWindow class provides a message window
adapted to include a progress bar in addition to the message and optional
control buttons. Your application can easily provide a progress window
to display a message and progress information to the user
while performing some time consuming operation.
The progress window creates a progress bar.
Your application must call the window member function Bar()
to retrieve a pointer to the PegProgressBar object.
You must periodically update the progress bar value in order to display
the progress of the operation being monitored.
The progress bar always has a scale of 0 to 100.
Your application must scale its progress bar value accordingly.
|
|
PegProgressBar
The PegProgressWindow class supports
the following style flags:
FF_NONE | No frame. |
FF_THIN | Thin frame. |
FF_THICK | Thick 3D frame. |
FF_RAISED | Raised 3D frame. |
FF_RECESSED | Recessed 3D frame. |
MW_OK | Adds an OK button to the window. |
MW_YES | Adds a YES button to the window. |
MW_NO | Adds a NO button to the window. |
MW_ABORT | Adds an ABORT button to the window. |
MW_RETRY | Adds a RETRY button to the window. |
MW_CANCEL | Adds a CANCEL button to the window. |
The following style flags apply only to the progress bar:
FF_NONE | No frame. |
FF_THIN | Thin frame. |
FF_THICK | Thick 3D frame. |
FF_RAISED | Raised 3D frame. |
FF_RECESSED | Recessed 3D frame. |
PS_SHOW_VAL |
The progress indicated by a PegProgressBar object will be
displayed as a numeric text string superimposed over the graphical
progress presentation. |
PS_PERCENT |
The progress value for a PegProgressBar object having this style
flag set is considered to be a percentage. The character % will
be appended to the progress value when displayed as a text string.
This style flag is ignored if the PS_SHOW_VAL style flag
is not also set. |
PS_RECESSED |
The progress indicator for a PegProgressBar object
is drawn recessed within the progress bar frame.
If this style flag is not set, a raised progress indicator is drawn. |
PS_LED |
The progress indicator for a PegProgressBar object
is drawn as a sequence of segmented LED indicators.
If this style flag is not set, the progress indicator appears
as a solid bar. |
PS_VERTICAL |
A PegProgressBar object with this style flag set will
be drawn with a vertical orientation. Normally, a progress bar is drawn with a
horizontal orientation. |
Constructors:
 |
 |
PegProgressWindow(const PegRect &Rect,
|
| |

const PEGCHAR *Title,
|
| |

const PEGCHAR *Message,
|
| |

WORD wMesgStyle,
|
| |

WORD wProgStyle = FF_THIN|PS_SHOW_VAL|PS_PERCENT,
|
| |

PegBitmap *pIcon = NULL, PegThing *Owner = NULL)
|
 |
PegProgressWindow(const PEGCHAR *Title,
|
| |

const PEGCHAR *Message,
|
| |

WORD wMesgStyle,
|
| |

WORD wProgStyle = FF_THIN|PS_SHOW_VAL|PS_PERCENT,
|
| |

PegBitmap *pIcon = NULL, PegThing *Owner = NULL)
|
The PegProgressWindow
constructor is similar to the constructor of the
PegMessageWindow class from which the progress window is derived.
However, each PegProgressWindow constructor includes an extra
parameter wProgStyle which specifies the style of
the child PegProgressBar object to be created and
added to the progress window.
Public Functions:
 |
 |
PegProgressBar *Bar(void) {return mpProgBar;}
|
This inline function
returns a pointer to the child progress bar.
Your application must use this function to acquire the pointer to the
PegProgressBar object in order to be able to update
the progress bar value.
The following examples illustrate different uses of
a PegProgressWindow object.


The following code fragment creates and displays the lower
PegProgressWindow object shown above:
void MyWin::DisplayProgress(void)
{
PegProgressWindow *pWin =
new PegProgressWindow("Working....",
"Copying Information...", MW_OK | FF_RAISED);
Presentation()->Center(pWin);
Presentation()->Add(pWin);
}