VStatus: Difference between revisions
Appearance
mNo edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
==Synopsis== | ==Synopsis== | ||
;Header: <tt><v/v_defs.h></tt> | |||
; | ;Type name: vStatus | ||
: <tt> | ;Used by: [[vWindow]] | ||
; | |||
: vStatus | |||
; | |||
==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== | ||
typedef struct vStatus // for status bars | typedef struct vStatus // for status bars | ||
{ | { | ||
Line 27: | Line 18: | ||
int width; // to specify width (0 for default) | int width; // to specify width (0 for default) | ||
} vButton; | } vButton; | ||
==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>. | ||
;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. | |||
ItemVal id Id for the label. Use this value when changing value with <tt>SetString</tt> or <tt>SetValue</tt>. | ;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. | |||
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>. | |||
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=== | ||
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. | ||
[[Image:v-gui-statbar.gif]] | |||
static vStatus sbar[] = | static vStatus sbar[] = | ||
{ | { | ||
Line 58: | Line 40: | ||
vStatusPane myStatusPane = new vStatusPane(sbar); // construct | vStatusPane myStatusPane = new vStatusPane(sbar); // construct | ||
AddPane(myStatusPane); | AddPane(myStatusPane); | ||
==See Also== | ==See Also== | ||
vWindow, vPane | |||
[[Category:V C++ GUI Framework]] | |||
[[Category: |
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