1 \section{\class{wxStatusBar
}}\label{wxstatusbar
}
3 A status bar is a narrow window that can be placed along the bottom of a frame to give
4 small amounts of status information. It can contain one or more fields, one or more of which can
5 be variable length according to the size of the window.
7 \helpref{wxWindow
}{wxwindow
}\\
8 \helpref{wxEvtHandler
}{wxevthandler
}\\
9 \helpref{wxObject
}{wxobject
}
11 \wxheading{Window styles
}
14 \begin{twocollist
}\itemsep=
0pt
15 \twocolitem{\windowstyle{wxSB
\_SIZEGRIP}}{On Windows
95, displays a gripper at right-hand side of
19 See also
\helpref{window styles overview
}{windowstyles
}.
23 It is possible to create controls and other windows on the status bar. Position these windows
24 from an
{\bf OnSize
} event handler.
28 \helpref{wxFrame
}{wxframe
}
30 \latexignore{\rtfignore{\wxheading{Members
}}}
32 \membersection{wxStatusBar::wxStatusBar
}\label{wxstatusbarconstr
}
34 \func{}{wxStatusBar
}{\void}
38 \func{}{wxStatusBar
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
39 \param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
40 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style =
0},
\rtfsp
41 \param{const wxString\&
}{name = ``statusBar"
}}
43 Constructor, creating the window.
45 \wxheading{Parameters
}
47 \docparam{parent
}{The window parent, usually a frame.
}
49 \docparam{id
}{The window identifier. It may take a value of -
1 to indicate a default value.
}
51 \docparam{pos
}{The window position. A value of (-
1, -
1) indicates a default position, chosen by
52 either the windowing system or wxWindows, depending on platform.
}
54 \docparam{size
}{The window size. A value of (-
1, -
1) indicates a default size, chosen by
55 either the windowing system or wxWindows, depending on platform.
}
57 \docparam{style
}{The window style. See
\helpref{wxStatusBar
}{wxstatusbar
}.
}
59 \docparam{name
}{The name of the window. This parameter is used to associate a name with the item,
60 allowing the application user to set Motif resource values for
65 \helpref{wxStatusBar::Create
}{wxstatusbarcreate
}
67 \membersection{wxStatusBar::
\destruct{wxStatusBar
}}
69 \func{void
}{\destruct{wxStatusBar
}}{\void}
73 \membersection{wxStatusBar::Create
}\label{wxstatusbarcreate
}
75 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
76 \param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
77 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style =
0},
\rtfsp
78 \param{const wxString\&
}{name = ``statusBar"
}}
80 Creates the window, for two-step construction.
82 See
\helpref{wxStatusBar::wxStatusBar
}{wxstatusbarconstr
} for details.
84 \membersection{wxStatusBar::GetFieldRect
}\label{wxstatusbargetfieldrect
}
86 \constfunc{virtual bool
}{GetFieldRect
}{\param{int
}{ i
},
\param{wxRect\&
}{ rect
}}
88 Returns the size and position of a fields internal bounding rectangle.
90 \wxheading{Parameters
}
92 \docparam{i
}{The field in question.
}
94 \docparam{rect
}{The rectangle values are placed in this variable.
}
96 \wxheading{Return value
}
98 TRUE if the field index is valid, FALSE otherwise.
102 \helpref{wxRect
}{wxrect
}
104 \membersection{wxStatusBar::GetFieldsCount
}\label{wxstatusbargetfieldscount
}
106 \constfunc{int
}{GetFieldsCount
}{\void}
108 Returns the number of fields in the status bar.
110 \membersection{wxStatusBar::GetStatusText
}\label{wxstatusbargetstatustext
}
112 \constfunc{virtual wxString
}{GetStatusText
}{\param{int
}{ ir =
0}}
114 Returns the string associated with a status bar field.
116 \wxheading{Parameters
}
118 \docparam{i
}{The number of the status field to retrieve, starting from zero.
}
120 \wxheading{Return value
}
122 The status field string if the field is valid, otherwise the empty string.
126 \helpref{wxStatusBar::SetStatusText
}{wxstatusbarsetstatustext
}
128 \membersection{wxStatusBar::DrawField
}\label{wxstatusbardrawfield
}
130 \func{virtual void
}{DrawField
}{\param{wxDC\&
}{dc
},
\param{int
}{i
}}
132 Draws a field, including shaded borders and text.
134 \wxheading{Parameters
}
136 \docparam{dc
}{The device context to draw onto.
}
138 \docparam{i
}{The field to be drawn.
}
142 \helpref{wxStatusBar::DrawFieldText
}{wxstatusbardrawfieldtext
}
144 \membersection{wxStatusBar::DrawFieldText
}\label{wxstatusbardrawfieldtext
}
146 \func{virtual void
}{DrawFieldText
}{\param{wxDC\&
}{dc
},
\param{int
}{i
}}
148 Draws a field's text.
150 \wxheading{Parameters
}
152 \docparam{dc
}{The device context to draw onto.
}
154 \docparam{i
}{The field whose text is to be drawn.
}
158 \helpref{wxStatusBar::DrawField
}{wxstatusbardrawfield
}
160 \membersection{wxStatusBar::InitColours
}\label{wxstatusbarinitcolours
}
162 \func{virtual void
}{InitColours
}{\void}
164 Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
165 of grey (other platforms).
169 This function is called when the window is created, and also
170 from
\helpref{wxStatusBar::OnSysColourChanged
}{wxstatusbaronsyscolourchanged
} on Windows.
174 \helpref{wxStatusBar::OnSysColourChanged
}{wxstatusbaronsyscolourchanged
}
176 \membersection{wxStatusBar::OnSysColourChanged
}\label{wxstatusbaronsyscolourchanged
}
178 \func{void
}{OnSysColourChanged
}{\param{wxSysColourChangedEvent\&
}{event
}}
180 Handles a system colour change by calling
\helpref{wxStatusBar::InitColours
}{wxstatusbarinitcolours
},
181 and refreshes the window.
183 \wxheading{Parameters
}
185 \docparam{event
}{The colour change event.
}
189 \helpref{wxStatusBar::InitColours
}{wxstatusbarinitcolours
}
191 \membersection{wxStatusBar::SetFieldsCount
}\label{wxstatusbarsetfieldscount
}
193 \func{virtual void
}{SetFieldsCount
}{\param{int
}{ number =
1},
\param{int*
}{widths = NULL
}}
195 Sets the number of fields, and optionally the field widths.
197 \wxheading{Parameters
}
199 \docparam{number
}{The number of fields.
}
201 \docparam{widths
}{An array of
{\it n
} integers, each of which is a status field width
202 in pixels. A value of -
1 indicates that the field is variable width; at least one
205 \membersection{wxStatusBar::SetStatusText
}\label{wxstatusbarsetstatustext
}
207 \func{virtual void
}{SetStatusText
}{\param{const wxString\&
}{text
},
\param{int
}{ i =
0}}
209 Sets the text for one field.
211 \wxheading{Parameters
}
213 \docparam{text
}{The text to be set. Use an empty string (``") to clear the field.
}
215 \docparam{i
}{The field to set, starting from zero.
}
219 \helpref{wxStatusBar::GetStatusText
}{wxstatusbargetstatustext
},
\helpref{wxFrame::SetStatusText
}{wxframesetstatustext
}
221 \membersection{wxStatusBar::SetStatusWidths
}\label{wxstatusbarsetstatuswidths
}
223 \func{virtual void
}{SetStatusWidths
}{\param{int
}{ n
},
\param{int *
}{widths
}}
225 Sets the widths of the fields in the status line.
227 \wxheading{Parameters
}
229 \docparam{n
}{The number of fields in the status bar.
}
231 \docparam{widths
}{Must contain an array of
{\it n
} integers, each of which is a status field width
232 in pixels. A value of -
1 indicates that the field is variable width; at least one
233 field must be -
1. You should delete this array after calling
{\bf SetStatusWidths
}.
}
237 The widths of the variable fields are calculated from the total width of all fields,
238 minus the sum of widths of the non-variable fields, divided by the number of
243 \helpref{wxStatusBar::SetFieldsCount
}{wxstatusbarsetfieldscount
},
\helpref{wxFrame::SetStatusWidths
}{wxframesetstatuswidths
}