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/window.h"
19 //---------------------------------------------------------------------------
21 //---------------------------------------------------------------------------
23 class WXDLLEXPORT wxButton
;
24 class WXDLLEXPORT wxBoxSizer
;
25 class WXDLLEXPORT wxSizerItem
;
26 class WXDLLEXPORT wxSizer
;
28 // ----------------------------------------------------------------------------
29 // wxSizerFlags: flags used for an item in the sizer
30 // ----------------------------------------------------------------------------
32 class WXDLLEXPORT wxSizerFlags
35 // construct the flags object initialized with the given proportion (0 by
37 wxSizerFlags(int proportion
= 0) : m_proportion(proportion
)
43 // setters for all sizer flags, they all return the object itself so that
44 // calls to them can be chained
46 wxSizerFlags
& Proportion(int proportion
)
48 m_proportion
= proportion
;
52 wxSizerFlags
& Align(int alignment
) // combination of wxAlignment values
54 m_flags
&= ~wxALIGN_MASK
;
60 wxSizerFlags
& Expand()
66 // some shortcuts for Align()
67 wxSizerFlags
& Centre() { return Align(wxCENTRE
); }
68 wxSizerFlags
& Center() { return Centre(); }
69 wxSizerFlags
& Left() { return Align(wxALIGN_LEFT
); }
70 wxSizerFlags
& Right() { return Align(wxALIGN_RIGHT
); }
73 wxSizerFlags
& Border(int direction
, int borderInPixels
)
78 m_borderInPixels
= borderInPixels
;
83 wxSizerFlags
& Border(int direction
= wxALL
)
85 // FIXME: default border size shouldn't be hardcoded
87 // no borders by default on limited size screen
88 wxUnusedVar(direction
);
92 return Border(direction
, 5);
97 // accessors for wxSizer only
98 int GetProportion() const { return m_proportion
; }
99 int GetFlags() const { return m_flags
; }
100 int GetBorderInPixels() const { return m_borderInPixels
; }
105 int m_borderInPixels
;
109 // ----------------------------------------------------------------------------
110 // wxSizerSpacer: used by wxSizerItem to represent a spacer
111 // ----------------------------------------------------------------------------
113 class WXDLLEXPORT wxSizerSpacer
116 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
118 void SetSize(const wxSize
& size
) { m_size
= size
; }
119 const wxSize
& GetSize() const { return m_size
; }
121 void Show(bool show
) { m_isShown
= show
; }
122 bool IsShown() const { return m_isShown
; }
125 // the size, in pixel
128 // is the spacer currently shown?
132 // ----------------------------------------------------------------------------
134 // ----------------------------------------------------------------------------
136 class WXDLLEXPORT wxSizerItem
: public wxObject
140 wxSizerItem( wxWindow
*window
,
144 wxObject
* userData
);
147 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
155 wxSizerItem( wxSizer
*sizer
,
159 wxObject
* userData
);
162 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
170 wxSizerItem( int width
,
178 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
182 SetSpacer(width
, height
);
186 virtual ~wxSizerItem();
188 virtual void DeleteWindows();
190 // Enable deleting the SizerItem without destroying the contained sizer.
191 void DetachSizer() { m_sizer
= NULL
; }
193 virtual wxSize
GetSize() const;
194 virtual wxSize
CalcMin();
195 virtual void SetDimension( const wxPoint
& pos
, const wxSize
& size
);
197 wxSize
GetMinSize() const
198 { return m_minSize
; }
199 wxSize
GetMinSizeWithBorder() const;
201 void SetMinSize(const wxSize
& size
)
204 m_window
->SetMinSize(size
);
207 void SetMinSize( int x
, int y
)
208 { SetMinSize(wxSize(x
, y
)); }
209 void SetInitSize( int x
, int y
)
210 { SetMinSize(wxSize(x
, y
)); }
212 // if either of dimensions is zero, ratio is assumed to be 1
213 // to avoid "divide by zero" errors
214 void SetRatio(int width
, int height
)
215 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
216 void SetRatio(const wxSize
& size
)
217 { SetRatio(size
.x
, size
.y
); }
218 void SetRatio(float ratio
)
220 float GetRatio() const
223 virtual wxRect
GetRect() { return m_rect
; }
225 bool IsWindow() const { return m_kind
== Item_Window
; }
226 bool IsSizer() const { return m_kind
== Item_Sizer
; }
227 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
229 #if WXWIN_COMPATIBILITY_2_6
230 // Deprecated in 2.6, use {G,S}etProportion instead.
231 wxDEPRECATED( void SetOption( int option
) );
232 wxDEPRECATED( int GetOption() const );
233 #endif // WXWIN_COMPATIBILITY_2_6
235 void SetProportion( int proportion
)
236 { m_proportion
= proportion
; }
237 int GetProportion() const
238 { return m_proportion
; }
239 void SetFlag( int flag
)
243 void SetBorder( int border
)
244 { m_border
= border
; }
245 int GetBorder() const
248 wxWindow
*GetWindow() const
249 { return m_kind
== Item_Window
? m_window
: NULL
; }
250 wxSizer
*GetSizer() const
251 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
252 wxSize
GetSpacer() const;
254 // this function behaves obviously for the windows and spacers but for the
255 // sizers it returns true if any sizer element is shown and only returns
256 // false if all of them are hidden
257 bool IsShown() const;
258 void Show(bool show
);
260 void SetUserData(wxObject
* userData
)
261 { delete m_userData
; m_userData
= userData
; }
262 wxObject
* GetUserData() const
263 { return m_userData
; }
264 wxPoint
GetPosition() const
268 // these functions do not free old sizer/spacer
269 void SetWindow(wxWindow
*window
);
270 void SetSizer(wxSizer
*sizer
);
271 void SetSpacer(const wxSize
& size
);
272 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
275 // common part of several ctors
276 void Init() { m_userData
= NULL
; }
278 // common part of ctors taking wxSizerFlags
279 void Init(const wxSizerFlags
& flags
);
282 // discriminated union: depending on m_kind one of the fields is valid
295 wxSizerSpacer
*m_spacer
;
304 // on screen rectangle of this item (not including borders)
307 // Aspect ratio can always be calculated from m_size,
308 // but this would cause precision loss when the window
309 // is shrunk. It is safer to preserve the initial value.
312 wxObject
*m_userData
;
315 DECLARE_CLASS(wxSizerItem
)
316 DECLARE_NO_COPY_CLASS(wxSizerItem
)
319 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
322 //---------------------------------------------------------------------------
324 //---------------------------------------------------------------------------
326 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
329 wxSizer() { m_containingWindow
= NULL
; }
332 // methods for adding elements to the sizer: there are Add/Insert/Prepend
333 // overloads for each of window/sizer/spacer/wxSizerItem
334 wxSizerItem
* Add(wxWindow
*window
,
338 wxObject
* userData
= NULL
);
339 wxSizerItem
* Add(wxSizer
*sizer
,
343 wxObject
* userData
= NULL
);
344 wxSizerItem
* Add(int width
,
349 wxObject
* userData
= NULL
);
350 wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
351 wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
352 wxSizerItem
* Add( wxSizerItem
*item
);
354 wxSizerItem
* AddSpacer(int size
);
355 wxSizerItem
* AddStretchSpacer(int prop
= 1);
357 wxSizerItem
* Insert(size_t index
,
362 wxObject
* userData
= NULL
);
363 wxSizerItem
* Insert(size_t index
,
368 wxObject
* userData
= NULL
);
369 wxSizerItem
* Insert(size_t index
,
375 wxObject
* userData
= NULL
);
376 wxSizerItem
* Insert(size_t index
,
378 const wxSizerFlags
& flags
);
379 wxSizerItem
* Insert(size_t index
,
381 const wxSizerFlags
& flags
);
382 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
384 wxSizerItem
* InsertSpacer(size_t index
, int size
);
385 wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
387 wxSizerItem
* Prepend(wxWindow
*window
,
391 wxObject
* userData
= NULL
);
392 wxSizerItem
* Prepend(wxSizer
*sizer
,
396 wxObject
* userData
= NULL
);
397 wxSizerItem
* Prepend(int width
,
402 wxObject
* userData
= NULL
);
403 wxSizerItem
* Prepend(wxWindow
*window
, const wxSizerFlags
& flags
);
404 wxSizerItem
* Prepend(wxSizer
*sizer
, const wxSizerFlags
& flags
);
405 wxSizerItem
* Prepend(wxSizerItem
*item
);
407 wxSizerItem
* PrependSpacer(int size
);
408 wxSizerItem
* PrependStretchSpacer(int prop
= 1);
410 // set (or possibly unset if window is NULL) or get the window this sizer
412 void SetContainingWindow(wxWindow
*window
);
413 wxWindow
*GetContainingWindow() const { return m_containingWindow
; }
415 #if WXWIN_COMPATIBILITY_2_6
416 // Deprecated in 2.6 since historically it does not delete the window,
417 // use Detach instead.
418 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
419 #endif // WXWIN_COMPATIBILITY_2_6
421 virtual bool Remove( wxSizer
*sizer
);
422 virtual bool Remove( int index
);
424 virtual bool Detach( wxWindow
*window
);
425 virtual bool Detach( wxSizer
*sizer
);
426 virtual bool Detach( int index
);
428 virtual bool Replace( wxWindow
*oldwin
, wxWindow
*newwin
, bool recursive
= false );
429 virtual bool Replace( wxSizer
*oldsz
, wxSizer
*newsz
, bool recursive
= false );
430 virtual bool Replace( size_t index
, wxSizerItem
*newitem
);
432 virtual void Clear( bool delete_windows
= false );
433 virtual void DeleteWindows();
435 void SetMinSize( int width
, int height
)
436 { DoSetMinSize( width
, height
); }
437 void SetMinSize( const wxSize
& size
)
438 { DoSetMinSize( size
.x
, size
.y
); }
440 // Searches recursively
441 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
442 { return DoSetItemMinSize( window
, width
, height
); }
443 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
444 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
446 // Searches recursively
447 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
448 { return DoSetItemMinSize( sizer
, width
, height
); }
449 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
450 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
452 bool SetItemMinSize( size_t index
, int width
, int height
)
453 { return DoSetItemMinSize( index
, width
, height
); }
454 bool SetItemMinSize( size_t index
, const wxSize
& size
)
455 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
457 wxSize
GetSize() const
459 wxPoint
GetPosition() const
460 { return m_position
; }
462 // Calculate the minimal size or return m_minSize if bigger.
465 virtual void RecalcSizes() = 0;
466 virtual wxSize
CalcMin() = 0;
468 virtual void Layout();
470 wxSize
Fit( wxWindow
*window
);
471 void FitInside( wxWindow
*window
);
472 void SetSizeHints( wxWindow
*window
);
473 void SetVirtualSizeHints( wxWindow
*window
);
475 wxSizerItemList
& GetChildren()
476 { return m_children
; }
478 void SetDimension( int x
, int y
, int width
, int height
);
480 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
481 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
482 wxSizerItem
* GetItem( size_t index
);
484 // Manage whether individual scene items are considered
485 // in the layout calculations or not.
486 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
487 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
488 bool Show( size_t index
, bool show
= true );
490 bool Hide( wxSizer
*sizer
, bool recursive
= false )
491 { return Show( sizer
, false, recursive
); }
492 bool Hide( wxWindow
*window
, bool recursive
= false )
493 { return Show( window
, false, recursive
); }
494 bool Hide( size_t index
)
495 { return Show( index
, false ); }
497 bool IsShown( wxWindow
*window
) const;
498 bool IsShown( wxSizer
*sizer
) const;
499 bool IsShown( size_t index
) const;
501 // Recursively call wxWindow::Show () on all sizer items.
502 virtual void ShowItems (bool show
);
504 void Show(bool show
) { ShowItems(show
); }
510 wxSizerItemList m_children
;
512 // the window this sizer is used in, can be NULL
513 wxWindow
*m_containingWindow
;
515 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
516 wxSize
GetMinWindowSize( wxWindow
*window
);
517 wxSize
GetMaxClientSize( wxWindow
*window
) const;
518 wxSize
GetMinClientSize( wxWindow
*window
);
519 wxSize
FitSize( wxWindow
*window
);
520 wxSize
VirtualFitSize( wxWindow
*window
);
522 virtual void DoSetMinSize( int width
, int height
);
523 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
524 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
525 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
528 DECLARE_CLASS(wxSizer
)
531 //---------------------------------------------------------------------------
533 //---------------------------------------------------------------------------
535 class WXDLLEXPORT wxGridSizer
: public wxSizer
538 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
539 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
541 virtual void RecalcSizes();
542 virtual wxSize
CalcMin();
544 void SetCols( int cols
) { m_cols
= cols
; }
545 void SetRows( int rows
) { m_rows
= rows
; }
546 void SetVGap( int gap
) { m_vgap
= gap
; }
547 void SetHGap( int gap
) { m_hgap
= gap
; }
548 int GetCols() const { return m_cols
; }
549 int GetRows() const { return m_rows
; }
550 int GetVGap() const { return m_vgap
; }
551 int GetHGap() const { return m_hgap
; }
559 // return the number of total items and the number of columns and rows
560 int CalcRowsCols(int& rows
, int& cols
) const;
562 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
565 DECLARE_CLASS(wxGridSizer
)
568 //---------------------------------------------------------------------------
570 //---------------------------------------------------------------------------
572 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
574 enum wxFlexSizerGrowMode
576 // don't resize the cells in non-flexible direction at all
577 wxFLEX_GROWMODE_NONE
,
579 // uniformly resize only the specified ones (default)
580 wxFLEX_GROWMODE_SPECIFIED
,
582 // uniformly resize all cells
586 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
590 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
591 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
592 virtual ~wxFlexGridSizer();
595 // set the rows/columns which will grow (the others will remain of the
596 // constant initial size)
597 void AddGrowableRow( size_t idx
, int proportion
= 0 );
598 void RemoveGrowableRow( size_t idx
);
599 void AddGrowableCol( size_t idx
, int proportion
= 0 );
600 void RemoveGrowableCol( size_t idx
);
603 // the sizer cells may grow in both directions, not grow at all or only
604 // grow in one direction but not the other
606 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
607 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
608 int GetFlexibleDirection() const { return m_flexDirection
; }
610 // note that the grow mode only applies to the direction which is not
612 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
613 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
615 // Read-only access to the row heights and col widths arrays
616 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
617 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
620 virtual void RecalcSizes();
621 virtual wxSize
CalcMin();
624 void AdjustForFlexDirection();
625 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
626 int nrows
, int ncols
);
628 // the heights/widths of all rows/columns
629 wxArrayInt m_rowHeights
,
632 // indices of the growable columns and rows
633 wxArrayInt m_growableRows
,
636 // proportion values of the corresponding growable rows and columns
637 wxArrayInt m_growableRowsProportions
,
638 m_growableColsProportions
;
640 // parameters describing whether the growable cells should be resized in
641 // both directions or only one
643 wxFlexSizerGrowMode m_growMode
;
645 // saves CalcMin result to optimize RecalcSizes
646 wxSize m_calculatedMinSize
;
649 DECLARE_CLASS(wxFlexGridSizer
)
650 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
653 //---------------------------------------------------------------------------
655 //---------------------------------------------------------------------------
657 class WXDLLEXPORT wxBoxSizer
: public wxSizer
660 wxBoxSizer( int orient
);
665 int GetOrientation() const
668 void SetOrientation(int orient
)
669 { m_orient
= orient
; }
680 DECLARE_CLASS(wxBoxSizer
)
683 //---------------------------------------------------------------------------
685 //---------------------------------------------------------------------------
689 class WXDLLEXPORT wxStaticBox
;
691 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
694 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
695 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
696 virtual ~wxStaticBoxSizer();
701 wxStaticBox
*GetStaticBox() const
702 { return m_staticBox
; }
704 // override to hide/show the static box as well
705 virtual void ShowItems (bool show
);
707 virtual bool Detach( wxWindow
*window
);
708 virtual bool Detach( wxSizer
*sizer
) { return wxBoxSizer::Detach(sizer
); }
709 virtual bool Detach( int index
) { return wxBoxSizer::Detach(index
); }
712 wxStaticBox
*m_staticBox
;
715 DECLARE_CLASS(wxStaticBoxSizer
)
716 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
719 #endif // wxUSE_STATBOX
723 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
726 // Constructor just creates a new wxBoxSizer, not much else.
727 // Box sizer orientation is automatically determined here:
728 // vertical for PDAs, horizontal for everything else?
729 wxStdDialogButtonSizer();
731 // Checks button ID against system IDs and sets one of the pointers below
732 // to this button. Does not do any sizer-related things here.
733 void AddButton(wxButton
*button
);
735 // Use these if no standard ID can/should be used
736 void SetAffirmativeButton( wxButton
*button
);
737 void SetNegativeButton( wxButton
*button
);
738 void SetCancelButton( wxButton
*button
);
740 // All platform-specific code here, checks which buttons exist and add
741 // them to the sizer accordingly.
742 // Note - one potential hack on Mac we could use here,
743 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
744 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
745 // I wouldn't add any other hacks like that into here,
746 // but this one I can see being useful.
749 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
750 wxButton
*GetApplyButton() const { return m_buttonApply
; }
751 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
752 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
753 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
756 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
757 wxButton
*m_buttonApply
;
758 wxButton
*m_buttonNegative
; // wxID_NO
759 wxButton
*m_buttonCancel
;
760 wxButton
*m_buttonHelp
;
763 DECLARE_CLASS(wxStdDialogButtonSizer
)
764 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
767 #endif // wxUSE_BUTTON
769 #if WXWIN_COMPATIBILITY_2_4
770 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
771 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
773 // ----------------------------------------------------------------------------
775 // ----------------------------------------------------------------------------
779 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
781 class WXDLLEXPORT wxBookCtrlBase
;
783 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
786 #if WXWIN_COMPATIBILITY_2_6
787 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
788 #endif // WXWIN_COMPATIBILITY_2_6
790 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
792 virtual void RecalcSizes();
793 virtual wxSize
CalcMin();
796 // this protected ctor lets us mark the real one above as deprecated
797 // and still have warning-free build of the library itself:
800 wxBookCtrlBase
*m_bookctrl
;
803 DECLARE_CLASS(wxBookCtrlSizer
)
804 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
810 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
812 class WXDLLEXPORT wxNotebook
;
814 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
817 #if WXWIN_COMPATIBILITY_2_6
818 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
819 #endif // WXWIN_COMPATIBILITY_2_6
821 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
824 DECLARE_CLASS(wxNotebookSizer
)
825 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
828 #endif // wxUSE_NOTEBOOK
830 #endif // wxUSE_BOOKCTRL
832 #endif // WXWIN_COMPATIBILITY_2_4
834 // ----------------------------------------------------------------------------
835 // inline functions implementation
836 // ----------------------------------------------------------------------------
839 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
841 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
845 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
847 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
851 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
853 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
857 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
859 return Add( new wxSizerItem(window
, flags
) );
863 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
865 return Add( new wxSizerItem(sizer
, flags
) );
869 wxSizer::Add( wxSizerItem
*item
)
871 return Insert( m_children
.GetCount(), item
);
875 wxSizer::AddSpacer(int size
)
877 return Add(size
, size
);
881 wxSizer::AddStretchSpacer(int prop
)
883 return Add(0, 0, prop
);
887 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
889 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
893 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
895 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
899 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
901 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
905 wxSizer::Prepend( wxSizerItem
*item
)
907 return Insert( 0, item
);
911 wxSizer::PrependSpacer(int size
)
913 return Prepend(size
, size
);
917 wxSizer::PrependStretchSpacer(int prop
)
919 return Prepend(0, 0, prop
);
923 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
925 return Prepend( new wxSizerItem(window
, flags
) );
929 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
931 return Prepend( new wxSizerItem(sizer
, flags
) );
935 wxSizer::Insert( size_t index
,
942 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
946 wxSizer::Insert( size_t index
,
953 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
957 wxSizer::Insert( size_t index
,
965 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
969 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
971 return Insert( index
, new wxSizerItem(window
, flags
) );
975 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
977 return Insert( index
, new wxSizerItem(sizer
, flags
) );
981 wxSizer::InsertSpacer(size_t index
, int size
)
983 return Insert(index
, size
, size
);
987 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
989 return Insert(index
, 0, 0, prop
);
993 #endif // __WXSIZER_H__