Jump to content

VStatus: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


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


==Description==
==Description==
Line 23: Line 20:


==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.
 
;ItemVal id:Id for the label. Use this value when changing value with <tt>SetString</tt> or <tt>SetValue</tt>.
ItemVal id Id for the label. Use this value when changing value with <tt>SetString</tt> or <tt>SetValue</tt>.
;CmdAttribute attrs:The current implementation only uses the <tt>CA_NoBorder</tt> attribute. If <tt>CA_NoBorder</tt> is supplied, the label will be drawn on the command bar without a border or box around it. Not supplying <tt>CA_NoBorder</tt> (e.g., <tt>CA_None</tt>) 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 <tt>isSens</tt> and <tt>notSens</tt> to specify the initial state. On some implementations, the label will be grayed if it is insensitive. The sensitivity can be changed using <tt>vWindow::SetValue</tt> as described in the section <tt>vWindow</tt>.
CmdAttribute attrs The current implementation only uses the <tt>CA_NoBorder</tt> attribute. If <tt>CA_NoBorder</tt> is supplied, the label will be drawn on the command bar without a border or box around it. Not supplying <tt>CA_NoBorder</tt> (e.g., <tt>CA_None</tt>) 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 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.
 
int sensitive If label is sensitive or not. Use predefined symbols <tt>isSens</tt> and <tt>notSens</tt> to specify the initial state. On some implementations, the label will be grayed if it is insensitive. The sensitivity can be changed using <tt>vWindow::SetValue</tt> as described in the section <tt>vWindow</tt>.
 
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===
===Example===

Latest revision as of 22:43, 9 April 2020

Used to define label fields on a status bar.

Synopsis

Header
<v/v_defs.h>
Type name
vStatus
Used by
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