The vStatus structure is used to define the top level status bar included on a vCmdWindow, and the labels it contains. The vStatus array is usually passed to the vStatusPane constructor. See the section vPane for a general description of panes.
char* label Text of label field. See the description of
the vWindow class for information on changing the text of
a label.
ItemVal id Id for the label. Use this value when changing
value with SetString or SetValue.
CmdAttribute attrs The current implementation only uses
the CA_NoBorder attribute. If CA_NoBorder is
supplied, the label will be drawn on the command bar without a border
or box around it. Not supplying CA_NoBorder (e.g.,
CA_None) will result in a label with a border or box
around it. In general, unbordered labels don't change, and
bordered labels are used to show changing status.
int sensitive If label is sensitive or not. Use
predefined symbols isSens and notSens to specify
the initial state. On some implementations, the label will be
grayed if it is insensitive. The sensitivity can be changed
using vWindow::SetValue as described in the section
vWindow.
int width This can be used to specify a fixed width for
a label. Normally, the label will be sized to fit the length of the
text. If you provide a non-zero width, then the label field will
remain constant size.
This shows a sample status bar with two fields. It is added
to a vCmdWindow using AddPane. The value of the
file name would be changed by calling
SetString(m_curFile, filename) somewhere in your program.
typedef struct vStatus // for status bars
{
char* label; // text label
ItemVal statId; // id
CmdAttribute attrs; // attributes - CA_NoBorder
unsigned sensitive : 1; // if button is sensitive or not
int width; // to specify width (0 for default)
} vButton;
Structure Members
Example
static vStatus sbar[] =
{
{"Current file:", m_curMsg,CA_NoBorder,isSens,0},
{" ", m_curFile,CA_None,isSens,100},
{0,0,0,0,0}
};
...
vStatusPane myStatusPane = new vStatusPane(sbar); // construct
AddPane(myStatusPane);
See Also