]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/sizer.h
Add files necessary to run Expat configure.
[wxWidgets.git] / interface / wx / sizer.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: sizer.h
e54c96f1 3// Purpose: interface of wxStdDialogButtonSizer
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
526954c5 6// Licence: wxWindows licence
23324ae1
FM
7/////////////////////////////////////////////////////////////////////////////
8
e725ba4f
FM
9
10/**
788194ff 11 @class wxSizer
e725ba4f 12
788194ff
FM
13 wxSizer is the abstract base class used for laying out subwindows in a window.
14 You cannot use wxSizer directly; instead, you will have to use one of the sizer
15 classes derived from it. Currently there are wxBoxSizer, wxStaticBoxSizer,
16 wxGridSizer, wxFlexGridSizer, wxWrapSizer and wxGridBagSizer.
e725ba4f 17
788194ff
FM
18 The layout algorithm used by sizers in wxWidgets is closely related to layout
19 in other GUI toolkits, such as Java's AWT, the GTK toolkit or the Qt toolkit.
20 It is based upon the idea of the individual subwindows reporting their minimal
21 required size and their ability to get stretched if the size of the parent window
22 has changed.
e725ba4f 23
788194ff
FM
24 This will most often mean that the programmer does not set the original size of
25 a dialog in the beginning, rather the dialog will be assigned a sizer and this
26 sizer will be queried about the recommended size. The sizer in turn will query
27 its children, which can be normal windows, empty space or other sizers, so that
28 a hierarchy of sizers can be constructed. Note that wxSizer does not derive
29 from wxWindow and thus does not interfere with tab ordering and requires very little
30 resources compared to a real window on screen.
e725ba4f 31
788194ff
FM
32 What makes sizers so well fitted for use in wxWidgets is the fact that every
33 control reports its own minimal size and the algorithm can handle differences in
34 font sizes or different window (dialog item) sizes on different platforms without
35 problems. If e.g. the standard font as well as the overall design of Motif widgets
36 requires more space than on Windows, the initial dialog size will automatically
37 be bigger on Motif than on Windows.
7c913512 38
788194ff
FM
39 Sizers may also be used to control the layout of custom drawn items on the
40 window. The wxSizer::Add(), wxSizer::Insert(), and wxSizer::Prepend() functions
41 return a pointer to the newly added wxSizerItem.
42 Just add empty space of the desired size and attributes, and then use the
43 wxSizerItem::GetRect() method to determine where the drawing operations
44 should take place.
7c913512 45
788194ff
FM
46 Please notice that sizers, like child windows, are owned by the library and
47 will be deleted by it which implies that they must be allocated on the heap.
48 However if you create a sizer and do not add it to another sizer or
49 window, the library wouldn't be able to delete such an orphan sizer and in
50 this, and only this, case it should be deleted explicitly.
7c913512 51
788194ff
FM
52 @section wxsizer_flags wxSizer flags
53
54 The "flag" argument accepted by wxSizeItem constructors and other
55 functions, e.g. wxSizer::Add(), is OR-combination of the following flags.
56 Two main behaviours are defined using these flags. One is the border around
57 a window: the border parameter determines the border width whereas the
58 flags given here determine which side(s) of the item that the border will
59 be added. The other flags determine how the sizer item behaves when the
60 space allotted to the sizer changes, and is somewhat dependent on the
61 specific kind of sizer used.
62
63 @beginDefList
64 @itemdef{wxTOP<br>
65 wxBOTTOM<br>
66 wxLEFT<br>
67 wxRIGHT<br>
68 wxALL,
69 These flags are used to specify which side(s) of the sizer item
70 the border width will apply to.}
71 @itemdef{wxEXPAND,
72 The item will be expanded to fill the space assigned to the item.}
73 @itemdef{wxSHAPED,
74 The item will be expanded as much as possible while also
75 maintaining its aspect ratio.}
76 @itemdef{wxFIXED_MINSIZE,
77 Normally wxSizers will use GetAdjustedBestSize() to determine what
78 the minimal size of window items should be, and will use that size
79 to calculate the layout. This allows layouts to adjust when an
80 item changes and its best size becomes different. If you would
81 rather have a window item stay the size it started with then use
82 @c wxFIXED_MINSIZE.}
83 @itemdef{wxRESERVE_SPACE_EVEN_IF_HIDDEN,
84 Normally wxSizers don't allocate space for hidden windows or other
4c51a665 85 items. This flag overrides this behaviour so that sufficient space
788194ff
FM
86 is allocated for the window even if it isn't visible. This makes
87 it possible to dynamically show and hide controls without resizing
88 parent dialog, for example. (Available since 2.8.8.)}
89 @itemdef{wxALIGN_CENTER<br>
90 wxALIGN_CENTRE<br>
91 wxALIGN_LEFT<br>
92 wxALIGN_RIGHT<br>
93 wxALIGN_TOP<br>
94 wxALIGN_BOTTOM<br>
95 wxALIGN_CENTER_VERTICAL<br>
96 wxALIGN_CENTRE_VERTICAL<br>
97 wxALIGN_CENTER_HORIZONTAL<br>
98 wxALIGN_CENTRE_HORIZONTAL,
99 The @c wxALIGN_* flags allow you to specify the alignment of the item
100 within the space allotted to it by the sizer, adjusted for the
101 border if any.}
102 @endDefList
7c913512 103
23324ae1 104 @library{wxcore}
4b962ba1 105 @category{winlayout}
7c913512 106
788194ff 107 @see @ref overview_sizer
23324ae1 108*/
788194ff 109class wxSizer : public wxObject
23324ae1
FM
110{
111public:
112 /**
788194ff
FM
113 The constructor.
114 Note that wxSizer is an abstract base class and may not be instantiated.
23324ae1 115 */
788194ff 116 wxSizer();
23324ae1
FM
117
118 /**
788194ff 119 The destructor.
23324ae1 120 */
788194ff 121 virtual ~wxSizer();
23324ae1
FM
122
123 /**
788194ff 124 Appends a child to the sizer.
23324ae1 125
788194ff
FM
126 wxSizer itself is an abstract class, but the parameters are equivalent
127 in the derived classes that you will instantiate to use it so they are
128 described here:
4876436a 129
788194ff
FM
130 @param window
131 The window to be added to the sizer. Its initial size (either set
132 explicitly by the user or calculated internally when using
133 wxDefaultSize) is interpreted as the minimal and in many cases also
134 the initial size.
135 @param flags
136 A wxSizerFlags object that enables you to specify most of the above
137 parameters more conveniently.
23324ae1 138 */
788194ff 139 wxSizerItem* Add(wxWindow* window, const wxSizerFlags& flags);
23324ae1
FM
140
141 /**
788194ff 142 Appends a child to the sizer.
23324ae1 143
788194ff
FM
144 wxSizer itself is an abstract class, but the parameters are equivalent
145 in the derived classes that you will instantiate to use it so they are
146 described here:
4876436a 147
788194ff
FM
148 @param window
149 The window to be added to the sizer. Its initial size (either set
150 explicitly by the user or calculated internally when using
151 wxDefaultSize) is interpreted as the minimal and in many cases also
152 the initial size.
153 @param proportion
154 Although the meaning of this parameter is undefined in wxSizer, it
155 is used in wxBoxSizer to indicate if a child of a sizer can change
156 its size in the main orientation of the wxBoxSizer - where 0 stands
157 for not changeable and a value of more than zero is interpreted
158 relative to the value of other children of the same wxBoxSizer. For
159 example, you might have a horizontal wxBoxSizer with three
160 children, two of which are supposed to change their size with the
161 sizer. Then the two stretchable windows would get a value of 1 each
162 to make them grow and shrink equally with the sizer's horizontal
163 dimension.
164 @param flag
4c51a665 165 OR-combination of flags affecting sizer's behaviour. See
788194ff
FM
166 @ref wxsizer_flags "wxSizer flags list" for details.
167 @param border
168 Determines the border width, if the flag parameter is set to
169 include any border flag.
170 @param userData
171 Allows an extra object to be attached to the sizer item, for use in
172 derived classes when sizing information is more complex than the
173 proportion and flag will allow for.
23324ae1 174 */
788194ff
FM
175 wxSizerItem* Add(wxWindow* window,
176 int proportion = 0,
177 int flag = 0,
178 int border = 0,
179 wxObject* userData = NULL);
7c913512 180
23324ae1 181 /**
788194ff 182 Appends a child to the sizer.
e725ba4f 183
788194ff
FM
184 wxSizer itself is an abstract class, but the parameters are equivalent
185 in the derived classes that you will instantiate to use it so they are
186 described here:
e725ba4f 187
788194ff
FM
188 @param sizer
189 The (child-)sizer to be added to the sizer. This allows placing a
190 child sizer in a sizer and thus to create hierarchies of sizers
191 (typically a vertical box as the top sizer and several horizontal
192 boxes on the level beneath).
193 @param flags
194 A wxSizerFlags object that enables you to specify most of the above
195 parameters more conveniently.
e725ba4f 196 */
788194ff 197 wxSizerItem* Add(wxSizer* sizer, const wxSizerFlags& flags);
23324ae1
FM
198
199 /**
788194ff 200 Appends a child to the sizer.
23324ae1 201
788194ff
FM
202 wxSizer itself is an abstract class, but the parameters are equivalent
203 in the derived classes that you will instantiate to use it so they are
204 described here:
23324ae1 205
788194ff
FM
206 @param sizer
207 The (child-)sizer to be added to the sizer. This allows placing a
208 child sizer in a sizer and thus to create hierarchies of sizers
209 (typically a vertical box as the top sizer and several horizontal
210 boxes on the level beneath).
211 @param proportion
212 Although the meaning of this parameter is undefined in wxSizer, it
213 is used in wxBoxSizer to indicate if a child of a sizer can change
214 its size in the main orientation of the wxBoxSizer - where 0 stands
215 for not changeable and a value of more than zero is interpreted
216 relative to the value of other children of the same wxBoxSizer. For
217 example, you might have a horizontal wxBoxSizer with three
218 children, two of which are supposed to change their size with the
219 sizer. Then the two stretchable windows would get a value of 1 each
220 to make them grow and shrink equally with the sizer's horizontal
221 dimension.
222 @param flag
4c51a665 223 OR-combination of flags affecting sizer's behaviour. See
788194ff
FM
224 @ref wxsizer_flags "wxSizer flags list" for details.
225 @param border
226 Determines the border width, if the flag parameter is set to
227 include any border flag.
228 @param userData
229 Allows an extra object to be attached to the sizer item, for use in
230 derived classes when sizing information is more complex than the
231 proportion and flag will allow for.
23324ae1 232 */
788194ff
FM
233 wxSizerItem* Add(wxSizer* sizer,
234 int proportion = 0,
235 int flag = 0,
236 int border = 0,
237 wxObject* userData = NULL);
23324ae1
FM
238
239 /**
788194ff
FM
240 Appends a spacer child to the sizer.
241
242 wxSizer itself is an abstract class, but the parameters are equivalent
243 in the derived classes that you will instantiate to use it so they are
244 described here.
245
246 @a width and @a height specify the dimension of a spacer to be added to
247 the sizer. Adding spacers to sizers gives more flexibility in the
248 design of dialogs; imagine for example a horizontal box with two
249 buttons at the bottom of a dialog: you might want to insert a space
250 between the two buttons and make that space stretchable using the
251 proportion flag and the result will be that the left button will be
252 aligned with the left side of the dialog and the right button with the
253 right side - the space in between will shrink and grow with the dialog.
254
255 @param width
256 Width of the spacer.
257 @param height
258 Height of the spacer.
259 @param proportion
260 Although the meaning of this parameter is undefined in wxSizer, it
261 is used in wxBoxSizer to indicate if a child of a sizer can change
262 its size in the main orientation of the wxBoxSizer - where 0 stands
263 for not changeable and a value of more than zero is interpreted
264 relative to the value of other children of the same wxBoxSizer. For
265 example, you might have a horizontal wxBoxSizer with three
266 children, two of which are supposed to change their size with the
267 sizer. Then the two stretchable windows would get a value of 1 each
268 to make them grow and shrink equally with the sizer's horizontal
269 dimension.
270 @param flag
4c51a665 271 OR-combination of flags affecting sizer's behaviour. See
788194ff
FM
272 @ref wxsizer_flags "wxSizer flags list" for details.
273 @param border
274 Determines the border width, if the flag parameter is set to
275 include any border flag.
276 @param userData
277 Allows an extra object to be attached to the sizer item, for use in
278 derived classes when sizing information is more complex than the
279 proportion and flag will allow for.
23324ae1 280 */
788194ff
FM
281 wxSizerItem* Add(int width, int height,
282 int proportion = 0,
283 int flag = 0,
284 int border = 0,
285 wxObject* userData = NULL);
e6273b91
RD
286
287 /**
288 Appends a spacer child to the sizer.
289
290 @param width
291 Width of the spacer.
292 @param height
293 Height of the spacer.
294 @param flags
295 A wxSizerFlags object that enables you to specify most of the other
296 parameters more conveniently.
297 */
298 wxSizerItem* Add( int width, int height, const wxSizerFlags& flags);
23324ae1 299
7106fc46
RD
300 wxSizerItem* Add(wxSizerItem* item);
301
23324ae1 302 /**
1a2df6a7
VZ
303 This base function adds non-stretchable space to both the horizontal
304 and vertical orientation of the sizer.
788194ff
FM
305 More readable way of calling:
306 @code
307 wxSizer::Add(size, size, 0).
308 @endcode
1a2df6a7 309 @see wxBoxSizer::AddSpacer()
23324ae1 310 */
1a2df6a7 311 virtual wxSizerItem *AddSpacer(int size);
23324ae1
FM
312
313 /**
788194ff
FM
314 Adds stretchable space to the sizer.
315 More readable way of calling:
316 @code
317 wxSizer::Add(0, 0, prop).
318 @endcode
23324ae1 319 */
788194ff 320 wxSizerItem* AddStretchSpacer(int prop = 1);
23324ae1
FM
321
322 /**
788194ff
FM
323 This method is abstract and has to be overwritten by any derived class.
324 Here, the sizer will do the actual calculation of its children's minimal sizes.
23324ae1 325 */
788194ff 326 virtual wxSize CalcMin() = 0;
23324ae1
FM
327
328 /**
788194ff
FM
329 Detaches all children from the sizer.
330 If @a delete_windows is @true then child windows will also be deleted.
23324ae1 331 */
788194ff 332 virtual void Clear(bool delete_windows = false);
23324ae1 333
7e927914 334 /**
788194ff
FM
335 Computes client area size for @a window so that it matches the sizer's
336 minimal size. Unlike GetMinSize(), this method accounts for other
337 constraints imposed on @e window, namely display's size (returned size
338 will never be too large for the display) and maximum window size if
339 previously set by wxWindow::SetMaxSize().
7e927914 340
788194ff
FM
341 The returned value is suitable for passing to wxWindow::SetClientSize() or
342 wxWindow::SetMinClientSize().
7e927914 343
788194ff 344 @since 2.8.8
7e927914 345
788194ff 346 @see ComputeFittingWindowSize(), Fit()
23324ae1 347 */
788194ff 348 wxSize ComputeFittingClientSize(wxWindow* window);
23324ae1
FM
349
350 /**
788194ff
FM
351 Like ComputeFittingClientSize(), but converts the result into window
352 size. The returned value is suitable for passing to wxWindow::SetSize()
353 or wxWindow::SetMinSize().
23324ae1 354
788194ff 355 @since 2.8.8
23324ae1 356
788194ff 357 @see ComputeFittingClientSize(), Fit()
23324ae1 358 */
788194ff 359 wxSize ComputeFittingWindowSize(wxWindow* window);
23324ae1
FM
360
361 /**
788194ff 362 Detach the child @a window from the sizer without destroying it.
23324ae1 363
788194ff
FM
364 This method does not cause any layout or resizing to take place, call Layout()
365 to update the layout "on screen" after detaching a child from the sizer.
23324ae1 366
788194ff 367 Returns @true if the child item was found and detached, @false otherwise.
23324ae1 368
788194ff 369 @see Remove()
23324ae1 370 */
788194ff 371 virtual bool Detach(wxWindow* window);
23324ae1
FM
372
373 /**
788194ff
FM
374 Detach the child @a sizer from the sizer without destroying it.
375
376 This method does not cause any layout or resizing to take place, call Layout()
377 to update the layout "on screen" after detaching a child from the sizer.
378
379 Returns @true if the child item was found and detached, @false otherwise.
380
381 @see Remove()
23324ae1 382 */
788194ff 383 virtual bool Detach(wxSizer* sizer);
23324ae1
FM
384
385 /**
788194ff 386 Detach a item at position @a index from the sizer without destroying it.
01195a1b 387
788194ff
FM
388 This method does not cause any layout or resizing to take place, call Layout()
389 to update the layout "on screen" after detaching a child from the sizer.
390 Returns @true if the child item was found and detached, @false otherwise.
01195a1b 391
788194ff 392 @see Remove()
23324ae1 393 */
788194ff 394 virtual bool Detach(int index);
23324ae1
FM
395
396 /**
788194ff
FM
397 Tell the sizer to resize the @a window so that its client area matches the
398 sizer's minimal size (ComputeFittingClientSize() is called to determine it).
399 This is commonly done in the constructor of the window itself, see sample
400 in the description of wxBoxSizer.
401
402 @return The new window size.
403
404 @see ComputeFittingClientSize(), ComputeFittingWindowSize()
23324ae1 405 */
788194ff 406 wxSize Fit(wxWindow* window);
23324ae1
FM
407
408 /**
788194ff
FM
409 Tell the sizer to resize the virtual size of the @a window to match the sizer's
410 minimal size. This will not alter the on screen size of the window, but may
411 cause the addition/removal/alteration of scrollbars required to view the virtual
412 area in windows which manage it.
413
414 @see wxScrolled::SetScrollbars(), SetVirtualSizeHints()
23324ae1 415 */
788194ff 416 void FitInside(wxWindow* window);
23324ae1 417
7106fc46
RD
418 /**
419 Inform sizer about the first direction that has been decided (by
f090e4ef 420 parent item). Returns true if it made use of the information (and
7106fc46
RD
421 recalculated min size).
422 */
423 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir);
424
425
788194ff 426 //@{
23324ae1 427 /**
788194ff
FM
428 Returns the list of the items in this sizer.
429
430 The elements of type-safe wxList @c wxSizerItemList are pointers to
431 objects of type wxSizerItem.
23324ae1 432 */
788194ff
FM
433 wxSizerItemList& GetChildren();
434 const wxSizerItemList& GetChildren() const;
435 //@}
23324ae1
FM
436
437 /**
788194ff 438 Returns the window this sizer is used in or @NULL if none.
23324ae1 439 */
788194ff 440 wxWindow* GetContainingWindow() const;
23324ae1 441
0c3140ca
RD
442 /**
443 Set the window this sizer is used in.
444 */
445 void SetContainingWindow(wxWindow *window);
446
23324ae1 447 /**
788194ff
FM
448 Returns the number of items in the sizer.
449
450 If you just need to test whether the sizer is empty or not you can also
451 use IsEmpty() function.
23324ae1 452 */
788194ff 453 size_t GetItemCount() const;
23324ae1
FM
454
455 /**
788194ff
FM
456 Finds wxSizerItem which holds the given @a window.
457 Use parameter @a recursive to search in subsizers too.
458 Returns pointer to item or @NULL.
23324ae1 459 */
788194ff 460 wxSizerItem* GetItem(wxWindow* window, bool recursive = false);
23324ae1
FM
461
462 /**
788194ff
FM
463 Finds wxSizerItem which holds the given @a sizer.
464 Use parameter @a recursive to search in subsizers too.
465 Returns pointer to item or @NULL.
23324ae1 466 */
788194ff
FM
467
468 wxSizerItem* GetItem(wxSizer* sizer, bool recursive = false);
23324ae1
FM
469
470 /**
788194ff
FM
471 Finds wxSizerItem which is located in the sizer at position @a index.
472 Use parameter @a recursive to search in subsizers too.
473 Returns pointer to item or @NULL.
23324ae1 474 */
788194ff 475 wxSizerItem* GetItem(size_t index);
23324ae1
FM
476
477 /**
788194ff
FM
478 Finds item of the sizer which has the given @e id.
479 This @a id is not the window id but the id of the wxSizerItem itself.
480 This is mainly useful for retrieving the sizers created from XRC resources.
481 Use parameter @a recursive to search in subsizers too.
482 Returns pointer to item or @NULL.
23324ae1 483 */
788194ff 484 wxSizerItem* GetItemById(int id, bool recursive = false);
23324ae1 485
23324ae1 486 /**
788194ff 487 Returns the minimal size of the sizer.
23324ae1 488
788194ff
FM
489 This is either the combined minimal size of all the children and their
490 borders or the minimal size set by SetMinSize(), depending on which is bigger.
491 Note that the returned value is client size, not window size.
492 In particular, if you use the value to set toplevel window's minimal or
493 actual size, use wxWindow::SetMinClientSize() or wxWindow::SetClientSize(),
494 not wxWindow::SetMinSize() or wxWindow::SetSize().
23324ae1 495 */
788194ff 496 wxSize GetMinSize();
23324ae1
FM
497
498 /**
788194ff 499 Returns the current position of the sizer.
23324ae1 500 */
788194ff 501 wxPoint GetPosition() const;
23324ae1
FM
502
503 /**
788194ff 504 Returns the current size of the sizer.
23324ae1 505 */
788194ff 506 wxSize GetSize() const;
23324ae1
FM
507
508 /**
788194ff 509 Hides the child @a window.
7c913512 510
788194ff 511 To make a sizer item disappear, use Hide() followed by Layout().
7c913512 512
788194ff
FM
513 Use parameter @a recursive to hide elements found in subsizers.
514 Returns @true if the child item was found, @false otherwise.
7c913512 515
788194ff
FM
516 @see IsShown(), Show()
517 */
518 bool Hide(wxWindow* window, bool recursive = false);
7c913512 519
788194ff
FM
520 /**
521 Hides the child @a sizer.
7c913512 522
788194ff 523 To make a sizer item disappear, use Hide() followed by Layout().
7c913512 524
788194ff
FM
525 Use parameter @a recursive to hide elements found in subsizers.
526 Returns @true if the child item was found, @false otherwise.
7c913512 527
788194ff 528 @see IsShown(), Show()
23324ae1 529 */
788194ff 530 bool Hide(wxSizer* sizer, bool recursive = false);
23324ae1
FM
531
532 /**
788194ff 533 Hides the item at position @a index.
30a56ea8 534
788194ff 535 To make a sizer item disappear, use Hide() followed by Layout().
3c4f71cc 536
788194ff
FM
537 Use parameter @a recursive to hide elements found in subsizers.
538 Returns @true if the child item was found, @false otherwise.
30a56ea8 539
788194ff 540 @see IsShown(), Show()
23324ae1 541 */
788194ff 542 bool Hide(size_t index);
23324ae1 543
23324ae1 544 /**
788194ff
FM
545 Insert a child into the sizer before any existing item at @a index.
546
547 See Add() for the meaning of the other parameters.
23324ae1 548 */
788194ff
FM
549 wxSizerItem* Insert(size_t index, wxWindow* window,
550 const wxSizerFlags& flags);
feaa1ecb
VS
551
552 /**
788194ff 553 Insert a child into the sizer before any existing item at @a index.
feaa1ecb 554
788194ff 555 See Add() for the meaning of the other parameters.
feaa1ecb 556 */
788194ff
FM
557 wxSizerItem* Insert(size_t index, wxWindow* window,
558 int proportion = 0,
559 int flag = 0,
560 int border = 0,
561 wxObject* userData = NULL);
23324ae1
FM
562
563 /**
788194ff 564 Insert a child into the sizer before any existing item at @a index.
3c4f71cc 565
788194ff 566 See Add() for the meaning of the other parameters.
23324ae1 567 */
788194ff
FM
568 wxSizerItem* Insert(size_t index, wxSizer* sizer,
569 const wxSizerFlags& flags);
23324ae1
FM
570
571 /**
788194ff 572 Insert a child into the sizer before any existing item at @a index.
23324ae1 573
788194ff 574 See Add() for the meaning of the other parameters.
23324ae1 575 */
788194ff
FM
576 wxSizerItem* Insert(size_t index, wxSizer* sizer,
577 int proportion = 0,
578 int flag = 0,
579 int border = 0,
580 wxObject* userData = NULL);
23324ae1
FM
581
582 /**
788194ff
FM
583 Insert a child into the sizer before any existing item at @a index.
584
585 See Add() for the meaning of the other parameters.
23324ae1 586 */
788194ff
FM
587 wxSizerItem* Insert(size_t index, int width, int height,
588 int proportion = 0,
589 int flag = 0,
590 int border = 0,
591 wxObject* userData = NULL);
e6273b91
RD
592 /**
593 Insert a child into the sizer before any existing item at @a index.
594
595 See Add() for the meaning of the other parameters.
596 */
597 wxSizerItem* Insert(size_t index,
598 int width,
599 int height,
600 const wxSizerFlags& flags);
23324ae1 601
7106fc46
RD
602 wxSizerItem* Insert(size_t index, wxSizerItem* item);
603
23324ae1 604 /**
788194ff 605 Inserts non-stretchable space to the sizer.
f81114dc 606 More readable way of calling wxSizer::Insert(index, size, size).
23324ae1 607 */
788194ff 608 wxSizerItem* InsertSpacer(size_t index, int size);
23324ae1
FM
609
610 /**
788194ff
FM
611 Inserts stretchable space to the sizer.
612 More readable way of calling wxSizer::Insert(0, 0, prop).
23324ae1 613 */
788194ff 614 wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1);
23324ae1
FM
615
616 /**
788194ff
FM
617 Return @true if the sizer has no elements.
618
619 @see GetItemCount()
620 */
621 bool IsEmpty() const;
23324ae1 622
01195a1b 623 /**
788194ff 624 Returns @true if the @a window is shown.
01195a1b 625
788194ff 626 @see Hide(), Show(), wxSizerItem::IsShown()
01195a1b 627 */
788194ff 628 bool IsShown(wxWindow* window) const;
01195a1b 629
23324ae1 630 /**
788194ff
FM
631 Returns @true if the @a sizer is shown.
632
633 @see Hide(), Show(), wxSizerItem::IsShown()
23324ae1 634 */
788194ff 635 bool IsShown(wxSizer* sizer) const;
23324ae1
FM
636
637 /**
788194ff 638 Returns @true if the item at @a index is shown.
3c4f71cc 639
788194ff 640 @see Hide(), Show(), wxSizerItem::IsShown()
23324ae1 641 */
788194ff 642 bool IsShown(size_t index) const;
23324ae1
FM
643
644 /**
0824e369 645 Call this to force layout of the children anew, e.g.\ after having added a child
788194ff
FM
646 to or removed a child (window, other sizer or space) from the sizer while
647 keeping the current dimension.
23324ae1 648 */
788194ff 649 virtual void Layout();
23324ae1
FM
650
651 /**
788194ff
FM
652 Same as Add(), but prepends the items to the beginning of the
653 list of items (windows, subsizers or spaces) owned by this sizer.
23324ae1 654 */
788194ff 655 wxSizerItem* Prepend(wxWindow* window, const wxSizerFlags& flags);
23324ae1
FM
656
657 /**
788194ff
FM
658 Same as Add(), but prepends the items to the beginning of the
659 list of items (windows, subsizers or spaces) owned by this sizer.
23324ae1 660 */
788194ff
FM
661 wxSizerItem* Prepend(wxWindow* window, int proportion = 0,
662 int flag = 0,
663 int border = 0,
664 wxObject* userData = NULL);
23324ae1
FM
665
666 /**
788194ff
FM
667 Same as Add(), but prepends the items to the beginning of the
668 list of items (windows, subsizers or spaces) owned by this sizer.
23324ae1 669 */
788194ff
FM
670 wxSizerItem* Prepend(wxSizer* sizer,
671 const wxSizerFlags& flags);
23324ae1
FM
672
673 /**
788194ff
FM
674 Same as Add(), but prepends the items to the beginning of the
675 list of items (windows, subsizers or spaces) owned by this sizer.
23324ae1 676 */
788194ff
FM
677 wxSizerItem* Prepend(wxSizer* sizer, int proportion = 0,
678 int flag = 0,
679 int border = 0,
680 wxObject* userData = NULL);
23324ae1 681
788194ff
FM
682 /**
683 Same as Add(), but prepends the items to the beginning of the
684 list of items (windows, subsizers or spaces) owned by this sizer.
685 */
686 wxSizerItem* Prepend(int width, int height,
687 int proportion = 0,
688 int flag = 0,
689 int border = 0,
690 wxObject* userData = NULL);
23324ae1 691
e6273b91
RD
692 /**
693 Same as Add(), but prepends the items to the beginning of the
694 list of items (windows, subsizers or spaces) owned by this sizer.
695 */
696 wxSizerItem* Prepend(int width, int height, const wxSizerFlags& flags);
697
7106fc46
RD
698 wxSizerItem* Prepend(wxSizerItem* item);
699
788194ff
FM
700 /**
701 Prepends non-stretchable space to the sizer.
702 More readable way of calling wxSizer::Prepend(size, size, 0).
703 */
704 wxSizerItem* PrependSpacer(int size);
e54c96f1 705
788194ff
FM
706 /**
707 Prepends stretchable space to the sizer.
708 More readable way of calling wxSizer::Prepend(0, 0, prop).
709 */
710 wxSizerItem* PrependStretchSpacer(int prop = 1);
7c913512 711
788194ff
FM
712 /**
713 This method is abstract and has to be overwritten by any derived class.
714 Here, the sizer will do the actual calculation of its children's
715 positions and sizes.
716 */
717 virtual void RecalcSizes() = 0;
7c913512 718
788194ff
FM
719 /**
720 Removes a child window from the sizer, but does @b not destroy it
721 (because windows are owned by their parent window, not the sizer).
7c913512 722
788194ff
FM
723 @deprecated
724 The overload of this method taking a wxWindow* parameter
725 is deprecated as it does not destroy the window as would usually be
726 expected from Remove(). You should use Detach() in new code instead.
727 There is currently no wxSizer method that will both detach and destroy
728 a wxWindow item.
729
730 @note This method does not cause any layout or resizing to take
731 place, call Layout() to update the layout "on screen" after
732 removing a child from the sizer.
733
734 @return @true if the child item was found and removed, @false otherwise.
735 */
736 virtual bool Remove(wxWindow* window);
7c913512 737
23324ae1 738 /**
788194ff 739 Removes a sizer child from the sizer and destroys it.
e725ba4f 740
788194ff
FM
741 @note This method does not cause any layout or resizing to take
742 place, call Layout() to update the layout "on screen" after
743 removing a child from the sizer.
e725ba4f 744
788194ff
FM
745 @param sizer The wxSizer to be removed.
746
747 @return @true if the child item was found and removed, @false otherwise.
23324ae1 748 */
788194ff 749 virtual bool Remove(wxSizer* sizer);
23324ae1
FM
750
751 /**
788194ff
FM
752 Removes a child from the sizer and destroys it if it is a sizer or a
753 spacer, but not if it is a window (because windows are owned by their
754 parent window, not the sizer).
67ef83eb 755
788194ff
FM
756 @note This method does not cause any layout or resizing to take
757 place, call Layout() to update the layout "on screen" after
758 removing a child from the sizer.
67ef83eb 759
788194ff
FM
760 @param index
761 The position of the child in the sizer, e.g. 0 for the first item.
762
763 @return @true if the child item was found and removed, @false otherwise.
23324ae1 764 */
788194ff 765 virtual bool Remove(int index);
23324ae1
FM
766
767 /**
788194ff
FM
768 Detaches the given @a oldwin from the sizer and replaces it with the
769 given @a newwin. The detached child window is @b not deleted (because
770 windows are owned by their parent window, not the sizer).
67ef83eb 771
788194ff
FM
772 Use parameter @a recursive to search the given element recursively in subsizers.
773
774 This method does not cause any layout or resizing to take place,
775 call Layout() to update the layout "on screen" after replacing a
776 child from the sizer.
777
778 Returns @true if the child item was found and removed, @false otherwise.
23324ae1 779 */
788194ff
FM
780 virtual bool Replace(wxWindow* oldwin, wxWindow* newwin,
781 bool recursive = false);
23324ae1
FM
782
783 /**
788194ff
FM
784 Detaches the given @a oldsz from the sizer and replaces it with the
785 given @a newsz. The detached child sizer is deleted.
3c4f71cc 786
788194ff 787 Use parameter @a recursive to search the given element recursively in subsizers.
3c4f71cc 788
788194ff
FM
789 This method does not cause any layout or resizing to take place,
790 call Layout() to update the layout "on screen" after replacing a
791 child from the sizer.
792
793 Returns @true if the child item was found and removed, @false otherwise.
23324ae1 794 */
788194ff
FM
795 virtual bool Replace(wxSizer* oldsz, wxSizer* newsz,
796 bool recursive = false);
23324ae1
FM
797
798 /**
788194ff
FM
799 Detaches the given item at position @a index from the sizer and
800 replaces it with the given wxSizerItem @a newitem.
3c4f71cc 801
788194ff
FM
802 The detached child is deleted @b only if it is a sizer or a spacer
803 (but not if it is a wxWindow because windows are owned by their
804 parent window, not the sizer).
893039c0 805
788194ff
FM
806 This method does not cause any layout or resizing to take place,
807 call Layout() to update the layout "on screen" after replacing a
808 child from the sizer.
3c4f71cc 809
788194ff 810 Returns @true if the child item was found and removed, @false otherwise.
23324ae1 811 */
788194ff 812 virtual bool Replace(size_t index, wxSizerItem* newitem);
23324ae1 813
67ef83eb 814 /**
788194ff
FM
815 Call this to force the sizer to take the given dimension and thus force
816 the items owned by the sizer to resize themselves according to the
817 rules defined by the parameter in the Add() and Prepend() methods.
67ef83eb 818 */
788194ff 819 void SetDimension(int x, int y, int width, int height);
67ef83eb
VZ
820
821 /**
788194ff
FM
822 @overload
823 */
824 void SetDimension(const wxPoint& pos, const wxSize& size);
67ef83eb 825
788194ff
FM
826 /**
827 Set an item's minimum size by window, sizer, or position.
828
788194ff
FM
829 This function enables an application to set the size of an item after
830 initial creation.
831
58c69c44
VZ
832 The @a window or @a sizer will be found recursively in the sizer's
833 descendants.
834
788194ff 835 @see wxSizerItem::SetMinSize()
58c69c44
VZ
836
837 @return
838 @true if the minimal size was successfully set or @false if the
839 item was not found.
67ef83eb 840 */
58c69c44 841 //@{
788194ff 842 bool SetItemMinSize(wxWindow* window, int width, int height);
58c69c44 843 bool SetItemMinSize(wxWindow* window, const wxSize& size);
67ef83eb 844
788194ff 845 bool SetItemMinSize(wxSizer* sizer, int width, int height);
58c69c44 846 bool SetItemMinSize(wxSizer* sizer, const wxSize& size);
23324ae1 847
788194ff 848 bool SetItemMinSize(size_t index, int width, int height);
58c69c44
VZ
849 bool SetItemMinSize(size_t index, const wxSize& size);
850 //@}
23324ae1
FM
851
852 /**
788194ff 853 Call this to give the sizer a minimal size.
e725ba4f 854
788194ff
FM
855 Normally, the sizer will calculate its minimal size based purely on how
856 much space its children need. After calling this method GetMinSize()
857 will return either the minimal size as requested by its children or the
858 minimal size set here, depending on which is bigger.
23324ae1 859 */
788194ff 860 void SetMinSize(const wxSize& size);
23324ae1
FM
861
862 /**
788194ff
FM
863 @overload
864 */
865 void SetMinSize(int width, int height);
e725ba4f 866
788194ff
FM
867 /**
868 This method first calls Fit() and then wxTopLevelWindow::SetSizeHints()
869 on the @a window passed to it.
23324ae1 870
788194ff
FM
871 This only makes sense when @a window is actually a wxTopLevelWindow such
872 as a wxFrame or a wxDialog, since SetSizeHints only has any effect in these classes.
873 It does nothing in normal windows or controls.
23324ae1 874
788194ff
FM
875 This method is implicitly used by wxWindow::SetSizerAndFit() which is
876 commonly invoked in the constructor of a toplevel window itself (see
877 the sample in the description of wxBoxSizer) if the toplevel window is
878 resizable.
879 */
880 void SetSizeHints(wxWindow* window);
e54c96f1 881
788194ff
FM
882 /**
883 Tell the sizer to set the minimal size of the @a window virtual area to match
884 the sizer's minimal size. For windows with managed scrollbars this will set them
885 appropriately.
7c913512 886
df7d641d
VZ
887 @deprecated This is exactly the same as FitInside() in wxWidgets 2.9
888 and later, please replace calls to it with FitInside().
7c913512 889
788194ff 890 @see wxScrolled::SetScrollbars()
23324ae1 891 */
788194ff 892 void SetVirtualSizeHints(wxWindow* window);
23324ae1
FM
893
894 /**
788194ff
FM
895 Shows or hides the @a window.
896 To make a sizer item disappear or reappear, use Show() followed by Layout().
23324ae1 897
788194ff 898 Use parameter @a recursive to show or hide elements found in subsizers.
5886ce02 899
788194ff 900 Returns @true if the child item was found, @false otherwise.
3c4f71cc 901
788194ff 902 @see Hide(), IsShown()
5886ce02 903 */
788194ff
FM
904 bool Show(wxWindow* window, bool show = true,
905 bool recursive = false);
3c4f71cc 906
5886ce02 907 /**
788194ff
FM
908 Shows or hides @a sizer.
909 To make a sizer item disappear or reappear, use Show() followed by Layout().
3c4f71cc 910
788194ff 911 Use parameter @a recursive to show or hide elements found in subsizers.
3c4f71cc 912
788194ff 913 Returns @true if the child item was found, @false otherwise.
3c4f71cc 914
788194ff 915 @see Hide(), IsShown()
5886ce02 916 */
788194ff
FM
917 bool Show(wxSizer* sizer, bool show = true,
918 bool recursive = false);
3c4f71cc 919
5886ce02 920 /**
788194ff
FM
921 Shows the item at @a index.
922 To make a sizer item disappear or reappear, use Show() followed by Layout().
3c4f71cc 923
788194ff 924 Returns @true if the child item was found, @false otherwise.
3c4f71cc 925
788194ff 926 @see Hide(), IsShown()
23324ae1 927 */
788194ff 928 bool Show(size_t index, bool show = true);
0c3140ca
RD
929
930
931 /**
932 Show or hide all items managed by the sizer.
933 */
934 virtual void ShowItems(bool show);
935
788194ff 936};
5886ce02 937
5886ce02 938
788194ff
FM
939/**
940 @class wxStdDialogButtonSizer
5886ce02 941
788194ff
FM
942 This class creates button layouts which conform to the standard button spacing
943 and ordering defined by the platform or toolkit's user interface guidelines
944 (if such things exist). By using this class, you can ensure that all your
945 standard dialogs look correct on all major platforms. Currently it conforms to
946 the Windows, GTK+ and Mac OS X human interface guidelines.
5886ce02 947
788194ff
FM
948 When there aren't interface guidelines defined for a particular platform or
949 toolkit, wxStdDialogButtonSizer reverts to the Windows implementation.
23324ae1 950
788194ff
FM
951 To use this class, first add buttons to the sizer by calling
952 wxStdDialogButtonSizer::AddButton (or wxStdDialogButtonSizer::SetAffirmativeButton,
953 wxStdDialogButtonSizer::SetNegativeButton or wxStdDialogButtonSizer::SetCancelButton)
954 and then call Realize in order to create the actual button layout used.
955 Other than these special operations, this sizer works like any other sizer.
23324ae1 956
788194ff
FM
957 If you add a button with wxID_SAVE, on Mac OS X the button will be renamed to
958 "Save" and the wxID_NO button will be renamed to "Don't Save" in accordance
959 with the Mac OS X Human Interface Guidelines.
960
961 @library{wxcore}
962 @category{winlayout}
23324ae1 963
788194ff
FM
964 @see wxSizer, @ref overview_sizer, wxDialog::CreateButtonSizer
965*/
966class wxStdDialogButtonSizer : public wxBoxSizer
967{
968public:
23324ae1 969 /**
788194ff 970 Constructor for a wxStdDialogButtonSizer.
23324ae1 971 */
788194ff 972 wxStdDialogButtonSizer();
23324ae1
FM
973
974 /**
788194ff
FM
975 Adds a button to the wxStdDialogButtonSizer. The @a button must have
976 one of the following identifiers:
977 - wxID_OK
978 - wxID_YES
979 - wxID_SAVE
980 - wxID_APPLY
981 - wxID_CLOSE
982 - wxID_NO
983 - wxID_CANCEL
984 - wxID_HELP
985 - wxID_CONTEXT_HELP
23324ae1 986 */
788194ff 987 void AddButton(wxButton* button);
23324ae1
FM
988
989 /**
788194ff
FM
990 Rearranges the buttons and applies proper spacing between buttons to make
991 them match the platform or toolkit's interface guidelines.
23324ae1 992 */
788194ff 993 void Realize();
23324ae1
FM
994
995 /**
788194ff 996 Sets the affirmative button for the sizer.
491a5ece 997
788194ff
FM
998 This allows you to use identifiers other than the standard identifiers
999 outlined above.
23324ae1 1000 */
788194ff 1001 void SetAffirmativeButton(wxButton* button);
23324ae1 1002
23324ae1 1003 /**
788194ff 1004 Sets the cancel button for the sizer.
3c4f71cc 1005
788194ff
FM
1006 This allows you to use identifiers other than the standard identifiers
1007 outlined above.
23324ae1 1008 */
788194ff 1009 void SetCancelButton(wxButton* button);
1c340cc6
RR
1010
1011 /**
788194ff 1012 Sets the negative button for the sizer.
98ccd545 1013
788194ff
FM
1014 This allows you to use identifiers other than the standard identifiers
1015 outlined above.
1c340cc6 1016 */
788194ff 1017 void SetNegativeButton(wxButton* button);
7106fc46
RD
1018
1019 virtual void RecalcSizes();
1020 virtual wxSize CalcMin();
788194ff 1021};
98ccd545 1022
1c340cc6 1023
23324ae1 1024
788194ff
FM
1025/**
1026 @class wxSizerItem
e725ba4f 1027
788194ff
FM
1028 The wxSizerItem class is used to track the position, size and other
1029 attributes of each item managed by a wxSizer.
3c4f71cc 1030
788194ff
FM
1031 It is not usually necessary to use this class because the sizer elements can
1032 also be identified by their positions or window or sizer pointers but sometimes
1033 it may be more convenient to use it directly.
23324ae1 1034
788194ff
FM
1035 @library{wxcore}
1036 @category{winlayout}
1037*/
1038class wxSizerItem : public wxObject
1039{
1040public:
23324ae1 1041 /**
788194ff 1042 Construct a sizer item for tracking a spacer.
23324ae1 1043 */
5eb16fe2
RD
1044 wxSizerItem(int width, int height, int proportion=0, int flag=0,
1045 int border=0, wxObject* userData=NULL);
23324ae1 1046
e725ba4f 1047 //@{
23324ae1 1048 /**
788194ff 1049 Construct a sizer item for tracking a window.
1c340cc6 1050 */
788194ff 1051 wxSizerItem(wxWindow* window, const wxSizerFlags& flags);
5eb16fe2
RD
1052 wxSizerItem(wxWindow* window, int proportion=0, int flag=0,
1053 int border=0,
1054 wxObject* userData=NULL);
e725ba4f 1055 //@}
23324ae1 1056
788194ff 1057 //@{
23324ae1 1058 /**
788194ff 1059 Construct a sizer item for tracking a subsizer.
23324ae1 1060 */
7106fc46 1061 wxSizerItem(wxSizer* sizer, const wxSizerFlags& flags);
5eb16fe2
RD
1062 wxSizerItem(wxSizer* sizer, int proportion=0, int flag=0,
1063 int border=0,
1064 wxObject* userData=NULL);
788194ff 1065 //@}
23324ae1 1066
6b527e15 1067 /**
788194ff 1068 Deletes the user data and subsizer, if any.
6b527e15 1069 */
788194ff 1070 virtual ~wxSizerItem();
2f39b5a3 1071
16e40259
VZ
1072 /**
1073 Set the window to be tracked by this item.
1074
1075 The old window isn't deleted as it is now owned by the sizer item.
1076 */
1077 void AssignWindow(wxWindow *window);
1078
1079 /**
1080 Set the sizer tracked by this item.
1081
1082 Old sizer, if any, is deleted.
1083 */
1084 void AssignSizer(wxSizer *sizer);
1085
1086 //@{
1087 /**
1088 Set the size of the spacer tracked by this item.
1089
1090 Old spacer, if any, is deleted.
1091 */
1092 void AssignSpacer(const wxSize& size);
7106fc46 1093 void AssignSpacer(int w, int h);
16e40259
VZ
1094 //@}
1095
23324ae1 1096 /**
788194ff
FM
1097 Calculates the minimum desired size for the item, including any space
1098 needed by borders.
23324ae1 1099 */
788194ff 1100 virtual wxSize CalcMin();
98ccd545 1101
cbf2bf6a 1102 /**
788194ff
FM
1103 Destroy the window or the windows in a subsizer, depending on the type
1104 of item.
cbf2bf6a 1105 */
788194ff 1106 virtual void DeleteWindows();
e725ba4f 1107
cbf2bf6a 1108 /**
788194ff 1109 Enable deleting the SizerItem without destroying the contained sizer.
cbf2bf6a 1110 */
788194ff 1111 void DetachSizer();
23324ae1
FM
1112
1113 /**
788194ff 1114 Return the border attribute.
23324ae1 1115 */
788194ff 1116 int GetBorder() const;
23324ae1
FM
1117
1118 /**
788194ff 1119 Return the flags attribute.
e725ba4f 1120
788194ff 1121 See @ref wxsizer_flags "wxSizer flags list" for details.
23324ae1 1122 */
788194ff 1123 int GetFlag() const;
23324ae1
FM
1124
1125 /**
788194ff
FM
1126 Return the numeric id of wxSizerItem, or @c wxID_NONE if the id has
1127 not been set.
23324ae1 1128 */
788194ff 1129 int GetId() const;
23324ae1
FM
1130
1131 /**
788194ff 1132 Get the minimum size needed for the item.
23324ae1 1133 */
788194ff 1134 wxSize GetMinSize() const;
23324ae1 1135
23324ae1 1136 /**
788194ff 1137 Sets the minimum size to be allocated for this item.
98ccd545 1138
788194ff
FM
1139 If this item is a window, the @a size is also passed to
1140 wxWindow::SetMinSize().
1141 */
1142 void SetMinSize(const wxSize& size);
98ccd545 1143
788194ff
FM
1144 /**
1145 @overload
1146 */
1147 void SetMinSize(int x, int y);
3c4f71cc 1148
788194ff
FM
1149 /**
1150 What is the current position of the item, as set in the last Layout.
23324ae1 1151 */
788194ff 1152 wxPoint GetPosition() const;
1c340cc6
RR
1153
1154 /**
788194ff 1155 Get the proportion item attribute.
1c340cc6 1156 */
788194ff 1157 int GetProportion() const;
1c340cc6
RR
1158
1159 /**
788194ff
FM
1160 Get the ration item attribute.
1161 */
1162 float GetRatio() const;
1c340cc6 1163
788194ff
FM
1164 /**
1165 Get the rectangle of the item on the parent window, excluding borders.
1c340cc6 1166 */
788194ff 1167 virtual wxRect GetRect();
23324ae1 1168
23324ae1 1169 /**
788194ff
FM
1170 Get the current size of the item, as set in the last Layout.
1171 */
1172 virtual wxSize GetSize() const;
3c4f71cc 1173
788194ff
FM
1174 /**
1175 If this item is tracking a sizer, return it. @NULL otherwise.
23324ae1 1176 */
788194ff 1177 wxSizer* GetSizer() const;
1c340cc6
RR
1178
1179 /**
788194ff
FM
1180 If this item is tracking a spacer, return its size.
1181 */
1182 wxSize GetSpacer() const;
1c340cc6 1183
788194ff
FM
1184 /**
1185 Get the userData item attribute.
1c340cc6 1186 */
788194ff 1187 wxObject* GetUserData() const;
1c340cc6
RR
1188
1189 /**
788194ff 1190 If this item is tracking a window then return it. @NULL otherwise.
1c340cc6 1191 */
788194ff 1192 wxWindow* GetWindow() const;
1c340cc6
RR
1193
1194 /**
788194ff
FM
1195 Returns @true if this item is a window or a spacer and it is shown or
1196 if this item is a sizer and not all of its elements are hidden.
1c340cc6 1197
788194ff
FM
1198 In other words, for sizer items, all of the child elements must be
1199 hidden for the sizer itself to be considered hidden.
1200
1201 As an exception, if the @c wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was
1202 used for this sizer item, then IsShown() always returns @true for it
1203 (see wxSizerFlags::ReserveSpaceEvenIfHidden()).
1c340cc6 1204 */
788194ff 1205 bool IsShown() const;
1c340cc6
RR
1206
1207 /**
788194ff 1208 Is this item a sizer?
1c340cc6 1209 */
788194ff 1210 bool IsSizer() const;
23324ae1
FM
1211
1212 /**
788194ff 1213 Is this item a spacer?
23324ae1 1214 */
788194ff 1215 bool IsSpacer() const;
23324ae1
FM
1216
1217 /**
788194ff 1218 Is this item a window?
23324ae1 1219 */
788194ff 1220 bool IsWindow() const;
23324ae1 1221
6e1f851b 1222 /**
788194ff
FM
1223 Set the border item attribute.
1224 */
1225 void SetBorder(int border);
6e1f851b 1226
23324ae1 1227 /**
788194ff
FM
1228 Set the position and size of the space allocated to the sizer, and
1229 adjust the position and size of the item to be within that space
1230 taking alignment and borders into account.
23324ae1 1231 */
788194ff 1232 virtual void SetDimension(const wxPoint& pos, const wxSize& size);
01195a1b
VS
1233
1234 /**
788194ff 1235 Set the flag item attribute.
01195a1b 1236 */
788194ff 1237 void SetFlag(int flag);
01195a1b
VS
1238
1239 /**
788194ff
FM
1240 Sets the numeric id of the wxSizerItem to @e id.
1241 */
1242 void SetId(int id);
01195a1b 1243
788194ff
FM
1244 /**
1245 @todo docme.
01195a1b 1246 */
788194ff 1247 void SetInitSize(int x, int y);
23324ae1
FM
1248
1249 /**
788194ff 1250 Set the proportion item attribute.
23324ae1 1251 */
788194ff 1252 void SetProportion(int proportion);
23324ae1 1253
788194ff 1254 //@{
23324ae1 1255 /**
788194ff 1256 Set the ratio item attribute.
23324ae1 1257 */
788194ff
FM
1258 void SetRatio(int width, int height);
1259 void SetRatio(wxSize size);
1260 void SetRatio(float ratio);
1261 //@}
5886ce02
VS
1262
1263 /**
788194ff 1264 Set the sizer tracked by this item.
16e40259
VZ
1265
1266 @deprecated This function does not free the old sizer which may result
1267 in memory leaks, use AssignSizer() which does free it instead.
5886ce02 1268 */
788194ff 1269 void SetSizer(wxSizer* sizer);
5886ce02
VS
1270
1271 /**
788194ff 1272 Set the size of the spacer tracked by this item.
16e40259
VZ
1273
1274 @deprecated This function does not free the old spacer which may result
1275 in memory leaks, use AssignSpacer() which does free it instead.
5886ce02 1276 */
788194ff 1277 void SetSpacer(const wxSize& size);
5886ce02 1278
86381d42
RD
1279 void SetUserData(wxObject* userData);
1280
5886ce02 1281 /**
788194ff
FM
1282 Set the window to be tracked by this item.
1283 @deprecated @todo provide deprecation description
5886ce02 1284 */
788194ff 1285 void SetWindow(wxWindow* window);
5886ce02
VS
1286
1287 /**
788194ff
FM
1288 Set the show item attribute, which sizers use to determine if the item
1289 is to be made part of the layout or not. If the item is tracking a
1290 window then it is shown or hidden as needed.
5886ce02 1291 */
788194ff
FM
1292 void Show(bool show);
1293};
1294
1295
23324ae1 1296
788194ff
FM
1297/**
1298 @class wxSizerFlags
1299
1300 Container for sizer items flags providing readable names for them.
1301
1302 Normally, when you add an item to a sizer via wxSizer::Add, you have to
1303 specify a lot of flags and parameters which can be unwieldy. This is where
1304 wxSizerFlags comes in: it allows you to specify all parameters using the
1305 named methods instead. For example, instead of
1306
1307 @code
1308 sizer->Add(ctrl, 0, wxEXPAND | wxALL, 10);
1309 @endcode
1310
1311 you can now write
1312
1313 @code
1314 sizer->Add(ctrl, wxSizerFlags().Expand().Border(wxALL, 10));
1315 @endcode
1316
1317 This is more readable and also allows you to create wxSizerFlags objects which
1318 can be reused for several sizer items.
1319
1320 @code
1321 wxSizerFlags flagsExpand(1);
1322 flagsExpand.Expand().Border(wxALL, 10);
1323
1324 sizer->Add(ctrl1, flagsExpand);
1325 sizer->Add(ctrl2, flagsExpand);
1326 @endcode
1327
1328 Note that by specification, all methods of wxSizerFlags return the wxSizerFlags
1329 object itself to allowing chaining multiple methods calls like in the examples
1330 above.
1331
1332 @library{wxcore}
1333 @category{winlayout}
1334
1335 @see wxSizer
1336*/
1337class wxSizerFlags
1338{
1339public:
23324ae1 1340 /**
788194ff 1341 Creates the wxSizer with the proportion specified by @a proportion.
23324ae1 1342 */
788194ff 1343 wxSizerFlags(int proportion = 0);
23324ae1
FM
1344
1345 /**
788194ff
FM
1346 Sets the alignment of this wxSizerFlags to @a align.
1347
1348 This method replaces the previously set alignment with the specified one.
1349
1350 @param alignment
1351 Combination of @c wxALIGN_XXX bit masks.
1352
1353 @see Top(), Left(), Right(), Bottom(), Centre()
23324ae1 1354 */
788194ff 1355 wxSizerFlags& Align(int alignment);
23324ae1
FM
1356
1357 /**
788194ff
FM
1358 Sets the wxSizerFlags to have a border of a number of pixels specified
1359 by @a borderinpixels with the directions specified by @a direction.
23324ae1 1360 */
788194ff 1361 wxSizerFlags& Border(int direction, int borderinpixels);
23324ae1 1362
23324ae1 1363 /**
788194ff
FM
1364 Sets the wxSizerFlags to have a border with size as returned by
1365 GetDefaultBorder().
5886ce02 1366
788194ff
FM
1367 @param direction
1368 Direction(s) to apply the border in.
1369 */
1370 wxSizerFlags& Border(int direction = wxALL);
5886ce02 1371
788194ff
FM
1372 /**
1373 Aligns the object to the bottom, similar for @c Align(wxALIGN_BOTTOM).
5886ce02 1374
788194ff
FM
1375 Unlike Align(), this method doesn't change the horizontal alignment of
1376 the item.
23324ae1 1377 */
788194ff 1378 wxSizerFlags& Bottom();
5886ce02
VS
1379
1380 /**
788194ff
FM
1381 Sets the object of the wxSizerFlags to center itself in the area it is
1382 given.
1383 */
1384 wxSizerFlags& Center();
5886ce02 1385
788194ff
FM
1386 /**
1387 Center() for people with the other dialect of English.
1388 */
1389 wxSizerFlags& Centre();
5886ce02 1390
788194ff
FM
1391 /**
1392 Sets the border in the given @a direction having twice the default
1393 border size.
1394 */
1395 wxSizerFlags& DoubleBorder(int direction = wxALL);
5886ce02 1396
788194ff
FM
1397 /**
1398 Sets the border in left and right directions having twice the default
1399 border size.
5886ce02 1400 */
788194ff 1401 wxSizerFlags& DoubleHorzBorder();
5886ce02
VS
1402
1403 /**
788194ff
FM
1404 Sets the object of the wxSizerFlags to expand to fill as much area as
1405 it can.
1406 */
1407 wxSizerFlags& Expand();
5886ce02 1408
788194ff
FM
1409 /**
1410 Set the @c wxFIXED_MINSIZE flag which indicates that the initial size
1411 of the window should be also set as its minimal size.
1412 */
1413 wxSizerFlags& FixedMinSize();
5886ce02 1414
788194ff
FM
1415 /**
1416 Set the @c wxRESERVE_SPACE_EVEN_IF_HIDDEN flag. Normally wxSizers
1417 don't allocate space for hidden windows or other items. This flag
4c51a665 1418 overrides this behaviour so that sufficient space is allocated for the
788194ff
FM
1419 window even if it isn't visible. This makes it possible to dynamically
1420 show and hide controls without resizing parent dialog, for example.
5886ce02 1421
788194ff 1422 @since 2.8.8
5886ce02 1423 */
788194ff 1424 wxSizerFlags& ReserveSpaceEvenIfHidden();
23324ae1 1425
23324ae1 1426 /**
788194ff
FM
1427 Returns the border used by default in Border() method.
1428 */
1429 static int GetDefaultBorder();
3c4f71cc 1430
788194ff
FM
1431 /**
1432 Aligns the object to the left, similar for @c Align(wxALIGN_LEFT).
98ccd545 1433
788194ff
FM
1434 Unlike Align(), this method doesn't change the vertical alignment of
1435 the item.
23324ae1 1436 */
788194ff 1437 wxSizerFlags& Left();
98ccd545 1438
1c340cc6 1439 /**
788194ff
FM
1440 Sets the proportion of this wxSizerFlags to @e proportion
1441 */
1442 wxSizerFlags& Proportion(int proportion);
1c340cc6 1443
788194ff
FM
1444 /**
1445 Aligns the object to the right, similar for @c Align(wxALIGN_RIGHT).
98ccd545 1446
788194ff
FM
1447 Unlike Align(), this method doesn't change the vertical alignment of
1448 the item.
1c340cc6 1449 */
788194ff 1450 wxSizerFlags& Right();
98ccd545 1451
1c340cc6 1452 /**
788194ff
FM
1453 Set the @c wx_SHAPED flag which indicates that the elements should
1454 always keep the fixed width to height ratio equal to its original value.
1455 */
1456 wxSizerFlags& Shaped();
98ccd545 1457
788194ff
FM
1458 /**
1459 Aligns the object to the top, similar for @c Align(wxALIGN_TOP).
98ccd545 1460
788194ff
FM
1461 Unlike Align(), this method doesn't change the horizontal alignment of
1462 the item.
1c340cc6 1463 */
788194ff 1464 wxSizerFlags& Top();
23324ae1
FM
1465
1466 /**
788194ff
FM
1467 Sets the border in the given @a direction having thrice the default
1468 border size.
23324ae1 1469 */
788194ff
FM
1470 wxSizerFlags& TripleBorder(int direction = wxALL);
1471};
98ccd545 1472
23324ae1 1473
52ceb90e
FM
1474/**
1475 Values which define the behaviour for resizing wxFlexGridSizer cells in the
1476 "non-flexible" direction.
1477*/
1478enum wxFlexSizerGrowMode
1479{
1480 /// Don't resize the cells in non-flexible direction at all.
1481 wxFLEX_GROWMODE_NONE,
1482
1483 /// Uniformly resize only the specified ones (default).
1484 wxFLEX_GROWMODE_SPECIFIED,
1485
1486 /// Uniformly resize all cells.
1487 wxFLEX_GROWMODE_ALL
1488};
1489
788194ff
FM
1490/**
1491 @class wxFlexGridSizer
7e927914 1492
788194ff
FM
1493 A flex grid sizer is a sizer which lays out its children in a two-dimensional
1494 table with all table fields in one row having the same height and all fields
1495 in one column having the same width, but all rows or all columns are not
1496 necessarily the same height or width as in the wxGridSizer.
1497
1498 Since wxWidgets 2.5.0, wxFlexGridSizer can also size items equally in one
1499 direction but unequally ("flexibly") in the other. If the sizer is only
1500 flexible in one direction (this can be changed using wxFlexGridSizer::SetFlexibleDirection),
1501 it needs to be decided how the sizer should grow in the other ("non-flexible")
1502 direction in order to fill the available space.
1503 The wxFlexGridSizer::SetNonFlexibleGrowMode() method serves this purpose.
1c340cc6 1504
788194ff
FM
1505 @library{wxcore}
1506 @category{winlayout}
1507
1508 @see wxSizer, @ref overview_sizer
1509*/
1510class wxFlexGridSizer : public wxGridSizer
1511{
1512public:
1513 //@{
1c340cc6 1514 /**
4a00e77c 1515 wxFlexGridSizer constructors.
1c340cc6 1516
61503542 1517 Please see wxGridSizer::wxGridSizer documentation.
4a00e77c
VZ
1518
1519 @since 2.9.1 (except for the four argument overload)
1c340cc6 1520 */
d7bb2926 1521 wxFlexGridSizer( int cols, int vgap, int hgap );
4a00e77c
VZ
1522 wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
1523
1524 wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
1525 wxFlexGridSizer( int rows, int cols, const wxSize& gap );
788194ff 1526 //@}
1c340cc6
RR
1527
1528 /**
788194ff
FM
1529 Specifies that column @a idx (starting from zero) should be grown if
1530 there is extra space available to the sizer.
1c340cc6 1531
788194ff 1532 The @a proportion parameter has the same meaning as the stretch factor
a008d6e5
FM
1533 for the sizers (see wxBoxSizer) except that if all proportions are 0,
1534 then all columns are resized equally (instead of not being resized at all).
1c340cc6 1535
a008d6e5 1536 Notice that the column must not be already growable, if you need to change
788194ff
FM
1537 the proportion you must call RemoveGrowableCol() first and then make it
1538 growable (with a different proportion) again. You can use IsColGrowable()
1539 to check whether a column is already growable.
1c340cc6 1540 */
788194ff 1541 void AddGrowableCol(size_t idx, int proportion = 0);
23324ae1 1542
23324ae1 1543 /**
788194ff
FM
1544 Specifies that row idx (starting from zero) should be grown if there
1545 is extra space available to the sizer.
e725ba4f 1546
788194ff
FM
1547 This is identical to AddGrowableCol() except that it works with rows
1548 and not columns.
23324ae1 1549 */
788194ff 1550 void AddGrowableRow(size_t idx, int proportion = 0);
23324ae1
FM
1551
1552 /**
a008d6e5 1553 Returns a ::wxOrientation value that specifies whether the sizer flexibly
788194ff 1554 resizes its columns, rows, or both (default).
e725ba4f 1555
788194ff
FM
1556 @return
1557 One of the following values:
1558 - wxVERTICAL: Rows are flexibly sized.
1559 - wxHORIZONTAL: Columns are flexibly sized.
1560 - wxBOTH: Both rows and columns are flexibly sized (this is the default value).
e725ba4f 1561
788194ff 1562 @see SetFlexibleDirection()
23324ae1 1563 */
788194ff 1564 int GetFlexibleDirection() const;
23324ae1
FM
1565
1566 /**
788194ff
FM
1567 Returns the value that specifies how the sizer grows in the "non-flexible"
1568 direction if there is one.
3c4f71cc 1569
788194ff 1570 The behaviour of the elements in the flexible direction (i.e. both rows
a008d6e5
FM
1571 and columns by default, or rows only if GetFlexibleDirection() is
1572 @c wxVERTICAL or columns only if it is @c wxHORIZONTAL) is always governed
788194ff
FM
1573 by their proportion as specified in the call to AddGrowableRow() or
1574 AddGrowableCol(). What happens in the other direction depends on the
1575 value of returned by this function as described below.
e725ba4f 1576
788194ff
FM
1577 @return
1578 One of the following values:
1579 - wxFLEX_GROWMODE_NONE: Sizer doesn't grow its elements at all in
1580 the non-flexible direction.
1581 - wxFLEX_GROWMODE_SPECIFIED: Sizer honors growable columns/rows set
1582 with AddGrowableCol() and AddGrowableRow() in the non-flexible
1583 direction as well. In this case equal sizing applies to minimum
1584 sizes of columns or rows (this is the default value).
1585 - wxFLEX_GROWMODE_ALL: Sizer equally stretches all columns or rows in
1586 the non-flexible direction, independently of the proportions
1587 applied in the flexible direction.
1588
1589 @see SetFlexibleDirection(), SetNonFlexibleGrowMode()
23324ae1 1590 */
788194ff 1591 wxFlexSizerGrowMode GetNonFlexibleGrowMode() const;
23324ae1 1592
23324ae1 1593 /**
788194ff 1594 Returns @true if column @a idx is growable.
98ccd545 1595
788194ff
FM
1596 @since 2.9.0
1597 */
1598 bool IsColGrowable(size_t idx);
98ccd545 1599
788194ff
FM
1600 /**
1601 Returns @true if row @a idx is growable.
3c4f71cc 1602
788194ff 1603 @since 2.9.0
23324ae1 1604 */
788194ff 1605 bool IsRowGrowable(size_t idx);
1c340cc6
RR
1606
1607 /**
a008d6e5 1608 Specifies that the @a idx column index is no longer growable.
788194ff
FM
1609 */
1610 void RemoveGrowableCol(size_t idx);
98ccd545 1611
788194ff 1612 /**
a008d6e5 1613 Specifies that the @a idx row index is no longer growable.
788194ff
FM
1614 */
1615 void RemoveGrowableRow(size_t idx);
98ccd545 1616
788194ff
FM
1617 /**
1618 Specifies whether the sizer should flexibly resize its columns, rows, or both.
1c340cc6 1619
788194ff
FM
1620 Argument @a direction can be @c wxVERTICAL, @c wxHORIZONTAL or @c wxBOTH
1621 (which is the default value). Any other value is ignored.
a008d6e5 1622
788194ff
FM
1623 See GetFlexibleDirection() for the explanation of these values.
1624 Note that this method does not trigger relayout.
1c340cc6 1625 */
788194ff 1626 void SetFlexibleDirection(int direction);
1c340cc6
RR
1627
1628 /**
788194ff
FM
1629 Specifies how the sizer should grow in the non-flexible direction if
1630 there is one (so SetFlexibleDirection() must have been called previously).
1c340cc6 1631
788194ff
FM
1632 Argument @a mode can be one of those documented in GetNonFlexibleGrowMode(),
1633 please see there for their explanation.
1634 Note that this method does not trigger relayout.
1c340cc6 1635 */
788194ff 1636 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode);
8ff9b17d
RD
1637
1638 virtual void RecalcSizes();
8ff9b17d
RD
1639 virtual wxSize CalcMin();
1640
23324ae1
FM
1641};
1642
1643
1644/**
1645 @class wxGridSizer
7c913512 1646
23324ae1 1647 A grid sizer is a sizer which lays out its children in a two-dimensional
e725ba4f
FM
1648 table with all table fields having the same size, i.e. the width of each
1649 field is the width of the widest child, the height of each field is the
1650 height of the tallest child.
7c913512 1651
23324ae1
FM
1652 @library{wxcore}
1653 @category{winlayout}
7c913512 1654
e725ba4f 1655 @see wxSizer, @ref overview_sizer
23324ae1
FM
1656*/
1657class wxGridSizer : public wxSizer
1658{
1659public:
1660 //@{
1661 /**
7e6edd27 1662 wxGridSizer constructors.
e725ba4f 1663
61503542 1664 Usually only the number of columns in the flex grid sizer needs to be
7e6edd27
VZ
1665 specified using @a cols argument. The number of rows will be deduced
1666 automatically depending on the number of the elements added to the
61503542
VZ
1667 sizer.
1668
1669 If a constructor form with @a rows parameter is used (and the value of
1670 @a rows argument is not zero, meaning "unspecified") the sizer will
1671 check that no more than @c cols*rows elements are added to it, i.e.
1672 that no more than the given number of @a rows is used. Adding less than
1673 maximally allowed number of items is not an error however.
e725ba4f 1674
61503542
VZ
1675 Finally, it is also possible to specify the number of rows and use 0
1676 for @a cols. In this case, the sizer will use the given fixed number of
1677 rows and as many columns as necessary.
1678
1679 The @a gap (or @a vgap and @a hgap, which correspond to the height and
1680 width of the wxSize object) argument defines the size of the padding
1681 between the rows (its vertical component, or @a vgap) and columns
7345d6c1 1682 (its horizontal component, or @a hgap), in pixels.
7e6edd27 1683
61503542 1684
7e6edd27 1685 @since 2.9.1 (except for the four argument overload)
23324ae1 1686 */
7e6edd27
VZ
1687 wxGridSizer( int cols, int vgap, int hgap );
1688 wxGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
1689
1690 wxGridSizer( int rows, int cols, int vgap, int hgap );
1691 wxGridSizer( int rows, int cols, const wxSize& gap );
23324ae1
FM
1692 //@}
1693
1694 /**
0e92a846 1695 Returns the number of columns that has been specified for the
0274a797
VZ
1696 sizer.
1697
1698 Returns zero if the sizer is automatically adjusting the number of
0e92a846
RR
1699 columns depending on number of its children. To get the effective
1700 number of columns or rows being currently used, see GetEffectiveColsCount()
23324ae1 1701 */
adaaa686 1702 int GetCols() const;
0e92a846
RR
1703
1704 /**
1705 Returns the number of rows that has been specified for the
1706 sizer.
1707
1708 Returns zero if the sizer is automatically adjusting the number of
1709 rows depending on number of its children. To get the effective
1710 number of columns or rows being currently used, see GetEffectiveRowsCount().
1711 */
0274a797 1712 int GetRows() const;
23324ae1
FM
1713
1714 /**
0e92a846 1715 Returns the number of columns currently used by the sizer.
0274a797
VZ
1716
1717 This will depend on the number of children the sizer has if
1718 the sizer is automatically adjusting the number of columns/rows.
1719
1720 @since 2.9.1
23324ae1 1721 */
0274a797 1722 int GetEffectiveColsCount() const;
0e92a846
RR
1723
1724 /**
1725 Returns the number of rows currently used by the sizer.
1726
1727 This will depend on the number of children the sizer has if
1728 the sizer is automatically adjusting the number of columns/rows.
1729
1730 @since 2.9.1
1731 */
0274a797 1732 int GetEffectiveRowsCount() const;
23324ae1
FM
1733
1734 /**
0274a797 1735 Returns the horizontal gap (in pixels) between cells in the sizer.
23324ae1 1736 */
0274a797 1737 int GetHGap() const;
23324ae1
FM
1738
1739 /**
1740 Returns the vertical gap (in pixels) between the cells in the sizer.
1741 */
adaaa686 1742 int GetVGap() const;
23324ae1
FM
1743
1744 /**
1745 Sets the number of columns in the sizer.
1746 */
1747 void SetCols(int cols);
1748
1749 /**
1750 Sets the horizontal gap (in pixels) between cells in the sizer.
1751 */
1752 void SetHGap(int gap);
1753
1754 /**
1755 Sets the number of rows in the sizer.
1756 */
1757 void SetRows(int rows);
1758
1759 /**
1760 Sets the vertical gap (in pixels) between the cells in the sizer.
1761 */
1762 void SetVGap(int gap);
7106fc46
RD
1763
1764 virtual wxSize CalcMin();
1765 virtual void RecalcSizes();
23324ae1
FM
1766};
1767
1768
e54c96f1 1769
23324ae1
FM
1770/**
1771 @class wxStaticBoxSizer
7c913512 1772
338c3ec7 1773 wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static box around
f3289ffb
FM
1774 the sizer.
1775
338c3ec7 1776 The static box may be either created independently or the sizer may create it
f3289ffb
FM
1777 itself as a convenience. In any case, the sizer owns the wxStaticBox control
1778 and will delete it in the wxStaticBoxSizer destructor.
338c3ec7
VZ
1779
1780 Note that since wxWidgets 2.9.1 you are encouraged to create the windows
1781 which are added to wxStaticBoxSizer as children of wxStaticBox itself, see
1782 this class documentation for more details.
1783
1784 Example of use of this class:
39cdc95f 1785 @code
338c3ec7
VZ
1786 void MyFrame::CreateControls()
1787 {
1788 wxPanel *panel = new wxPanel(this);
1789 ...
1790 wxStaticBoxSizer *sz = new wxStaticBoxSizer(wxVERTICAL, panel, "Box");
1791 sz->Add(new wxStaticText(sz->GetStaticBox(), wxID_ANY,
1792 "This window is a child of the staticbox"));
1793 ...
1794 }
39cdc95f 1795 @endcode
7c913512 1796
23324ae1
FM
1797 @library{wxcore}
1798 @category{winlayout}
7c913512 1799
98ccd545 1800 @see wxSizer, wxStaticBox, wxBoxSizer, @ref overview_sizer
23324ae1
FM
1801*/
1802class wxStaticBoxSizer : public wxBoxSizer
1803{
1804public:
23324ae1 1805 /**
e725ba4f
FM
1806 This constructor uses an already existing static box.
1807
f3289ffb
FM
1808 @param box
1809 The static box to associate with the sizer (which will take its
1810 ownership).
1811 @param orient
1812 Can be either @c wxVERTICAL or @c wxHORIZONTAL.
23324ae1
FM
1813 */
1814 wxStaticBoxSizer(wxStaticBox* box, int orient);
e725ba4f
FM
1815
1816 /**
1817 This constructor creates a new static box with the given label and parent window.
1818 */
11e3af6e 1819 wxStaticBoxSizer(int orient, wxWindow *parent,
7c913512 1820 const wxString& label = wxEmptyString);
23324ae1
FM
1821
1822 /**
1823 Returns the static box associated with the sizer.
1824 */
18e8e19b 1825 wxStaticBox* GetStaticBox() const;
7106fc46
RD
1826
1827 virtual wxSize CalcMin();
1828 virtual void RecalcSizes();
23324ae1
FM
1829};
1830
1831
e54c96f1 1832
23324ae1
FM
1833/**
1834 @class wxBoxSizer
7c913512 1835
23324ae1 1836 The basic idea behind a box sizer is that windows will most often be laid out
e725ba4f
FM
1837 in rather simple basic geometry, typically in a row or a column or several
1838 hierarchies of either.
7c913512 1839
e725ba4f 1840 For more information, please see @ref overview_sizer_box.
7c913512 1841
23324ae1
FM
1842 @library{wxcore}
1843 @category{winlayout}
7c913512 1844
e725ba4f 1845 @see wxSizer, @ref overview_sizer
23324ae1
FM
1846*/
1847class wxBoxSizer : public wxSizer
1848{
1849public:
1850 /**
4cc4bfaf 1851 Constructor for a wxBoxSizer. @a orient may be either of wxVERTICAL
23324ae1
FM
1852 or wxHORIZONTAL for creating either a column sizer or a row sizer.
1853 */
1854 wxBoxSizer(int orient);
1855
1a2df6a7
VZ
1856 /**
1857 Adds non-stretchable space to the main orientation of the sizer only.
1858 More readable way of calling:
1859 @code
1860 if ( wxBoxSizer::IsVertical() )
1861 {
1862 wxBoxSizer::Add(0, size, 0).
1863 }
1864 else
1865 {
1866 wxBoxSizer::Add(size, 0, 0).
1867 }
1868 @endcode
1869 */
1870 virtual wxSizerItem *AddSpacer(int size);
1871
23324ae1 1872 /**
e725ba4f
FM
1873 Implements the calculation of a box sizer's minimal.
1874
1875 It is used internally only and must not be called by the user.
1876 Documented for information.
23324ae1 1877 */
98ccd545 1878 virtual wxSize CalcMin();
23324ae1
FM
1879
1880 /**
1881 Returns the orientation of the box sizer, either wxVERTICAL
1882 or wxHORIZONTAL.
1883 */
98ccd545 1884 int GetOrientation() const;
23324ae1 1885
dec0a353
RD
1886 /**
1887 Sets the orientation of the box sizer, either wxVERTICAL
1888 or wxHORIZONTAL.
1889 */
1890 void SetOrientation(int orient);
1891
23324ae1
FM
1892 /**
1893 Implements the calculation of a box sizer's dimensions and then sets
e725ba4f
FM
1894 the size of its children (calling wxWindow::SetSize if the child is a window).
1895
1896 It is used internally only and must not be called by the user
1897 (call Layout() if you want to resize). Documented for information.
23324ae1 1898 */
7106fc46 1899 virtual void RecalcSizes();
23324ae1 1900};
e54c96f1 1901