1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: provide wxSizer class for layout
4 // Author: Robert Roebling and Robin Dunn
5 // Modified by: Ron Lee, Vadim Zeitlin (wxSizerFlags)
8 // Copyright: (c) Robin Dunn, Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 #include "wx/button.h"
18 #include "wx/window.h"
20 #include "wx/dialog.h"
22 //---------------------------------------------------------------------------
24 //---------------------------------------------------------------------------
26 class WXDLLEXPORT wxSizerItem
;
27 class WXDLLEXPORT wxSizer
;
28 class WXDLLEXPORT wxBoxSizer
;
31 // ----------------------------------------------------------------------------
32 // wxSizerFlags: flags used for an item in the sizer
33 // ----------------------------------------------------------------------------
35 class WXDLLEXPORT wxSizerFlags
38 // construct the flags object initialized with the given proportion (0 by
40 wxSizerFlags(int proportion
= 0) : m_proportion(proportion
)
46 // setters for all sizer flags, they all return the object itself so that
47 // calls to them can be chained
49 wxSizerFlags
& Proportion(int proportion
)
51 m_proportion
= proportion
;
55 wxSizerFlags
& Align(int alignment
) // combination of wxAlignment values
57 m_flags
&= ~wxALIGN_MASK
;
63 wxSizerFlags
& Expand()
69 // some shortcuts for Align()
70 wxSizerFlags
& Centre() { return Align(wxCENTRE
); }
71 wxSizerFlags
& Center() { return Centre(); }
72 wxSizerFlags
& Left() { return Align(wxALIGN_LEFT
); }
73 wxSizerFlags
& Right() { return Align(wxALIGN_RIGHT
); }
76 wxSizerFlags
& Border(int direction
, int borderInPixels
)
81 m_borderInPixels
= borderInPixels
;
86 wxSizerFlags
& Border(int direction
= wxALL
)
88 // FIXME: default border size shouldn't be hardcoded
90 // no borders by default on limited size screen
91 wxUnusedVar(direction
);
95 return Border(direction
, 5);
100 // accessors for wxSizer only
101 int GetProportion() const { return m_proportion
; }
102 int GetFlags() const { return m_flags
; }
103 int GetBorderInPixels() const { return m_borderInPixels
; }
108 int m_borderInPixels
;
112 // ----------------------------------------------------------------------------
113 // wxSizerSpacer: used by wxSizerItem to represent a spacer
114 // ----------------------------------------------------------------------------
116 class WXDLLEXPORT wxSizerSpacer
119 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
121 void SetSize(const wxSize
& size
) { m_size
= size
; }
122 const wxSize
& GetSize() const { return m_size
; }
124 void Show(bool show
) { m_isShown
= show
; }
125 bool IsShown() const { return m_isShown
; }
128 // the size, in pixel
131 // is the spacer currently shown?
135 // ----------------------------------------------------------------------------
137 // ----------------------------------------------------------------------------
139 class WXDLLEXPORT wxSizerItem
: public wxObject
143 wxSizerItem( wxWindow
*window
,
147 wxObject
* userData
);
150 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
158 wxSizerItem( wxSizer
*sizer
,
162 wxObject
* userData
);
165 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
173 wxSizerItem( int width
,
181 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
185 SetSpacer(width
, height
);
189 virtual ~wxSizerItem();
191 virtual void DeleteWindows();
193 // Enable deleting the SizerItem without destroying the contained sizer.
194 void DetachSizer() { m_sizer
= NULL
; }
196 virtual wxSize
GetSize() const;
197 virtual wxSize
CalcMin();
198 virtual void SetDimension( const wxPoint
& pos
, const wxSize
& size
);
200 wxSize
GetMinSize() const
201 { return m_minSize
; }
202 wxSize
GetMinSizeWithBorder() const;
204 void SetMinSize(const wxSize
& size
)
207 m_window
->SetMinSize(size
);
210 void SetMinSize( int x
, int y
)
211 { SetMinSize(wxSize(x
, y
)); }
212 void SetInitSize( int x
, int y
)
213 { SetMinSize(wxSize(x
, y
)); }
215 // if either of dimensions is zero, ratio is assumed to be 1
216 // to avoid "divide by zero" errors
217 void SetRatio(int width
, int height
)
218 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
219 void SetRatio(const wxSize
& size
)
220 { SetRatio(size
.x
, size
.y
); }
221 void SetRatio(float ratio
)
223 float GetRatio() const
226 virtual wxRect
GetRect() { return m_rect
; }
228 bool IsWindow() const { return m_kind
== Item_Window
; }
229 bool IsSizer() const { return m_kind
== Item_Sizer
; }
230 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
232 #if WXWIN_COMPATIBILITY_2_6
233 // Deprecated in 2.6, use {G,S}etProportion instead.
234 wxDEPRECATED( void SetOption( int option
) );
235 wxDEPRECATED( int GetOption() const );
236 #endif // WXWIN_COMPATIBILITY_2_6
238 void SetProportion( int proportion
)
239 { m_proportion
= proportion
; }
240 int GetProportion() const
241 { return m_proportion
; }
242 void SetFlag( int flag
)
246 void SetBorder( int border
)
247 { m_border
= border
; }
248 int GetBorder() const
251 wxWindow
*GetWindow() const
252 { return m_kind
== Item_Window
? m_window
: NULL
; }
253 wxSizer
*GetSizer() const
254 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
255 wxSize
GetSpacer() const;
257 // this function behaves obviously for the windows and spacers but for the
258 // sizers it returns true if any sizer element is shown and only returns
259 // false if all of them are hidden
260 bool IsShown() const;
261 void Show(bool show
);
263 void SetUserData(wxObject
* userData
)
264 { delete m_userData
; m_userData
= userData
; }
265 wxObject
* GetUserData() const
266 { return m_userData
; }
267 wxPoint
GetPosition() const
271 // these functions do not free old sizer/spacer
272 void SetWindow(wxWindow
*window
);
273 void SetSizer(wxSizer
*sizer
);
274 void SetSpacer(const wxSize
& size
);
275 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
278 // common part of several ctors
279 void Init() { m_userData
= NULL
; }
281 // common part of ctors taking wxSizerFlags
282 void Init(const wxSizerFlags
& flags
);
285 // discriminated union: depending on m_kind one of the fields is valid
298 wxSizerSpacer
*m_spacer
;
307 // on screen rectangle of this item (not including borders)
310 // Aspect ratio can always be calculated from m_size,
311 // but this would cause precision loss when the window
312 // is shrunk. It is safer to preserve the initial value.
315 wxObject
*m_userData
;
318 DECLARE_CLASS(wxSizerItem
)
319 DECLARE_NO_COPY_CLASS(wxSizerItem
)
322 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
325 //---------------------------------------------------------------------------
327 //---------------------------------------------------------------------------
329 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
335 // methods for adding elements to the sizer: there are Add/Insert/Prepend
336 // overloads for each of window/sizer/spacer/wxSizerItem
337 inline wxSizerItem
* Add( wxWindow
*window
,
341 wxObject
* userData
= NULL
);
342 inline wxSizerItem
* Add( wxSizer
*sizer
,
346 wxObject
* userData
= NULL
);
347 inline wxSizerItem
* Add( int width
,
352 wxObject
* userData
= NULL
);
353 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
354 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
355 inline wxSizerItem
* Add( wxSizerItem
*item
);
357 inline wxSizerItem
* AddSpacer(int size
);
358 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
360 inline wxSizerItem
* Insert( size_t index
,
365 wxObject
* userData
= NULL
);
366 inline wxSizerItem
* Insert( size_t index
,
371 wxObject
* userData
= NULL
);
372 inline wxSizerItem
* Insert( size_t index
,
378 wxObject
* userData
= NULL
);
379 inline wxSizerItem
* Insert( size_t index
,
381 const wxSizerFlags
& flags
);
382 inline wxSizerItem
* Insert( size_t index
,
384 const wxSizerFlags
& flags
);
385 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
387 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
388 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
390 inline wxSizerItem
* Prepend( wxWindow
*window
,
394 wxObject
* userData
= NULL
);
395 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
399 wxObject
* userData
= NULL
);
400 inline wxSizerItem
* Prepend( int width
,
405 wxObject
* userData
= NULL
);
406 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
407 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
408 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
410 inline wxSizerItem
* PrependSpacer(int size
);
411 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
414 #if WXWIN_COMPATIBILITY_2_6
415 // Deprecated in 2.6 since historically it does not delete the window,
416 // use Detach instead.
417 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
418 #endif // WXWIN_COMPATIBILITY_2_6
420 virtual bool Remove( wxSizer
*sizer
);
421 virtual bool Remove( int index
);
423 virtual bool Detach( wxWindow
*window
);
424 virtual bool Detach( wxSizer
*sizer
);
425 virtual bool Detach( int index
);
427 virtual bool Replace( wxWindow
*oldwin
, wxWindow
*newwin
, bool recursive
= false );
428 virtual bool Replace( wxSizer
*oldsz
, wxSizer
*newsz
, bool recursive
= false );
429 virtual bool Replace( size_t index
, wxSizerItem
*newitem
);
431 virtual void Clear( bool delete_windows
= false );
432 virtual void DeleteWindows();
434 void SetMinSize( int width
, int height
)
435 { DoSetMinSize( width
, height
); }
436 void SetMinSize( const wxSize
& size
)
437 { DoSetMinSize( size
.x
, size
.y
); }
439 // Searches recursively
440 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
441 { return DoSetItemMinSize( window
, width
, height
); }
442 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
443 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
445 // Searches recursively
446 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
447 { return DoSetItemMinSize( sizer
, width
, height
); }
448 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
449 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
451 bool SetItemMinSize( size_t index
, int width
, int height
)
452 { return DoSetItemMinSize( index
, width
, height
); }
453 bool SetItemMinSize( size_t index
, const wxSize
& size
)
454 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
456 wxSize
GetSize() const
458 wxPoint
GetPosition() const
459 { return m_position
; }
461 // Calculate the minimal size or return m_minSize if bigger.
464 virtual void RecalcSizes() = 0;
465 virtual wxSize
CalcMin() = 0;
467 virtual void Layout();
469 wxSize
Fit( wxWindow
*window
);
470 void FitInside( wxWindow
*window
);
471 void SetSizeHints( wxWindow
*window
);
472 void SetVirtualSizeHints( wxWindow
*window
);
474 wxSizerItemList
& GetChildren()
475 { return m_children
; }
477 void SetDimension( int x
, int y
, int width
, int height
);
479 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
480 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
481 wxSizerItem
* GetItem( size_t index
);
483 // Manage whether individual scene items are considered
484 // in the layout calculations or not.
485 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
486 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
487 bool Show( size_t index
, bool show
= true );
489 bool Hide( wxSizer
*sizer
, bool recursive
= false )
490 { return Show( sizer
, false, recursive
); }
491 bool Hide( wxWindow
*window
, bool recursive
= false )
492 { return Show( window
, false, recursive
); }
493 bool Hide( size_t index
)
494 { return Show( index
, false ); }
496 bool IsShown( wxWindow
*window
) const;
497 bool IsShown( wxSizer
*sizer
) const;
498 bool IsShown( size_t index
) const;
500 // Recursively call wxWindow::Show () on all sizer items.
501 virtual void ShowItems (bool show
);
503 void Show(bool show
) { ShowItems(show
); }
509 wxSizerItemList m_children
;
511 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
512 wxSize
GetMinWindowSize( wxWindow
*window
);
513 wxSize
GetMaxClientSize( wxWindow
*window
) const;
514 wxSize
GetMinClientSize( wxWindow
*window
);
515 wxSize
FitSize( wxWindow
*window
);
516 wxSize
VirtualFitSize( wxWindow
*window
);
518 virtual void DoSetMinSize( int width
, int height
);
519 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
520 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
521 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
524 DECLARE_CLASS(wxSizer
)
527 //---------------------------------------------------------------------------
529 //---------------------------------------------------------------------------
531 class WXDLLEXPORT wxGridSizer
: public wxSizer
534 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
535 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
537 virtual void RecalcSizes();
538 virtual wxSize
CalcMin();
540 void SetCols( int cols
) { m_cols
= cols
; }
541 void SetRows( int rows
) { m_rows
= rows
; }
542 void SetVGap( int gap
) { m_vgap
= gap
; }
543 void SetHGap( int gap
) { m_hgap
= gap
; }
544 int GetCols() const { return m_cols
; }
545 int GetRows() const { return m_rows
; }
546 int GetVGap() const { return m_vgap
; }
547 int GetHGap() const { return m_hgap
; }
555 // return the number of total items and the number of columns and rows
556 int CalcRowsCols(int& rows
, int& cols
) const;
558 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
561 DECLARE_CLASS(wxGridSizer
)
564 //---------------------------------------------------------------------------
566 //---------------------------------------------------------------------------
568 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
570 enum wxFlexSizerGrowMode
572 // don't resize the cells in non-flexible direction at all
573 wxFLEX_GROWMODE_NONE
,
575 // uniformly resize only the specified ones (default)
576 wxFLEX_GROWMODE_SPECIFIED
,
578 // uniformly resize all cells
582 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
586 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
587 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
588 virtual ~wxFlexGridSizer();
591 // set the rows/columns which will grow (the others will remain of the
592 // constant initial size)
593 void AddGrowableRow( size_t idx
, int proportion
= 0 );
594 void RemoveGrowableRow( size_t idx
);
595 void AddGrowableCol( size_t idx
, int proportion
= 0 );
596 void RemoveGrowableCol( size_t idx
);
599 // the sizer cells may grow in both directions, not grow at all or only
600 // grow in one direction but not the other
602 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
603 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
604 int GetFlexibleDirection() const { return m_flexDirection
; }
606 // note that the grow mode only applies to the direction which is not
608 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
609 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
611 // Read-only access to the row heights and col widths arrays
612 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
613 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
616 virtual void RecalcSizes();
617 virtual wxSize
CalcMin();
620 void AdjustForFlexDirection();
621 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
622 int nrows
, int ncols
);
624 // the heights/widths of all rows/columns
625 wxArrayInt m_rowHeights
,
628 // indices of the growable columns and rows
629 wxArrayInt m_growableRows
,
632 // proportion values of the corresponding growable rows and columns
633 wxArrayInt m_growableRowsProportions
,
634 m_growableColsProportions
;
636 // parameters describing whether the growable cells should be resized in
637 // both directions or only one
639 wxFlexSizerGrowMode m_growMode
;
641 // saves CalcMin result to optimize RecalcSizes
642 wxSize m_calculatedMinSize
;
645 DECLARE_CLASS(wxFlexGridSizer
)
646 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
649 //---------------------------------------------------------------------------
651 //---------------------------------------------------------------------------
653 class WXDLLEXPORT wxBoxSizer
: public wxSizer
656 wxBoxSizer( int orient
);
661 int GetOrientation() const
664 void SetOrientation(int orient
)
665 { m_orient
= orient
; }
676 DECLARE_CLASS(wxBoxSizer
)
679 //---------------------------------------------------------------------------
681 //---------------------------------------------------------------------------
685 class WXDLLEXPORT wxStaticBox
;
687 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
690 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
691 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
692 virtual ~wxStaticBoxSizer();
697 wxStaticBox
*GetStaticBox() const
698 { return m_staticBox
; }
700 // override to hide/show the static box as well
701 virtual void ShowItems (bool show
);
703 virtual bool Detach( wxWindow
*window
);
704 virtual bool Detach( wxSizer
*sizer
) { return wxBoxSizer::Detach(sizer
); }
705 virtual bool Detach( int index
) { return wxBoxSizer::Detach(index
); }
708 wxStaticBox
*m_staticBox
;
711 DECLARE_CLASS(wxStaticBoxSizer
)
712 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
715 #endif // wxUSE_STATBOX
719 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
722 // Constructor just creates a new wxBoxSizer, not much else.
723 // Box sizer orientation is automatically determined here:
724 // vertical for PDAs, horizontal for everything else?
725 wxStdDialogButtonSizer();
727 // Checks button ID against system IDs and sets one of the pointers below
728 // to this button. Does not do any sizer-related things here.
729 void AddButton(wxButton
*button
);
731 // Use these if no standard ID can/should be used
732 void SetAffirmativeButton( wxButton
*button
);
733 void SetNegativeButton( wxButton
*button
);
734 void SetCancelButton( wxButton
*button
);
736 // All platform-specific code here, checks which buttons exist and add
737 // them to the sizer accordingly.
738 // Note - one potential hack on Mac we could use here,
739 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
740 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
741 // I wouldn't add any other hacks like that into here,
742 // but this one I can see being useful.
745 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
746 wxButton
*GetApplyButton() const { return m_buttonApply
; }
747 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
748 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
749 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
752 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
753 wxButton
*m_buttonApply
;
754 wxButton
*m_buttonNegative
; // wxID_NO
755 wxButton
*m_buttonCancel
;
756 wxButton
*m_buttonHelp
;
759 DECLARE_CLASS(wxStdDialogButtonSizer
)
760 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
763 #endif // wxUSE_BUTTON
765 #if WXWIN_COMPATIBILITY_2_4
766 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
767 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
769 // ----------------------------------------------------------------------------
771 // ----------------------------------------------------------------------------
775 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
777 class WXDLLEXPORT wxBookCtrlBase
;
779 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
782 #if WXWIN_COMPATIBILITY_2_6
783 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
784 #endif // WXWIN_COMPATIBILITY_2_6
786 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
788 virtual void RecalcSizes();
789 virtual wxSize
CalcMin();
792 // this protected ctor lets us mark the real one above as deprecated
793 // and still have warning-free build of the library itself:
796 wxBookCtrlBase
*m_bookctrl
;
799 DECLARE_CLASS(wxBookCtrlSizer
)
800 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
806 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
808 class WXDLLEXPORT wxNotebook
;
810 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
813 #if WXWIN_COMPATIBILITY_2_6
814 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
815 #endif // WXWIN_COMPATIBILITY_2_6
817 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
820 DECLARE_CLASS(wxNotebookSizer
)
821 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
824 #endif // wxUSE_NOTEBOOK
826 #endif // wxUSE_BOOKCTRL
828 #endif // WXWIN_COMPATIBILITY_2_4
830 // ----------------------------------------------------------------------------
831 // inline functions implementation
832 // ----------------------------------------------------------------------------
835 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
837 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
841 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
843 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
847 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
849 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
853 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
855 return Add( new wxSizerItem(window
, flags
) );
859 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
861 return Add( new wxSizerItem(sizer
, flags
) );
865 wxSizer::Add( wxSizerItem
*item
)
867 return Insert( m_children
.GetCount(), item
);
871 wxSizer::AddSpacer(int size
)
873 return Add(size
, size
);
877 wxSizer::AddStretchSpacer(int prop
)
879 return Add(0, 0, prop
);
883 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
885 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
889 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
891 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
895 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
897 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
901 wxSizer::Prepend( wxSizerItem
*item
)
903 return Insert( 0, item
);
907 wxSizer::PrependSpacer(int size
)
909 return Prepend(size
, size
);
913 wxSizer::PrependStretchSpacer(int prop
)
915 return Prepend(0, 0, prop
);
919 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
921 return Prepend( new wxSizerItem(window
, flags
) );
925 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
927 return Prepend( new wxSizerItem(sizer
, flags
) );
931 wxSizer::Insert( size_t index
,
938 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
942 wxSizer::Insert( size_t index
,
949 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
953 wxSizer::Insert( size_t index
,
961 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
965 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
967 return Insert( index
, new wxSizerItem(window
, flags
) );
971 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
973 return Insert( index
, new wxSizerItem(sizer
, flags
) );
977 wxSizer::InsertSpacer(size_t index
, int size
)
979 return Insert(index
, size
, size
);
983 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
985 return Insert(index
, 0, 0, prop
);
989 #endif // __WXSIZER_H__