Jump to content

VStatus: Difference between revisions

From EDM2
Ak120 (talk | contribs)
m -font
Line 2: Line 2:


==Synopsis==
==Synopsis==
; '''Header:'''
; '''Header:'''
: <tt>[vquickr.htm#vStatus <v/v_defs.h>]</tt>
: <tt>[vquickr.htm#vStatus <v/v_defs.h>]</tt>
Line 11: Line 10:


==Description==
==Description==
The <tt>vStatus</tt> structure is used to define the top level status bar included on a <tt>vCmdWindow</tt>, and the labels it contains. The <tt>vStatus</tt> array is usually passed to the <tt>vStatusPane</tt> constructor. See the section <tt>vPane</tt> for a general description of panes.
The <tt>vStatus</tt> structure is used to define the top level status bar included on a <tt>vCmdWindow</tt>, and the labels it contains. The <tt>vStatus</tt> array is usually passed to the <tt>vStatusPane</tt> constructor. See the section <tt>vPane</tt> for a general description of panes.


==Definition==
==Definition==
<font size="-2"> </font>
  typedef struct vStatus      // for status bars
  typedef struct vStatus      // for status bars
   {
   {
Line 27: Line 21:
     int width;              // to specify width (0 for default)
     int width;              // to specify width (0 for default)
   } vButton;
   } vButton;
<font size="+0"> </font>


==Structure Members==
==Structure Members==
char* label Text of label field. See the description of the <tt>vWindow</tt> class for information on changing the text of a label.
char* label Text of label field. See the description of the <tt>vWindow</tt> class for information on changing the text of a label.


Line 43: Line 34:


===Example===
===Example===
This shows a sample status bar with two fields. It is added to a <tt>vCmdWindow</tt> using <tt>AddPane</tt>. The value of the file name would be changed by calling <tt>SetString(m_curFile, filename)</tt> somewhere in your program.
This shows a sample status bar with two fields. It is added to a <tt>vCmdWindow</tt> using <tt>AddPane</tt>. The value of the file name would be changed by calling <tt>SetString(m_curFile, filename)</tt> somewhere in your program.


<font size="-1">[[Image:v-gui-statbar.gif]]<br /><font size="+0"><font size="-2"> </font></font></font>
[[Image:v-gui-statbar.gif]]


  static vStatus sbar[] =
  static vStatus sbar[] =
   {
   {
Line 58: Line 47:
   vStatusPane myStatusPane = new vStatusPane(sbar); // construct
   vStatusPane myStatusPane = new vStatusPane(sbar); // construct
   AddPane(myStatusPane);
   AddPane(myStatusPane);
<font size="+0"> </font>


==See Also==
==See Also==
vWindow, vPane


[vwindow.htm vWindow], [vpane.htm vPane]
[[Category:V C++ GUI Framework]]
 
[[Category:Tools Articles]]

Revision as of 17:58, 1 March 2017

Used to define label fields on a status bar.

Synopsis

Header:
[vquickr.htm#vStatus <v/v_defs.h>]
Type name:
vStatus
Used by:
[vwindow.htm vWindow]

Description

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.

Definition

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

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.

Example

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.

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

vWindow, vPane