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
}
13 There are no special styles for this window.
15 See also
\helpref{window styles overview
}{windowstyles
}.
19 It is possible to create controls and other windows on the status bar. Position these windows
20 from an
{\bf OnSize
} event handler.
24 \helpref{wxFrame
}{wxframe
}
26 \latexignore{\rtfignore{\wxheading{Members
}}}
28 \membersection{wxStatusBar::wxStatusBar
}\label{wxstatusbarconstr
}
30 \func{}{wxStatusBar
}{\void}
34 \func{}{wxStatusBar
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
35 \param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
36 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style =
0},
\rtfsp
37 \param{const wxString\&
}{name = ``statusBar"
}}
39 Constructor, creating the window.
41 \wxheading{Parameters
}
43 \docparam{parent
}{The window parent, usually a frame.
}
45 \docparam{id
}{The window identifier. It may take a value of -
1 to indicate a default value.
}
47 \docparam{pos
}{The window position. A value of (-
1, -
1) indicates a default position, chosen by
48 either the windowing system or wxWindows, depending on platform.
}
50 \docparam{size
}{The window size. A value of (-
1, -
1) indicates a default size, chosen by
51 either the windowing system or wxWindows, depending on platform.
}
53 \docparam{style
}{The window style. See
\helpref{wxStatusBar
}{wxstatusbar
}.
}
55 \docparam{name
}{The name of the window. This parameter is used to associate a name with the item,
56 allowing the application user to set Motif resource values for
61 \helpref{wxStatusBar::Create
}{wxstatusbarcreate
}
63 \membersection{wxStatusBar::
\destruct{wxStatusBar
}}
65 \func{void
}{\destruct{wxStatusBar
}}{\void}
69 \membersection{wxStatusBar::Create
}\label{wxstatusbarcreate
}
71 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
72 \param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
73 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style =
0},
\rtfsp
74 \param{const wxString\&
}{name = ``statusBar"
}}
76 Creates the window, for two-step construction.
78 See
\helpref{wxStatusBar::wxStatusBar
}{wxstatusbarconstr
} for details.
80 \membersection{wxStatusBar::GetFieldRect
}\label{wxstatusbargetfieldrect
}
82 \constfunc{virtual bool
}{GetFieldRect
}{\param{int
}{ i
},
\param{wxRect\&
}{ rect
}}
84 Returns the size and position of a fields internal bounding rectangle.
86 \wxheading{Parameters
}
88 \docparam{i
}{The field in question.
}
90 \docparam{rect
}{The rectangle values are placed in this variable.
}
92 \wxheading{Return value
}
94 TRUE if the field index is valid, FALSE otherwise.
98 \helpref{wxRect
}{wxrect
}
100 \membersection{wxStatusBar::GetFieldsCount
}\label{wxstatusbargetfieldscount
}
102 \constfunc{int
}{GetFieldsCount
}{\void}
104 Returns the number of fields in the status bar.
106 \membersection{wxStatusBar::GetStatusText
}\label{wxstatusbargetstatustext
}
108 \constfunc{virtual wxString
}{GetStatusText
}{\param{int
}{ ir =
0}}
110 Returns the string associated with a status bar field.
112 \wxheading{Parameters
}
114 \docparam{i
}{The number of the status field to retrieve, starting from zero.
}
116 \wxheading{Return value
}
118 The status field string if the field is valid, otherwise the empty string.
122 \helpref{wxStatusBar::SetStatusText
}{wxstatusbarsetstatustext
}
124 \membersection{wxStatusBar::DrawField
}\label{wxstatusbardrawfield
}
126 \func{virtual void
}{DrawField
}{\param{wxDC\&
}{dc
},
\param{int
}{i
}}
128 Draws a field, including shaded borders and text.
130 \wxheading{Parameters
}
132 \docparam{dc
}{The device context to draw onto.
}
134 \docparam{i
}{The field to be drawn.
}
138 \helpref{wxStatusBar::DrawFieldText
}{wxstatusbardrawfieldtext
}
140 \membersection{wxStatusBar::DrawFieldText
}\label{wxstatusbardrawfieldtext
}
142 \func{virtual void
}{DrawFieldText
}{\param{wxDC\&
}{dc
},
\param{int
}{i
}}
144 Draws a field's text.
146 \wxheading{Parameters
}
148 \docparam{dc
}{The device context to draw onto.
}
150 \docparam{i
}{The field whose text is to be drawn.
}
154 \helpref{wxStatusBar::DrawField
}{wxstatusbardrawfield
}
156 \membersection{wxStatusBar::InitColours
}\label{wxstatusbarinitcolours
}
158 \func{virtual void
}{InitColours
}{\void}
160 Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
161 of grey (other platforms).
165 This function is called when the window is created, and also
166 from
\helpref{wxStatusBar::OnSysColourChanged
}{wxstatusbaronsyscolourchanged
} on Windows.
170 \helpref{wxStatusBar::OnSysColourChanged
}{wxstatusbaronsyscolourchanged
}
172 \membersection{wxStatusBar::OnSysColourChanged
}\label{wxstatusbaronsyscolourchanged
}
174 \func{void
}{OnSysColourChanged
}{\param{wxSysColourChangedEvent\&
}{event
}}
176 Handles a system colour change by calling
\helpref{wxStatusBar::InitColours
}{wxstatusbarinitcolours
},
177 and refreshes the window.
179 \wxheading{Parameters
}
181 \docparam{event
}{The colour change event.
}
185 \helpref{wxStatusBar::InitColours
}{wxstatusbarinitcolours
}
187 \membersection{wxStatusBar::SetFieldsCount
}\label{wxstatusbarsetfieldscount
}
189 \func{virtual void
}{SetFieldsCount
}{\param{int
}{ number =
1},
\param{int*
}{widths = NULL
}}
191 Sets the number of fields, and optionally the field widths.
193 \wxheading{Parameters
}
195 \docparam{number
}{The number of fields.
}
197 \docparam{widths
}{An array of
{\it n
} integers, each of which is a status field width
198 in pixels. A value of -
1 indicates that the field is variable width; at least one
201 \membersection{wxStatusBar::SetStatusText
}\label{wxstatusbarsetstatustext
}
203 \func{virtual void
}{SetStatusText
}{\param{const wxString\&
}{text
},
\param{int
}{ i =
0}}
205 Sets the text for one field.
207 \wxheading{Parameters
}
209 \docparam{text
}{The text to be set. Use an empty string (``") to clear the field.
}
211 \docparam{i
}{The field to set, starting from zero.
}
215 \helpref{wxStatusBar::GetStatusText
}{wxstatusbargetstatustext
},
\helpref{wxFrame::SetStatusText
}{wxframesetstatustext
}
217 \membersection{wxStatusBar::SetStatusWidths
}\label{wxstatusbarsetstatuswidths
}
219 \func{virtual void
}{SetStatusWidths
}{\param{int
}{ n
},
\param{int *
}{widths
}}
221 Sets the widths of the fields in the status line.
223 \wxheading{Parameters
}
225 \docparam{n
}{The number of fields in the status bar.
}
227 \docparam{widths
}{Must contain an array of
{\it n
} integers, each of which is a status field width
228 in pixels. A value of -
1 indicates that the field is variable width; at least one
229 field must be -
1. You should delete this array after calling
{\bf SetStatusWidths
}.
}
233 The widths of the variable fields are calculated from the total width of all fields,
234 minus the sum of widths of the non-variable fields, divided by the number of
239 \helpref{wxStatusBar::SetFieldsCount
}{wxstatusbarsetfieldscount
},
\helpref{wxFrame::SetStatusWidths
}{wxframesetstatuswidths
}