]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/statusbr.tex
added wxNode::IndexOf and wxList::IndexOf (patch by Frank McIngvale)
[wxWidgets.git] / docs / latex / wx / statusbr.tex
CommitLineData
a660d684
KB
1\section{\class{wxStatusBar}}\label{wxstatusbar}
2
3A status bar is a narrow window that can be placed along the bottom of a frame to give
4small amounts of status information. It can contain one or more fields, one or more of which can
5be variable length according to the size of the window.
6
7\helpref{wxWindow}{wxwindow}\\
8\helpref{wxEvtHandler}{wxevthandler}\\
9\helpref{wxObject}{wxobject}
10
11\wxheading{Window styles}
12
81d66cf3
JS
13\twocolwidtha{5cm}
14\begin{twocollist}\itemsep=0pt
15\twocolitem{\windowstyle{wxSB\_SIZEGRIP}}{On Windows 95, displays a gripper at right-hand side of
16the status bar.}
17\end{twocollist}
a660d684
KB
18
19See also \helpref{window styles overview}{windowstyles}.
20
21\wxheading{Remarks}
22
23It is possible to create controls and other windows on the status bar. Position these windows
24from an {\bf OnSize} event handler.
25
26\wxheading{See also}
27
28\helpref{wxFrame}{wxframe}
29
30\latexignore{\rtfignore{\wxheading{Members}}}
31
32\membersection{wxStatusBar::wxStatusBar}\label{wxstatusbarconstr}
33
34\func{}{wxStatusBar}{\void}
35
36Default constructor.
37
eaaa6a06 38\func{}{wxStatusBar}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
a660d684
KB
39\param{const wxPoint\&}{ pos = wxDefaultPosition},\rtfsp
40\param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp
41\param{const wxString\& }{name = ``statusBar"}}
42
43Constructor, creating the window.
44
45\wxheading{Parameters}
46
47\docparam{parent}{The window parent, usually a frame.}
48
49\docparam{id}{The window identifier. It may take a value of -1 to indicate a default value.}
50
51\docparam{pos}{The window position. A value of (-1, -1) indicates a default position, chosen by
52either the windowing system or wxWindows, depending on platform.}
53
54\docparam{size}{The window size. A value of (-1, -1) indicates a default size, chosen by
55either the windowing system or wxWindows, depending on platform.}
56
57\docparam{style}{The window style. See \helpref{wxStatusBar}{wxstatusbar}.}
58
59\docparam{name}{The name of the window. This parameter is used to associate a name with the item,
60allowing the application user to set Motif resource values for
61individual windows.}
62
63\wxheading{See also}
64
65\helpref{wxStatusBar::Create}{wxstatusbarcreate}
66
67\membersection{wxStatusBar::\destruct{wxStatusBar}}
68
69\func{void}{\destruct{wxStatusBar}}{\void}
70
71Destructor.
72
73\membersection{wxStatusBar::Create}\label{wxstatusbarcreate}
74
eaaa6a06 75\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
a660d684
KB
76\param{const wxPoint\&}{ pos = wxDefaultPosition},\rtfsp
77\param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp
78\param{const wxString\& }{name = ``statusBar"}}
79
80Creates the window, for two-step construction.
81
82See \helpref{wxStatusBar::wxStatusBar}{wxstatusbarconstr} for details.
83
84\membersection{wxStatusBar::GetFieldRect}\label{wxstatusbargetfieldrect}
85
eaaa6a06 86\constfunc{virtual bool}{GetFieldRect}{\param{int}{ i}, \param{wxRect\&}{ rect}}
a660d684
KB
87
88Returns the size and position of a fields internal bounding rectangle.
89
90\wxheading{Parameters}
91
92\docparam{i}{The field in question.}
93
94\docparam{rect}{The rectangle values are placed in this variable.}
95
96\wxheading{Return value}
97
98TRUE if the field index is valid, FALSE otherwise.
99
100\wxheading{See also}
101
102\helpref{wxRect}{wxrect}
103
104\membersection{wxStatusBar::GetFieldsCount}\label{wxstatusbargetfieldscount}
105
106\constfunc{int}{GetFieldsCount}{\void}
107
108Returns the number of fields in the status bar.
109
110\membersection{wxStatusBar::GetStatusText}\label{wxstatusbargetstatustext}
111
eaaa6a06 112\constfunc{virtual wxString}{GetStatusText}{\param{int}{ ir = 0}}
a660d684
KB
113
114Returns the string associated with a status bar field.
115
116\wxheading{Parameters}
117
118\docparam{i}{The number of the status field to retrieve, starting from zero.}
119
120\wxheading{Return value}
121
122The status field string if the field is valid, otherwise the empty string.
123
124\wxheading{See also}
125
126\helpref{wxStatusBar::SetStatusText}{wxstatusbarsetstatustext}
127
128\membersection{wxStatusBar::DrawField}\label{wxstatusbardrawfield}
129
eaaa6a06 130\func{virtual void}{DrawField}{\param{wxDC\& }{dc}, \param{int }{i}}
a660d684
KB
131
132Draws a field, including shaded borders and text.
133
134\wxheading{Parameters}
135
136\docparam{dc}{The device context to draw onto.}
137
138\docparam{i}{The field to be drawn.}
139
140\wxheading{See also}
141
142\helpref{wxStatusBar::DrawFieldText}{wxstatusbardrawfieldtext}
143
144\membersection{wxStatusBar::DrawFieldText}\label{wxstatusbardrawfieldtext}
145
eaaa6a06 146\func{virtual void}{DrawFieldText}{\param{wxDC\& }{dc}, \param{int }{i}}
a660d684
KB
147
148Draws a field's text.
149
150\wxheading{Parameters}
151
152\docparam{dc}{The device context to draw onto.}
153
154\docparam{i}{The field whose text is to be drawn.}
155
156\wxheading{See also}
157
158\helpref{wxStatusBar::DrawField}{wxstatusbardrawfield}
159
160\membersection{wxStatusBar::InitColours}\label{wxstatusbarinitcolours}
161
162\func{virtual void}{InitColours}{\void}
163
164Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
165of grey (other platforms).
166
167\wxheading{Remarks}
168
169This function is called when the window is created, and also
170from \helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged} on Windows.
171
172\wxheading{See also}
173
174\helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged}
175
176\membersection{wxStatusBar::OnSysColourChanged}\label{wxstatusbaronsyscolourchanged}
177
178\func{void}{OnSysColourChanged}{\param{wxSysColourChangedEvent\& }{event}}
179
180Handles a system colour change by calling \helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours},
181and refreshes the window.
182
183\wxheading{Parameters}
184
185\docparam{event}{The colour change event.}
186
187\wxheading{See also}
188
189\helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours}
190
191\membersection{wxStatusBar::SetFieldsCount}\label{wxstatusbarsetfieldscount}
192
eaaa6a06 193\func{virtual void}{SetFieldsCount}{\param{int}{ number = 1}, \param{int* }{widths = NULL}}
a660d684
KB
194
195Sets the number of fields, and optionally the field widths.
196
197\wxheading{Parameters}
198
199\docparam{number}{The number of fields.}
200
201\docparam{widths}{An array of {\it n} integers, each of which is a status field width
202in pixels. A value of -1 indicates that the field is variable width; at least one
203field must be -1.}
204
205\membersection{wxStatusBar::SetStatusText}\label{wxstatusbarsetstatustext}
206
eaaa6a06 207\func{virtual void}{SetStatusText}{\param{const wxString\& }{text}, \param{int}{ i = 0}}
a660d684
KB
208
209Sets the text for one field.
210
211\wxheading{Parameters}
212
213\docparam{text}{The text to be set. Use an empty string (``") to clear the field.}
214
215\docparam{i}{The field to set, starting from zero.}
216
217\wxheading{See also}
218
219\helpref{wxStatusBar::GetStatusText}{wxstatusbargetstatustext}, \helpref{wxFrame::SetStatusText}{wxframesetstatustext}
220
221\membersection{wxStatusBar::SetStatusWidths}\label{wxstatusbarsetstatuswidths}
222
eaaa6a06 223\func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}}
a660d684
KB
224
225Sets the widths of the fields in the status line.
226
227\wxheading{Parameters}
228
229\docparam{n}{The number of fields in the status bar.}
230
231\docparam{widths}{Must contain an array of {\it n} integers, each of which is a status field width
232in pixels. A value of -1 indicates that the field is variable width; at least one
233field must be -1. You should delete this array after calling {\bf SetStatusWidths}.}
234
235\wxheading{Remarks}
236
237The widths of the variable fields are calculated from the total width of all fields,
238minus the sum of widths of the non-variable fields, divided by the number of
239variable fields.
240
241\wxheading{See also}
242
243\helpref{wxStatusBar::SetFieldsCount}{wxstatusbarsetfieldscount}, \helpref{wxFrame::SetStatusWidths}{wxframesetstatuswidths}
244
245