]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/statusbr.tex
add wxSYS_DCLICK_TIME system metric constant; use it for the generic list control...
[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
a7af285d
VZ
21\wxheading{Library}
22
23\helpref{wxCore}{librarieslist}
24
a660d684
KB
25\wxheading{Window styles}
26
81d66cf3
JS
27\twocolwidtha{5cm}
28\begin{twocollist}\itemsep=0pt
9ef63a4a 29\twocolitem{\windowstyle{wxST\_SIZEGRIP}}{On Windows 95, displays a gripper at right-hand side of
81d66cf3
JS
30the status bar.}
31\end{twocollist}
a660d684
KB
32
33See also \helpref{window styles overview}{windowstyles}.
34
35\wxheading{Remarks}
36
37It is possible to create controls and other windows on the status bar. Position these windows
38from an {\bf OnSize} event handler.
39
40\wxheading{See also}
41
2286341c 42\helpref{wxFrame}{wxframe}, \helpref{Status bar sample}{samplestatbar}
a660d684
KB
43
44\latexignore{\rtfignore{\wxheading{Members}}}
45
15d83f72 46\membersection{wxStatusBar::wxStatusBar}\label{wxstatusbarctor}
a660d684
KB
47
48\func{}{wxStatusBar}{\void}
49
50Default constructor.
51
53b6d7a2 52\func{}{wxStatusBar}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY},\rtfsp
594f942c 53\param{long}{ style = wxST\_SIZEGRIP},\rtfsp
a660d684
KB
54\param{const wxString\& }{name = ``statusBar"}}
55
56Constructor, creating the window.
57
58\wxheading{Parameters}
59
60\docparam{parent}{The window parent, usually a frame.}
61
62\docparam{id}{The window identifier. It may take a value of -1 to indicate a default value.}
63
a660d684
KB
64\docparam{style}{The window style. See \helpref{wxStatusBar}{wxstatusbar}.}
65
66\docparam{name}{The name of the window. This parameter is used to associate a name with the item,
67allowing the application user to set Motif resource values for
68individual windows.}
69
70\wxheading{See also}
71
72\helpref{wxStatusBar::Create}{wxstatusbarcreate}
73
15d83f72 74\membersection{wxStatusBar::\destruct{wxStatusBar}}\label{wxstatusbardtor}
a660d684
KB
75
76\func{void}{\destruct{wxStatusBar}}{\void}
77
78Destructor.
79
80\membersection{wxStatusBar::Create}\label{wxstatusbarcreate}
81
53b6d7a2 82\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY},\rtfsp
594f942c 83\param{long}{ style = wxST\_SIZEGRIP},\rtfsp
a660d684
KB
84\param{const wxString\& }{name = ``statusBar"}}
85
86Creates the window, for two-step construction.
87
15d83f72 88See \helpref{wxStatusBar::wxStatusBar}{wxstatusbarctor} for details.
a660d684
KB
89
90\membersection{wxStatusBar::GetFieldRect}\label{wxstatusbargetfieldrect}
91
eaaa6a06 92\constfunc{virtual bool}{GetFieldRect}{\param{int}{ i}, \param{wxRect\&}{ rect}}
a660d684 93
d3c17ee7 94Returns the size and position of a field's internal bounding rectangle.
a660d684
KB
95
96\wxheading{Parameters}
97
98\docparam{i}{The field in question.}
99
100\docparam{rect}{The rectangle values are placed in this variable.}
101
102\wxheading{Return value}
103
cc81d32f 104true if the field index is valid, false otherwise.
a660d684
KB
105
106\wxheading{See also}
107
108\helpref{wxRect}{wxrect}
109
0a67eeac
MB
110\perlnote{In wxPerl this function returns a {\tt Wx::Rect} if the field
111 index is valid, {\tt undef} otherwise.}
112
a660d684
KB
113\membersection{wxStatusBar::GetFieldsCount}\label{wxstatusbargetfieldscount}
114
115\constfunc{int}{GetFieldsCount}{\void}
116
117Returns the number of fields in the status bar.
118
119\membersection{wxStatusBar::GetStatusText}\label{wxstatusbargetstatustext}
120
d3c17ee7 121\constfunc{virtual wxString}{GetStatusText}{\param{int}{ i = 0}}
a660d684
KB
122
123Returns the string associated with a status bar field.
124
125\wxheading{Parameters}
126
127\docparam{i}{The number of the status field to retrieve, starting from zero.}
128
129\wxheading{Return value}
130
131The status field string if the field is valid, otherwise the empty string.
132
133\wxheading{See also}
134
135\helpref{wxStatusBar::SetStatusText}{wxstatusbarsetstatustext}
136
0b0625e9 137\membersection{wxStatusBar::PopStatusText}\label{wxstatusbarpopstatustext}
d1f1e77a
MB
138
139\func{void}{PopStatusText}{\param{int}{ field = 0}}
140
141Sets the field text to the top of the stack, and pops the stack of saved
142strings.
143
144\wxheading{See also}
145
146\helpref{wxStatusBar::PushStatusText}{wxstatusbarpushstatustext}
147
148\membersection{wxStatusBar::PushStatusText}\label{wxstatusbarpushstatustext}
149
bf43ff9a 150\func{void}{PushStatusText}{\param{const wxString\&}{ string}, \param{int}{ field = 0}}
d1f1e77a
MB
151
152Saves the current field text in a per field stack, and sets the field text
153to the string passed as argument.
154
a660d684
KB
155\membersection{wxStatusBar::SetFieldsCount}\label{wxstatusbarsetfieldscount}
156
eaaa6a06 157\func{virtual void}{SetFieldsCount}{\param{int}{ number = 1}, \param{int* }{widths = NULL}}
a660d684
KB
158
159Sets the number of fields, and optionally the field widths.
160
f6bcfd97
BP
161\pythonnote{Only the first parameter is accepted. Use SetStatusWidths
162to set the widths of the fields.}
163
2edb0bde 164\perlnote{In wxPerl this function accepts only the {\tt n} parameter.
5873607e
VZ
165Use SetStatusWidths to set the field widths.}
166
a660d684
KB
167\wxheading{Parameters}
168
169\docparam{number}{The number of fields.}
170
390015c0
VZ
171\docparam{widths}{An array of {\it n} integers interpreted in the same way as
172in \helpref{SetStatusWidths}{wxstatusbarsetstatuswidths}}
a660d684 173
2531c7e3
VZ
174\membersection{wxStatusBar::SetMinHeight}\label{wxstatusbarsetminheight}
175
176\func{void}{SetMinHeight}{\param{int}{ height}}
177
d3c17ee7 178Sets the minimal possible height for the status bar. The real height may be
2531c7e3
VZ
179bigger than the height specified here depending on the size of the font used by
180the status bar.
181
a660d684
KB
182\membersection{wxStatusBar::SetStatusText}\label{wxstatusbarsetstatustext}
183
eaaa6a06 184\func{virtual void}{SetStatusText}{\param{const wxString\& }{text}, \param{int}{ i = 0}}
a660d684
KB
185
186Sets the text for one field.
187
188\wxheading{Parameters}
189
190\docparam{text}{The text to be set. Use an empty string (``") to clear the field.}
191
192\docparam{i}{The field to set, starting from zero.}
193
194\wxheading{See also}
195
196\helpref{wxStatusBar::GetStatusText}{wxstatusbargetstatustext}, \helpref{wxFrame::SetStatusText}{wxframesetstatustext}
197
198\membersection{wxStatusBar::SetStatusWidths}\label{wxstatusbarsetstatuswidths}
199
eaaa6a06 200\func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}}
a660d684 201
71e03035
VZ
202Sets the widths of the fields in the status line. There are two types of
203fields: fixed widths one and variable width fields. For the fixed width fields
204you should specify their (constant) width in pixels. For the variable width
43e8916f 205fields, specify a negative number which indicates how the field should expand:
71e03035
VZ
206the space left for all variable width fields is divided between them according
207to the absolute value of this number. A variable width field with width of $-2$
208gets twice as much of it as a field with width $-1$ and so on.
209
304945f5 210For example, to create one fixed width field of width $100$ in the right part of
71e03035
VZ
211the status bar and two more fields which get $66$\% and $33$\% of the remaining
212space correspondingly, you should use an array containing $-2$, $-1$ and $100$.
a660d684
KB
213
214\wxheading{Parameters}
215
71e03035
VZ
216\docparam{n}{The number of fields in the status bar. Must be equal to the
217number passed to \helpref{SetFieldsCount}{wxstatusbarsetfieldscount} the last
218time it was called.}
a660d684 219
71e03035
VZ
220\docparam{widths}{Contains an array of {\it n} integers, each of which is
221either an absolute status field width in pixels if positive or indicates a
43e8916f 222variable width field if negative.}
a660d684
KB
223
224\wxheading{Remarks}
225
226The widths of the variable fields are calculated from the total width of all fields,
564747ee 227minus the sum of widths of the non-variable fields, divided by the number of
a660d684
KB
228variable fields.
229
230\wxheading{See also}
231
232\helpref{wxStatusBar::SetFieldsCount}{wxstatusbarsetfieldscount}, \helpref{wxFrame::SetStatusWidths}{wxframesetstatuswidths}
233
564747ee
RD
234\pythonnote{Only a single parameter is required, a Python list of
235integers.}
236
5873607e 237\perlnote{In wxPerl this method takes as parameters the field widths.}
a98f98ac 238
c2919ab3
VZ
239\membersection{wxStatusBar::SetStatusStyles}\label{wxstatusbarsetstatusstyles}
240
241\func{virtual void}{SetStatusStyles}{\param{int}{ n}, \param{int *}{styles}}
242
243Sets the styles of the fields in the status line which can make fields appear flat
244or raised instead of the standard sunken 3D border.
245
246\wxheading{Parameters}
247
248\docparam{n}{The number of fields in the status bar. Must be equal to the
249number passed to \helpref{SetFieldsCount}{wxstatusbarsetfieldscount} the last
250time it was called.}
251
252\docparam{styles}{Contains an array of {\it n} integers with the styles for each field. There
253are three possible styles:
254
255\twocolwidtha{5cm}
256\begin{twocollist}\itemsep=0pt
257\twocolitem{\windowstyle{wxSB\_NORMAL}}{(default) The field appears sunken with a standard 3D border.}
258\twocolitem{\windowstyle{wxSB\_FLAT}}{No border is painted around the field so that it appears flat.}
259\twocolitem{\windowstyle{wxSB\_RAISED}}{A raised 3D border is painted around the field.}
260\end{twocollist}
6f63b8ad 261}
c2919ab3
VZ
262
263