File: wx221.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (275 lines) | stat: -rw-r--r-- 10,727 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<HTML>
<head><title>wxStatusBar</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxstatusbar"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx220.htm#wxstatictext"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx222.htm#wxstreambase"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxStatusBar</H2>
<P>
A status bar is a narrow window that can be placed along the bottom of a frame to give
small amounts of status information. It can contain one or more fields, one or more of which can
be variable length according to the size of the window.<P>
<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>

<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>

<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/statusbr.h&gt;<P>
<B><FONT COLOR="#FF0000">Window styles</FONT></B><P>


<TABLE>


<TR><TD VALIGN=TOP>
<B>wxSB_SIZEGRIP</B>
</TD>

<TD VALIGN=TOP>
On Windows 95, displays a gripper at right-hand side of
the status bar.
</TD></TR>


</TABLE>
<P>
See also <A HREF="wx305.htm#windowstyles">window styles overview</A>.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
It is possible to create controls and other windows on the status bar. Position these windows
from an <B>OnSize</B> event handler.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx104.htm#wxframe">wxFrame</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxstatusbarconstr">wxStatusBar::wxStatusBar</A><BR>
<A HREF="#topic846">wxStatusBar::~wxStatusBar</A><BR>
<A HREF="#wxstatusbarcreate">wxStatusBar::Create</A><BR>
<A HREF="#wxstatusbargetfieldrect">wxStatusBar::GetFieldRect</A><BR>
<A HREF="#wxstatusbargetfieldscount">wxStatusBar::GetFieldsCount</A><BR>
<A HREF="#wxstatusbargetstatustext">wxStatusBar::GetStatusText</A><BR>
<A HREF="#wxstatusbardrawfield">wxStatusBar::DrawField</A><BR>
<A HREF="#wxstatusbardrawfieldtext">wxStatusBar::DrawFieldText</A><BR>
<A HREF="#wxstatusbarinitcolours">wxStatusBar::InitColours</A><BR>
<A HREF="#wxstatusbaronsyscolourchanged">wxStatusBar::OnSysColourChanged</A><BR>
<A HREF="#wxstatusbarsetfieldscount">wxStatusBar::SetFieldsCount</A><BR>
<A HREF="#wxstatusbarsetstatustext">wxStatusBar::SetStatusText</A><BR>
<A HREF="#wxstatusbarsetstatuswidths">wxStatusBar::SetStatusWidths</A><BR>
<P>

<HR>
<A NAME="wxstatusbarconstr"></A>
<H3>wxStatusBar::wxStatusBar</H3>
<P>
<B></B> <B>wxStatusBar</B>()<P>
Default constructor.<P>
<B></B> <B>wxStatusBar</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxPoint&amp;</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&amp;</B><I> size = wxDefaultSize</I>, <B>long</B><I> style = 0</I>,
<B>const wxString&amp; </B><I>name = "statusBar"</I>)<P>
Constructor, creating the window.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>parent</I><UL><UL>
The window parent, usually a frame.</UL></UL>
<P>
<I>id</I><UL><UL>
The window identifier. It may take a value of -1 to indicate a default value.</UL></UL>
<P>
<I>pos</I><UL><UL>
The window position. A value of (-1, -1) indicates a default position, chosen by
either the windowing system or wxWindows, depending on platform.</UL></UL>
<P>
<I>size</I><UL><UL>
The window size. A value of (-1, -1) indicates a default size, chosen by
either the windowing system or wxWindows, depending on platform.</UL></UL>
<P>
<I>style</I><UL><UL>
The window style. See <A HREF="wx221.htm#wxstatusbar">wxStatusBar</A>.</UL></UL>
<P>
<I>name</I><UL><UL>
The name of the window. This parameter is used to associate a name with the item,
allowing the application user to set Motif resource values for
individual windows.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbarcreate">wxStatusBar::Create</A><P>

<HR>
<A NAME="topic846"></A>
<H3>wxStatusBar::~wxStatusBar</H3>
<P>
<B>void</B> <B>~wxStatusBar</B>()<P>
Destructor.<P>

<HR>
<A NAME="wxstatusbarcreate"></A>
<H3>wxStatusBar::Create</H3>
<P>
<B>bool</B> <B>Create</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxPoint&amp;</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&amp;</B><I> size = wxDefaultSize</I>, <B>long</B><I> style = 0</I>,
<B>const wxString&amp; </B><I>name = "statusBar"</I>)<P>
Creates the window, for two-step construction.<P>
See <A HREF="wx221.htm#wxstatusbarconstr">wxStatusBar::wxStatusBar</A> for details.<P>

<HR>
<A NAME="wxstatusbargetfieldrect"></A>
<H3>wxStatusBar::GetFieldRect</H3>
<P>
<B>virtual bool</B> <B>GetFieldRect</B>(<B>int</B><I> i</I>, <B>wxRect&amp;</B><I> rect</I>) <B>const</B><P>
Returns the size and position of a fields internal bounding rectangle.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>i</I><UL><UL>
The field in question.</UL></UL>
<P>
<I>rect</I><UL><UL>
The rectangle values are placed in this variable.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if the field index is valid, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx193.htm#wxrect">wxRect</A><P>

