2.1.27.28 SetStatusBarText
Description
Set the text in the status bar, or on one of that status bar indicators.
Syntax
BOOL SetStatusBarText( LPCSTR lpcszText, int nIndex = 0 )
Parameters
- lpcszText
- [input] text string to set, use NULL clear the status bar
- nIndex
- [input] a parameter to indicate which part of status bar.
- 0 The standard status bar from the the left
- 1-4 The 1st, 2nd, 3rd and 4th customizable indicators on the right of the status bar
Return
TRUE if success, FALSE if nIndex is not in the valid range
Examples
EX1
//Case1: Update the status bar in a loop and want to see every changes, then you should use index=0, running the code you will see status bar flashing through with each values.
void SetStatusBarText_ex1()
{
for(int ii = 0; ii < 1000; ii++)
{
string str = "Test " + ii;
SetStatusBarText(str);
}
}
EX2
//Case 2: But if instead, you will find only "Last Value = 999" will be seen in the 1st indicator, but the code execute much faster.
void SetStatusBarText_ex2()
{
for(int ii = 0; ii < 1000; ii++)
{
string str = "Last Value = " + ii;
SetStatusBarText(str, 4);
}
}
Remark
Set the text in the status bar, or on one of that status bar indicators
There is a difference between the status bar (index 0) and the other status bar indicators (index 1,2,3,4).
Index=0 will update the status bar immediately, while the indicators will not be updated during this call, but to return from the function first and later a general system update of the whole Origin main window will update the various indicators.
See Also
Header to Include
origin.h
Reference
|