]>
git.saurik.com Git - wxWidgets.git/blob - interface/statusbr.h
85ffc2dc766aac116c6cd4e9be61d8d0f85b11db
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxStatusBar class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A status bar is a narrow window that can be placed along the bottom of a frame
15 small amounts of status information. It can contain one or more fields, one or
17 be variable length according to the size of the window.
26 @style{wxST_SIZEGRIP}:
27 On Windows 95, displays a gripper at right-hand side of the status
35 wxFrame, @ref overview_samplestatbar "Status bar sample"
37 class wxStatusBar
: public wxWindow
42 Constructor, creating the window.
45 The window parent, usually a frame.
48 The window identifier. It may take a value of -1 to indicate a default value.
51 The window style. See wxStatusBar.
54 The name of the window. This parameter is used to associate a name with the
56 allowing the application user to set Motif resource values for
62 wxStatusBar(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
63 long style
= wxST_SIZEGRIP
,
64 const wxString
& name
= "statusBar");
73 Creates the window, for two-step construction.
75 See wxStatusBar() for details.
77 bool Create(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
78 long style
= wxST_SIZEGRIP
,
79 const wxString
& name
= "statusBar");
82 Returns the size and position of a field's internal bounding rectangle.
85 The field in question.
88 The rectangle values are placed in this variable.
90 @returns @true if the field index is valid, @false otherwise.
94 virtual bool GetFieldRect(int i
, wxRect
& rect
);
97 Returns the number of fields in the status bar.
102 Returns the string associated with a status bar field.
105 The number of the status field to retrieve, starting from zero.
107 @returns The status field string if the field is valid, otherwise the
112 virtual wxString
GetStatusText(int i
= 0);
115 Sets the field text to the top of the stack, and pops the stack of saved
120 void PopStatusText(int field
= 0);
123 Saves the current field text in a per field stack, and sets the field text
124 to the string passed as argument.
126 void PushStatusText(const wxString
& string
, int field
= 0);
129 Sets the number of fields, and optionally the field widths.
132 The number of fields.
135 An array of n integers interpreted in the same way as
138 virtual void SetFieldsCount(int number
= 1, int* widths
= @NULL
);
141 Sets the minimal possible height for the status bar. The real height may be
142 bigger than the height specified here depending on the size of the font used by
145 void SetMinHeight(int height
);
148 Sets the styles of the fields in the status line which can make fields appear
150 or raised instead of the standard sunken 3D border.
153 The number of fields in the status bar. Must be equal to the
154 number passed to SetFieldsCount the last
158 Contains an array of n integers with the styles for each field. There
159 are three possible styles:
165 (default) The field appears sunken with a standard 3D border.
170 No border is painted around the field so that it appears flat.
175 A raised 3D border is painted around the field.
177 virtual void SetStatusStyles(int n
, int * styles
);
180 Sets the text for one field.
183 The text to be set. Use an empty string ("") to clear the field.
186 The field to set, starting from zero.
188 @sa GetStatusText(), wxFrame::SetStatusText
190 virtual void SetStatusText(const wxString
& text
, int i
= 0);
193 Sets the widths of the fields in the status line. There are two types of
194 fields: fixed widths one and variable width fields. For the fixed width fields
195 you should specify their (constant) width in pixels. For the variable width
196 fields, specify a negative number which indicates how the field should expand:
197 the space left for all variable width fields is divided between them according
198 to the absolute value of this number. A variable width field with width of -2
199 gets twice as much of it as a field with width -1 and so on.
201 For example, to create one fixed width field of width 100 in the right part of
202 the status bar and two more fields which get 66% and 33% of the remaining
203 space correspondingly, you should use an array containing -2, -1 and 100.
206 The number of fields in the status bar. Must be equal to the
207 number passed to SetFieldsCount the last
211 Contains an array of n integers, each of which is
212 either an absolute status field width in pixels if positive or indicates a
213 variable width field if negative.
215 @remarks The widths of the variable fields are calculated from the total
216 width of all fields, minus the sum of widths of the
217 non-variable fields, divided by the number of
220 @sa SetFieldsCount(), wxFrame::SetStatusWidths
222 virtual void SetStatusWidths(int n
, int * widths
);