<HR>
<A NAME="wxstatusbargetfieldscount"></A>
<H3>wxStatusBar::GetFieldsCount</H3>
<P>
<B>int</B> <B>GetFieldsCount</B>() <B>const</B><P>
Returns the number of fields in the status bar.<P>

<HR>
<A NAME="wxstatusbargetstatustext"></A>
<H3>wxStatusBar::GetStatusText</H3>
<P>
<B>virtual wxString</B> <B>GetStatusText</B>(<B>int</B><I> ir = 0</I>) <B>const</B><P>
Returns the string associated with a status bar field.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>i</I><UL><UL>
The number of the status field to retrieve, starting from zero.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
The status field string if the field is valid, otherwise the empty string.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbarsetstatustext">wxStatusBar::SetStatusText</A><P>

<HR>
<A NAME="wxstatusbardrawfield"></A>
<H3>wxStatusBar::DrawField</H3>
<P>
<B>virtual void</B> <B>DrawField</B>(<B>wxDC&amp; </B><I>dc</I>, <B>int </B><I>i</I>)<P>
Draws a field, including shaded borders and text.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>dc</I><UL><UL>
The device context to draw onto.</UL></UL>
<P>
<I>i</I><UL><UL>
The field to be drawn.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbardrawfieldtext">wxStatusBar::DrawFieldText</A><P>

<HR>
<A NAME="wxstatusbardrawfieldtext"></A>
<H3>wxStatusBar::DrawFieldText</H3>
<P>
<B>virtual void</B> <B>DrawFieldText</B>(<B>wxDC&amp; </B><I>dc</I>, <B>int </B><I>i</I>)<P>
Draws a field's text.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>dc</I><UL><UL>
The device context to draw onto.</UL></UL>
<P>
<I>i</I><UL><UL>
The field whose text is to be drawn.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbardrawfield">wxStatusBar::DrawField</A><P>

<HR>
<A NAME="wxstatusbarinitcolours"></A>
<H3>wxStatusBar::InitColours</H3>
<P>
<B>virtual void</B> <B>InitColours</B>()<P>
Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
of grey (other platforms).<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
This function is called when the window is created, and also
from <A HREF="wx221.htm#wxstatusbaronsyscolourchanged">wxStatusBar::OnSysColourChanged</A> on Windows.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbaronsyscolourchanged">wxStatusBar::OnSysColourChanged</A><P>

<HR>
<A NAME="wxstatusbaronsyscolourchanged"></A>
<H3>wxStatusBar::OnSysColourChanged</H3>
<P>
<B>void</B> <B>OnSysColourChanged</B>(<B>wxSysColourChangedEvent&amp; </B><I>event</I>)<P>
Handles a system colour change by calling <A HREF="wx221.htm#wxstatusbarinitcolours">wxStatusBar::InitColours</A>,
and refreshes the window.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>event</I><UL><UL>
The colour change event.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbarinitcolours">wxStatusBar::InitColours</A><P>

<HR>
<A NAME="wxstatusbarsetfieldscount"></A>
<H3>wxStatusBar::SetFieldsCount</H3>
<P>
<B>virtual void</B> <B>SetFieldsCount</B>(<B>int</B><I> number = 1</I>, <B>int* </B><I>widths = NULL</I>)<P>
Sets the number of fields, and optionally the field widths.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>number</I><UL><UL>
The number of fields.</UL></UL>
<P>
<I>widths</I><UL><UL>
An array of <I>n</I> integers, each of which is a status field width
in pixels. A value of -1 indicates that the field is variable width; at least one
field must be -1.</UL></UL>
<P>

<HR>
<A NAME="wxstatusbarsetstatustext"></A>
<H3>wxStatusBar::SetStatusText</H3>
<P>
<B>virtual void</B> <B>SetStatusText</B>(<B>const wxString&amp; </B><I>text</I>, <B>int</B><I> i = 0</I>)<P>
Sets the text for one field.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>text</I><UL><UL>
The text to be set. Use an empty string ("") to clear the field.</UL></UL>
<P>
<I>i</I><UL><UL>
The field to set, starting from zero.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbargetstatustext">wxStatusBar::GetStatusText</A>, <A HREF="wx104.htm#wxframesetstatustext">wxFrame::SetStatusText</A><P>

<HR>
<A NAME="wxstatusbarsetstatuswidths"></A>
<H3>wxStatusBar::SetStatusWidths</H3>
<P>
<B>virtual void</B> <B>SetStatusWidths</B>(<B>int</B><I> n</I>, <B>int *</B><I>widths</I>)<P>
Sets the widths of the fields in the status line.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>n</I><UL><UL>
The number of fields in the status bar.</UL></UL>
<P>
<I>widths</I><UL><UL>
Must contain an array of <I>n</I> integers, each of which is a status field width
in pixels. A value of -1 indicates that the field is variable width; at least one
field must be -1. You should delete this array after calling <B>SetStatusWidths</B>.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
The widths of the variable fields are calculated from the total width of all fields,
minus the sum of widths of the non-variable fields, divided by the number of 
variable fields.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx221.htm#wxstatusbarsetfieldscount">wxStatusBar::SetFieldsCount</A>, <A HREF="wx104.htm#wxframesetstatuswidths">wxFrame::SetStatusWidths</A><P>


</BODY></HTML>