2.2.6.23.7 progressBox::SetText

Description

Set the progress dialog title, or the labels inside the dialog

Syntax

BOOL SetText( LPCSTR lpcszText, int nPosition = PBOXT_TITLE )

Parameters

lpcszText
[input] Text string to set
nPosition
[input] which text to set, can be one of PBOXT_TITLE, PBOXT_MIDCENTER, PBOXT_TOPLEFT

Return

TRUE if success, FALSE if nPosition not a valid input

Examples

EX1

void progressBox_SetText_ex1()
{                
    int imax = 100;
    progressBox aa("This is an example:", PBOX_TOPMOST);
    aa.SetRange(0,imax);
    string str;
    for(int ii = 0; ii < imax; ii++)
    {
        if(aa.Set(ii))
        {
            str.Format("Current at %d", ii);
            aa.SetText(str, PBOXT_TITLE);
        }
        else
        {
            out_str("User abort!");
            break;
        }
        LT_execute("sec -p 0.5"); // wasting some time
    
        aa.SetText("Text at top left corner...", PBOXT_TOPLEFT);
        aa.SetText("text at mid center above progress bar", PBOXT_MIDCENTER);
    }
}

Remark

See Also

Header to Include

origin.h