]> git.saurik.com Git - wxWidgets.git/blame - interface/statusbr.h
Ticket #9592: gtk-choice-setcolumns.2.diff
[wxWidgets.git] / interface / statusbr.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: statusbr.h
e54c96f1 3// Purpose: interface of wxStatusBar
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxStatusBar
11 @wxheader{statusbr.h}
7c913512 12
23324ae1
FM
13 A status bar is a narrow window that can be placed along the bottom of a frame
14 to give
15 small amounts of status information. It can contain one or more fields, one or
16 more of which can
17 be variable length according to the size of the window.
7c913512 18
23324ae1 19 wxWindow
7c913512 20
23324ae1 21 wxEvtHandler
7c913512 22
23324ae1 23 wxObject
7c913512 24
23324ae1 25 @beginStyleTable
8c6791e4 26 @style{wxST_SIZEGRIP}
23324ae1
FM
27 On Windows 95, displays a gripper at right-hand side of the status
28 bar.
29 @endStyleTable
7c913512 30
23324ae1
FM
31 @library{wxcore}
32 @category{miscwnd}
7c913512 33
e54c96f1 34 @see wxFrame, @ref overview_samplestatbar "Status bar sample"
23324ae1
FM
35*/
36class wxStatusBar : public wxWindow
37{
38public:
39 //@{
40 /**
41 Constructor, creating the window.
3c4f71cc 42
7c913512 43 @param parent
4cc4bfaf 44 The window parent, usually a frame.
7c913512 45 @param id
4cc4bfaf
FM
46 The window identifier. It may take a value of -1 to indicate a default
47 value.
7c913512 48 @param style
4cc4bfaf 49 The window style. See wxStatusBar.
7c913512 50 @param name
4cc4bfaf 51 The name of the window. This parameter is used to associate a name with the
23324ae1 52 item,
4cc4bfaf
FM
53 allowing the application user to set Motif resource values for
54 individual windows.
3c4f71cc 55
4cc4bfaf 56 @see Create()
23324ae1
FM
57 */
58 wxStatusBar();
7c913512
FM
59 wxStatusBar(wxWindow* parent, wxWindowID id = wxID_ANY,
60 long style = wxST_SIZEGRIP,
61 const wxString& name = "statusBar");
23324ae1
FM
62 //@}
63
64 /**
65 Destructor.
66 */
67 ~wxStatusBar();
68
69 /**
70 Creates the window, for two-step construction.
23324ae1
FM
71 See wxStatusBar() for details.
72 */
73 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
74 long style = wxST_SIZEGRIP,
75 const wxString& name = "statusBar");
76
77 /**
78 Returns the size and position of a field's internal bounding rectangle.
3c4f71cc 79
7c913512 80 @param i
4cc4bfaf 81 The field in question.
7c913512 82 @param rect
4cc4bfaf 83 The rectangle values are placed in this variable.
3c4f71cc 84
d29a9a8a 85 @return @true if the field index is valid, @false otherwise.
3c4f71cc 86
4cc4bfaf 87 @see wxRect
23324ae1 88 */
328f5751 89 virtual bool GetFieldRect(int i, wxRect& rect) const;
23324ae1
FM
90
91 /**
92 Returns the number of fields in the status bar.
93 */
328f5751 94 int GetFieldsCount() const;
23324ae1
FM
95
96 /**
97 Returns the string associated with a status bar field.
3c4f71cc 98
7c913512 99 @param i
4cc4bfaf 100 The number of the status field to retrieve, starting from zero.
3c4f71cc 101
d29a9a8a 102 @return The status field string if the field is valid, otherwise the
4cc4bfaf 103 empty string.
3c4f71cc 104
4cc4bfaf 105 @see SetStatusText()
23324ae1 106 */
328f5751 107 virtual wxString GetStatusText(int i = 0) const;
23324ae1
FM
108
109 /**
110 Sets the field text to the top of the stack, and pops the stack of saved
111 strings.
3c4f71cc 112
4cc4bfaf 113 @see PushStatusText()
23324ae1
FM
114 */
115 void PopStatusText(int field = 0);
116
117 /**
118 Saves the current field text in a per field stack, and sets the field text
119 to the string passed as argument.
120 */
121 void PushStatusText(const wxString& string, int field = 0);
122
123 /**
124 Sets the number of fields, and optionally the field widths.
3c4f71cc 125
7c913512 126 @param number
4cc4bfaf 127 The number of fields.
7c913512 128 @param widths
4cc4bfaf
FM
129 An array of n integers interpreted in the same way as
130 in SetStatusWidths
23324ae1 131 */
4cc4bfaf 132 virtual void SetFieldsCount(int number = 1, int* widths = NULL);
23324ae1
FM
133
134 /**
135 Sets the minimal possible height for the status bar. The real height may be
136 bigger than the height specified here depending on the size of the font used by
137 the status bar.
138 */
139 void SetMinHeight(int height);
140
141 /**
142 Sets the styles of the fields in the status line which can make fields appear
143 flat
144 or raised instead of the standard sunken 3D border.
3c4f71cc 145
7c913512 146 @param n
4cc4bfaf
FM
147 The number of fields in the status bar. Must be equal to the
148 number passed to SetFieldsCount the last
149 time it was called.
7c913512 150 @param styles
4cc4bfaf
FM
151 Contains an array of n integers with the styles for each field. There
152 are three possible styles:
3c4f71cc
VS
153
154
155
156
157
158
159
4cc4bfaf 160 wxSB_NORMAL
3c4f71cc
VS
161
162
163
164
4cc4bfaf 165 (default) The field appears sunken with a standard 3D border.
3c4f71cc
VS
166
167
168
169
170
4cc4bfaf 171 wxSB_FLAT
3c4f71cc
VS
172
173
174
175
4cc4bfaf 176 No border is painted around the field so that it appears flat.
3c4f71cc
VS
177
178
179
180
181
4cc4bfaf 182 wxSB_RAISED
3c4f71cc
VS
183
184
185
186
4cc4bfaf 187 A raised 3D border is painted around the field.
23324ae1 188 */
4cc4bfaf 189 virtual void SetStatusStyles(int n, int* styles);
23324ae1
FM
190
191 /**
192 Sets the text for one field.
3c4f71cc 193
7c913512 194 @param text
4cc4bfaf 195 The text to be set. Use an empty string ("") to clear the field.
7c913512 196 @param i
4cc4bfaf 197 The field to set, starting from zero.
3c4f71cc 198
4cc4bfaf 199 @see GetStatusText(), wxFrame::SetStatusText
23324ae1
FM
200 */
201 virtual void SetStatusText(const wxString& text, int i = 0);
202
203 /**
204 Sets the widths of the fields in the status line. There are two types of
205 fields: fixed widths one and variable width fields. For the fixed width fields
206 you should specify their (constant) width in pixels. For the variable width
207 fields, specify a negative number which indicates how the field should expand:
208 the space left for all variable width fields is divided between them according
209 to the absolute value of this number. A variable width field with width of -2
210 gets twice as much of it as a field with width -1 and so on.
23324ae1
FM
211 For example, to create one fixed width field of width 100 in the right part of
212 the status bar and two more fields which get 66% and 33% of the remaining
213 space correspondingly, you should use an array containing -2, -1 and 100.
3c4f71cc 214
7c913512 215 @param n
4cc4bfaf
FM
216 The number of fields in the status bar. Must be equal to the
217 number passed to SetFieldsCount the last
218 time it was called.
7c913512 219 @param widths
4cc4bfaf
FM
220 Contains an array of n integers, each of which is
221 either an absolute status field width in pixels if positive or indicates a
222 variable width field if negative.
3c4f71cc 223
23324ae1 224 @remarks The widths of the variable fields are calculated from the total
4cc4bfaf
FM
225 width of all fields, minus the sum of widths of the
226 non-variable fields, divided by the number of variable
227 fields.
3c4f71cc 228
4cc4bfaf 229 @see SetFieldsCount(), wxFrame::SetStatusWidths
23324ae1 230 */
4cc4bfaf 231 virtual void SetStatusWidths(int n, int* widths);
23324ae1 232};
e54c96f1 233