]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/statusbr.tex
Documented wxListCtrl::GetColumnCount
[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
954b8ae6
JS
11\wxheading{Derived from}
12
13\helpref{wxWindow}{wxwindow}\\
14\helpref{wxEvtHandler}{wxevthandler}\\
15\helpref{wxObject}{wxobject}
16
17\wxheading{Include files}
18
19<wx/statusbr.h>
20
a660d684
KB
21\wxheading{Window styles}
22
81d66cf3
JS
23\twocolwidtha{5cm}
24\begin{twocollist}\itemsep=0pt
9ef63a4a 25\twocolitem{\windowstyle{wxST\_SIZEGRIP}}{On Windows 95, displays a gripper at right-hand side of
81d66cf3
JS
26the status bar.}
27\end{twocollist}
a660d684
KB
28
29See also \helpref{window styles overview}{windowstyles}.
30
31\wxheading{Remarks}
32
33It is possible to create controls and other windows on the status bar. Position these windows
34from an {\bf OnSize} event handler.
35
36\wxheading{See also}
37
2286341c 38\helpref{wxFrame}{wxframe}, \helpref{Status bar sample}{samplestatbar}
a660d684
KB
39
40\latexignore{\rtfignore{\wxheading{Members}}}
41
42\membersection{wxStatusBar::wxStatusBar}\label{wxstatusbarconstr}
43
44\func{}{wxStatusBar}{\void}
45
46Default constructor.
47
eaaa6a06 48\func{}{wxStatusBar}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
594f942c 49\param{long}{ style = wxST\_SIZEGRIP},\rtfsp
a660d684
KB
50\param{const wxString\& }{name = ``statusBar"}}
51
52Constructor, creating the window.
53
54\wxheading{Parameters}
55
56\docparam{parent}{The window parent, usually a frame.}
57
58\docparam{id}{The window identifier. It may take a value of -1 to indicate a default value.}
59
a660d684
KB
60\docparam{style}{The window style. See \helpref{wxStatusBar}{wxstatusbar}.}
61
62\docparam{name}{The name of the window. This parameter is used to associate a name with the item,
63allowing the application user to set Motif resource values for
64individual windows.}
65
66\wxheading{See also}
67
68\helpref{wxStatusBar::Create}{wxstatusbarcreate}
69
70\membersection{wxStatusBar::\destruct{wxStatusBar}}
71
72\func{void}{\destruct{wxStatusBar}}{\void}
73
74Destructor.
75
76\membersection{wxStatusBar::Create}\label{wxstatusbarcreate}
77
eaaa6a06 78\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id},\rtfsp
594f942c 79\param{long}{ style = wxST\_SIZEGRIP},\rtfsp
a660d684
KB
80\param{const wxString\& }{name = ``statusBar"}}
81
82Creates the window, for two-step construction.
83
84See \helpref{wxStatusBar::wxStatusBar}{wxstatusbarconstr} for details.
85
86\membersection{wxStatusBar::GetFieldRect}\label{wxstatusbargetfieldrect}
87
eaaa6a06 88\constfunc{virtual bool}{GetFieldRect}{\param{int}{ i}, \param{wxRect\&}{ rect}}
a660d684
KB
89
90Returns the size and position of a fields internal bounding rectangle.
91
92\wxheading{Parameters}
93
94\docparam{i}{The field in question.}
95
96\docparam{rect}{The rectangle values are placed in this variable.}
97
98\wxheading{Return value}
99
100TRUE if the field index is valid, FALSE otherwise.
101
102\wxheading{See also}
103
104\helpref{wxRect}{wxrect}
105
0a67eeac
MB
106\perlnote{In wxPerl this function returns a {\tt Wx::Rect} if the field
107 index is valid, {\tt undef} otherwise.}
108
a660d684
KB
109\membersection{wxStatusBar::GetFieldsCount}\label{wxstatusbargetfieldscount}
110
111\constfunc{int}{GetFieldsCount}{\void}
112
113Returns the number of fields in the status bar.
114
115\membersection{wxStatusBar::GetStatusText}\label{wxstatusbargetstatustext}
116
eaaa6a06 117\constfunc{virtual wxString}{GetStatusText}{\param{int}{ ir = 0}}
a660d684
KB
118
119Returns the string associated with a status bar field.
120
121\wxheading{Parameters}
122
123\docparam{i}{The number of the status field to retrieve, starting from zero.}
124
125\wxheading{Return value}
126
127The status field string if the field is valid, otherwise the empty string.
128
129\wxheading{See also}
130
131\helpref{wxStatusBar::SetStatusText}{wxstatusbarsetstatustext}
132
d1f1e77a
MB
133\membersection{wxStatusBar::PopStatusText}\label{wxstatusbarpushstatustext}
134
135\func{void}{PopStatusText}{\param{int}{ field = 0}}
136
137Sets the field text to the top of the stack, and pops the stack of saved
138strings.
139
140\wxheading{See also}
141
142\helpref{wxStatusBar::PushStatusText}{wxstatusbarpushstatustext}
143
144\membersection{wxStatusBar::PushStatusText}\label{wxstatusbarpushstatustext}
145
146\func{void}{PushStatusText}{\param{const wxString&}{ string}, \param{int}{ field = 0}}
147
148Saves the current field text in a per field stack, and sets the field text
149to the string passed as argument.
150
71e03035
VZ
151%% VZ: these functions are not in wxStatusBar API, these are just
152%% implementation details of wxStatusBarGeneric
153%%
154%% \membersection{wxStatusBar::DrawField}\label{wxstatusbardrawfield}
155%%
156%% \func{virtual void}{DrawField}{\param{wxDC\& }{dc}, \param{int }{i}}
157%%
158%% Draws a field, including shaded borders and text.
159%%
160%% \wxheading{Parameters}
161%%
162%% \docparam{dc}{The device context to draw onto.}
163%%
164%% \docparam{i}{The field to be drawn.}
165%%
166%% \wxheading{See also}
167%%
168%% \helpref{wxStatusBar::DrawFieldText}{wxstatusbardrawfieldtext}
169%%
170%% \membersection{wxStatusBar::DrawFieldText}\label{wxstatusbardrawfieldtext}
171%%
172%% \func{virtual void}{DrawFieldText}{\param{wxDC\& }{dc}, \param{int }{i}}
173%%
174%% Draws a field's text.
175%%
176%% \wxheading{Parameters}
177%%
178%% \docparam{dc}{The device context to draw onto.}
179%%
180%% \docparam{i}{The field whose text is to be drawn.}
181%%
182%% \wxheading{See also}
183%%
184%% \helpref{wxStatusBar::DrawField}{wxstatusbardrawfield}
185%%
186%% \membersection{wxStatusBar::InitColours}\label{wxstatusbarinitcolours}
187%%
188%% \func{virtual void}{InitColours}{\void}
189%%
190%% Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
191%% of grey (other platforms).
192%%
193%% \wxheading{Remarks}
194%%
195%% This function is called when the window is created, and also
196%% from \helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged} on Windows.
197%%
198%% \wxheading{See also}
199%%
200%% \helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged}
201%%
202%% \membersection{wxStatusBar::OnSysColourChanged}\label{wxstatusbaronsyscolourchanged}
203%%
204%% \func{void}{OnSysColourChanged}{\param{wxSysColourChangedEvent\& }{event}}
205%%
206%% Handles a system colour change by calling \helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours},
207%% and refreshes the window.
208%%
209%% \wxheading{Parameters}
210%%
211%% \docparam{event}{The colour change event.}
212%%
213%% \wxheading{See also}
214%%
215%% \helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours}
a660d684
KB
216
217\membersection{wxStatusBar::SetFieldsCount}\label{wxstatusbarsetfieldscount}
218
eaaa6a06 219\func{virtual void}{SetFieldsCount}{\param{int}{ number = 1}, \param{int* }{widths = NULL}}
a660d684
KB
220
221Sets the number of fields, and optionally the field widths.
222
f6bcfd97
BP
223\pythonnote{Only the first parameter is accepted. Use SetStatusWidths
224to set the widths of the fields.}
225
2edb0bde 226\perlnote{In wxPerl this function accepts only the {\tt n} parameter.
5873607e
VZ
227Use SetStatusWidths to set the field widths.}
228
a660d684
KB
229\wxheading{Parameters}
230
231\docparam{number}{The number of fields.}
232
233\docparam{widths}{An array of {\it n} integers, each of which is a status field width
234in pixels. A value of -1 indicates that the field is variable width; at least one
235field must be -1.}
236
2531c7e3
VZ
237\membersection{wxStatusBar::SetMinHeight}\label{wxstatusbarsetminheight}
238
239\func{void}{SetMinHeight}{\param{int}{ height}}
240
241Sets the minimal possible hight for the status bar. The real height may be
242bigger than the height specified here depending on the size of the font used by
243the status bar.
244
a660d684
KB
245\membersection{wxStatusBar::SetStatusText}\label{wxstatusbarsetstatustext}
246
eaaa6a06 247\func{virtual void}{SetStatusText}{\param{const wxString\& }{text}, \param{int}{ i = 0}}
a660d684
KB
248
249Sets the text for one field.
250
251\wxheading{Parameters}
252
253\docparam{text}{The text to be set. Use an empty string (``") to clear the field.}
254
255\docparam{i}{The field to set, starting from zero.}
256
257\wxheading{See also}
258
259\helpref{wxStatusBar::GetStatusText}{wxstatusbargetstatustext}, \helpref{wxFrame::SetStatusText}{wxframesetstatustext}
260
261\membersection{wxStatusBar::SetStatusWidths}\label{wxstatusbarsetstatuswidths}
262
eaaa6a06 263\func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}}
a660d684 264
71e03035
VZ
265Sets the widths of the fields in the status line. There are two types of
266fields: fixed widths one and variable width fields. For the fixed width fields
267you should specify their (constant) width in pixels. For the variable width
268fields, specify a negative number which indicates how should the field expand:
269the space left for all variable width fields is divided between them according
270to the absolute value of this number. A variable width field with width of $-2$
271gets twice as much of it as a field with width $-1$ and so on.
272
273For example, to create one fixed width field of width $50$ in the right part of
274the status bar and two more fields which get $66$\% and $33$\% of the remaining
275space correspondingly, you should use an array containing $-2$, $-1$ and $100$.
a660d684
KB
276
277\wxheading{Parameters}
278
71e03035
VZ
279\docparam{n}{The number of fields in the status bar. Must be equal to the
280number passed to \helpref{SetFieldsCount}{wxstatusbarsetfieldscount} the last
281time it was called.}
a660d684 282
71e03035
VZ
283\docparam{widths}{Contains an array of {\it n} integers, each of which is
284either an absolute status field width in pixels if positive or indicates a
285variable width field if negative}
a660d684
KB
286
287\wxheading{Remarks}
288
289The widths of the variable fields are calculated from the total width of all fields,
564747ee 290minus the sum of widths of the non-variable fields, divided by the number of
a660d684
KB
291variable fields.
292
293\wxheading{See also}
294
295\helpref{wxStatusBar::SetFieldsCount}{wxstatusbarsetfieldscount}, \helpref{wxFrame::SetStatusWidths}{wxframesetstatuswidths}
296
564747ee
RD
297\pythonnote{Only a single parameter is required, a Python list of
298integers.}
299
5873607e 300\perlnote{In wxPerl this method takes as parameters the field widths.}
a98f98ac 301