Home |
Class PegProgressWindow HMI (Human-Machine Interface) Classes |
Class PegProgressWindowPegProgressWindow is an extension to PegMessageWindow. In this case, a progress bar indicator is added to the message and optional buttons displayed on the message window. This makes it very easy to create and display a message and progress bar to the user during a long operation. The progress bar that is a child of the progress window is directly updated by the application software. The progress window member function Bar(), is called to retrieve a pointer to the progress bar when the application determines that the progress bar should be updated. The progress bar added to a PegProgressWindow always has a scale of 0 to 100. It is up to the application software to pre-scale the input value accordingly. The style of the progress bar displayed in the window client area is passed to the PegProgressWindow constructor. class PegProgressWindow : public PegMessageWindow { public: PegProgressWindow(const PegRect &Rect, const PEGCHAR * Title, const PEGCHAR * Message, PEGUINT wMesgStyle, PEGUINT wProgStyle = FF_THIN | PS_SHOW_VAL | PS_PERCENT, PegBitmap * pIcon = NULL, PegThing * Owner = NULL); PegProgressWindow(const PEGCHAR * Title, const PEGCHAR * Message, PEGUINT wMesgStyle, PEGUINT wProgStyle = FF_THIN | PS_SHOW_VAL | PS_PERCENT, PegBitmap * pIcon = NULL, PegThing * Owner = NULL); PegProgressBar * Bar(void); }; Style FlagsPegProgressWindow accepts both PegMessageWindow and PegProgressBar styles. ConstructorsThe PegProgressWindow constructors are identical to the PegMessageWindow constructors with an added style value wProgStyle. wProgStyle is applied to the child PegProgressBar object. Method BarReturns a pointer to the child progress bar. This allows the application software to directly manipulate the child control. ExampleThe following code fragment creates and displays a PegProgressWindow: void MyWin::DisplayProgress(void) { PegProgressWindow * pWin = new PegProgressWindow("Working....", "Copying Information...", MW_OK | FF_RAISED); Presentation()->Center(pWin); Presentation()->Add(pWin); }
|