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