progressBox

 

Contents

Name

progressBox

Remark

A progress dialog box is a small dialog box used to indicate that software is busy processing data. The dialog box contains a progress bar indicating the fraction of processing that has been completed. The progress dialog box is generally used in conjunction with some sort of iterative loop. The progressBox class provides methods and properties needed to open and control progress dialog boxes.

Hierarchy

Examples

EX1

void progressBox_ex1(int imax = 100)
{
    progressBox aa("This is an example:", PBOX_TOPMOST, imax < 20? true:false);
    aa.SetRange(0,imax);
    string str;
    for(int ii = 0; ii < imax; ii++)
    {
        str.Format("Current at %d", ii);
        if(aa.Set(ii))
        {
            aa.SetText(str, PBOXT_TITLE);
        }
        else
        {
            out_str("User abort!");
            break;
        }
        SetStatusBarText(str);                
        LT_execute("sec -p 0.5"); // wasting some time
    }
}

header to Include

origin.h

Reference

Members

Name Brief Example
CheckReopen Check to reopen progress box if needed. Examples
IsAbort Get the state of progress dialog Examples
progressBox class constructor
Set Set the current position of the progress bar. This value is typically within range set by the SetRange method Examples
SetRange Set the integer range for the progressbox to loop through. If you do not call this method, the default range of 0 to 100 will be used.
SetText Set the progress dialog title, or the labels inside the dialog Examples

Property

Name Brief Example
m_nCurrent the current progress bar position