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
); }
72 // default border size used by Border() below
73 static int GetDefaultBorder()
76 // no borders by default on limited size screen
78 #else // !__SMARTPHONE__
79 // FIXME: default border size shouldn't be hardcoded and at the very
80 // least they should depend on the current font size
82 #endif // __SMARTPHONE__/!__SMARTPHONE__
86 wxSizerFlags
& Border(int direction
, int borderInPixels
)
91 m_borderInPixels
= borderInPixels
;
96 wxSizerFlags
& Border(int direction
= wxALL
)
99 // no borders by default on limited size screen
100 wxUnusedVar(direction
);
104 return Border(direction
, GetDefaultBorder());
109 // accessors for wxSizer only
110 int GetProportion() const { return m_proportion
; }
111 int GetFlags() const { return m_flags
; }
112 int GetBorderInPixels() const { return m_borderInPixels
; }
117 int m_borderInPixels
;
121 // ----------------------------------------------------------------------------
122 // wxSizerSpacer: used by wxSizerItem to represent a spacer
123 // ----------------------------------------------------------------------------
125 class WXDLLEXPORT wxSizerSpacer
128 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
130 void SetSize(const wxSize
& size
) { m_size
= size
; }
131 const wxSize
& GetSize() const { return m_size
; }
133 void Show(bool show
) { m_isShown
= show
; }
134 bool IsShown() const { return m_isShown
; }
137 // the size, in pixel
140 // is the spacer currently shown?
144 // ----------------------------------------------------------------------------
146 // ----------------------------------------------------------------------------
148 class WXDLLEXPORT wxSizerItem
: public wxObject
152 wxSizerItem( wxWindow
*window
,
156 wxObject
* userData
);
159 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
167 wxSizerItem( wxSizer
*sizer
,
171 wxObject
* userData
);
174 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
182 wxSizerItem( int width
,
190 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
194 SetSpacer(width
, height
);
198 virtual ~wxSizerItem();
200 virtual void DeleteWindows();
202 // Enable deleting the SizerItem without destroying the contained sizer.
203 void DetachSizer() { m_sizer
= NULL
; }
205 virtual wxSize
GetSize() const;
206 virtual wxSize
CalcMin();
207 virtual void SetDimension( const wxPoint
& pos
, const wxSize
& size
);
209 wxSize
GetMinSize() const
210 { return m_minSize
; }
211 wxSize
GetMinSizeWithBorder() const;
213 void SetMinSize(const wxSize
& size
)
216 m_window
->SetMinSize(size
);
219 void SetMinSize( int x
, int y
)
220 { SetMinSize(wxSize(x
, y
)); }
221 void SetInitSize( int x
, int y
)
222 { SetMinSize(wxSize(x
, y
)); }
224 // if either of dimensions is zero, ratio is assumed to be 1
225 // to avoid "divide by zero" errors
226 void SetRatio(int width
, int height
)
227 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
228 void SetRatio(const wxSize
& size
)
229 { SetRatio(size
.x
, size
.y
); }
230 void SetRatio(float ratio
)
232 float GetRatio() const
235 virtual wxRect
GetRect() { return m_rect
; }
237 bool IsWindow() const { return m_kind
== Item_Window
; }
238 bool IsSizer() const { return m_kind
== Item_Sizer
; }
239 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
241 #if WXWIN_COMPATIBILITY_2_6
242 // Deprecated in 2.6, use {G,S}etProportion instead.
243 wxDEPRECATED( void SetOption( int option
) );
244 wxDEPRECATED( int GetOption() const );
245 #endif // WXWIN_COMPATIBILITY_2_6
247 void SetProportion( int proportion
)
248 { m_proportion
= proportion
; }
249 int GetProportion() const
250 { return m_proportion
; }
251 void SetFlag( int flag
)
255 void SetBorder( int border
)
256 { m_border
= border
; }
257 int GetBorder() const
260 wxWindow
*GetWindow() const
261 { return m_kind
== Item_Window
? m_window
: NULL
; }
262 wxSizer
*GetSizer() const
263 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
264 wxSize
GetSpacer() const;
266 // this function behaves obviously for the windows and spacers but for the
267 // sizers it returns true if any sizer element is shown and only returns
268 // false if all of them are hidden
269 bool IsShown() const;
270 void Show(bool show
);
272 void SetUserData(wxObject
* userData
)
273 { delete m_userData
; m_userData
= userData
; }
274 wxObject
* GetUserData() const
275 { return m_userData
; }
276 wxPoint
GetPosition() const
280 // these functions do not free old sizer/spacer
281 void SetWindow(wxWindow
*window
);
282 void SetSizer(wxSizer
*sizer
);
283 void SetSpacer(const wxSize
& size
);
284 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
287 // common part of several ctors
288 void Init() { m_userData
= NULL
; }
290 // common part of ctors taking wxSizerFlags
291 void Init(const wxSizerFlags
& flags
);
294 // discriminated union: depending on m_kind one of the fields is valid
307 wxSizerSpacer
*m_spacer
;
316 // on screen rectangle of this item (not including borders)
319 // Aspect ratio can always be calculated from m_size,
320 // but this would cause precision loss when the window
321 // is shrunk. It is safer to preserve the initial value.
324 wxObject
*m_userData
;
327 DECLARE_CLASS(wxSizerItem
)
328 DECLARE_NO_COPY_CLASS(wxSizerItem
)
331 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
334 //---------------------------------------------------------------------------
336 //---------------------------------------------------------------------------
338 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
341 wxSizer() { m_containingWindow
= NULL
; }
344 // methods for adding elements to the sizer: there are Add/Insert/Prepend
345 // overloads for each of window/sizer/spacer/wxSizerItem
346 wxSizerItem
* Add(wxWindow
*window
,
350 wxObject
* userData
= NULL
);
351 wxSizerItem
* Add(wxSizer
*sizer
,
355 wxObject
* userData
= NULL
);
356 wxSizerItem
* Add(int width
,
361 wxObject
* userData
= NULL
);
362 wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
363 wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
364 wxSizerItem
* Add( wxSizerItem
*item
);
366 wxSizerItem
* AddSpacer(int size
);
367 wxSizerItem
* AddStretchSpacer(int prop
= 1);
369 wxSizerItem
* Insert(size_t index
,
374 wxObject
* userData
= NULL
);
375 wxSizerItem
* Insert(size_t index
,
380 wxObject
* userData
= NULL
);
381 wxSizerItem
* Insert(size_t index
,
387 wxObject
* userData
= NULL
);
388 wxSizerItem
* Insert(size_t index
,
390 const wxSizerFlags
& flags
);
391 wxSizerItem
* Insert(size_t index
,
393 const wxSizerFlags
& flags
);
394 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
396 wxSizerItem
* InsertSpacer(size_t index
, int size
);
397 wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
399 wxSizerItem
* Prepend(wxWindow
*window
,
403 wxObject
* userData
= NULL
);
404 wxSizerItem
* Prepend(wxSizer
*sizer
,
408 wxObject
* userData
= NULL
);
409 wxSizerItem
* Prepend(int width
,
414 wxObject
* userData
= NULL
);
415 wxSizerItem
* Prepend(wxWindow
*window
, const wxSizerFlags
& flags
);
416 wxSizerItem
* Prepend(wxSizer
*sizer
, const wxSizerFlags
& flags
);
417 wxSizerItem
* Prepend(wxSizerItem
*item
);
419 wxSizerItem
* PrependSpacer(int size
);
420 wxSizerItem
* PrependStretchSpacer(int prop
= 1);
422 // set (or possibly unset if window is NULL) or get the window this sizer
424 void SetContainingWindow(wxWindow
*window
);
425 wxWindow
*GetContainingWindow() const { return m_containingWindow
; }
427 #if WXWIN_COMPATIBILITY_2_6
428 // Deprecated in 2.6 since historically it does not delete the window,
429 // use Detach instead.
430 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
431 #endif // WXWIN_COMPATIBILITY_2_6
433 virtual bool Remove( wxSizer
*sizer
);
434 virtual bool Remove( int index
);
436 virtual bool Detach( wxWindow
*window
);
437 virtual bool Detach( wxSizer
*sizer
);
438 virtual bool Detach( int index
);
440 virtual bool Replace( wxWindow
*oldwin
, wxWindow
*newwin
, bool recursive
= false );
441 virtual bool Replace( wxSizer
*oldsz
, wxSizer
*newsz
, bool recursive
= false );
442 virtual bool Replace( size_t index
, wxSizerItem
*newitem
);
444 virtual void Clear( bool delete_windows
= false );
445 virtual void DeleteWindows();
447 void SetMinSize( int width
, int height
)
448 { DoSetMinSize( width
, height
); }
449 void SetMinSize( const wxSize
& size
)
450 { DoSetMinSize( size
.x
, size
.y
); }
452 // Searches recursively
453 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
454 { return DoSetItemMinSize( window
, width
, height
); }
455 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
456 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
458 // Searches recursively
459 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
460 { return DoSetItemMinSize( sizer
, width
, height
); }
461 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
462 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
464 bool SetItemMinSize( size_t index
, int width
, int height
)
465 { return DoSetItemMinSize( index
, width
, height
); }
466 bool SetItemMinSize( size_t index
, const wxSize
& size
)
467 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
469 wxSize
GetSize() const
471 wxPoint
GetPosition() const
472 { return m_position
; }
474 // Calculate the minimal size or return m_minSize if bigger.
477 virtual void RecalcSizes() = 0;
478 virtual wxSize
CalcMin() = 0;
480 virtual void Layout();
482 wxSize
Fit( wxWindow
*window
);
483 void FitInside( wxWindow
*window
);
484 void SetSizeHints( wxWindow
*window
);
485 void SetVirtualSizeHints( wxWindow
*window
);
487 wxSizerItemList
& GetChildren()
488 { return m_children
; }
490 void SetDimension( int x
, int y
, int width
, int height
);
492 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
493 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
494 wxSizerItem
* GetItem( size_t index
);
496 // Manage whether individual scene items are considered
497 // in the layout calculations or not.
498 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
499 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
500 bool Show( size_t index
, bool show
= true );
502 bool Hide( wxSizer
*sizer
, bool recursive
= false )
503 { return Show( sizer
, false, recursive
); }
504 bool Hide( wxWindow
*window
, bool recursive
= false )
505 { return Show( window
, false, recursive
); }
506 bool Hide( size_t index
)
507 { return Show( index
, false ); }
509 bool IsShown( wxWindow
*window
) const;
510 bool IsShown( wxSizer
*sizer
) const;
511 bool IsShown( size_t index
) const;
513 // Recursively call wxWindow::Show () on all sizer items.
514 virtual void ShowItems (bool show
);
516 void Show(bool show
) { ShowItems(show
); }
522 wxSizerItemList m_children
;
524 // the window this sizer is used in, can be NULL
525 wxWindow
*m_containingWindow
;
527 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
528 wxSize
GetMinWindowSize( wxWindow
*window
);
529 wxSize
GetMaxClientSize( wxWindow
*window
) const;
530 wxSize
GetMinClientSize( wxWindow
*window
);
531 wxSize
FitSize( wxWindow
*window
);
532 wxSize
VirtualFitSize( wxWindow
*window
);
534 virtual void DoSetMinSize( int width
, int height
);
535 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
536 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
537 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
540 DECLARE_CLASS(wxSizer
)
543 //---------------------------------------------------------------------------
545 //---------------------------------------------------------------------------
547 class WXDLLEXPORT wxGridSizer
: public wxSizer
550 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
551 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
553 virtual void RecalcSizes();
554 virtual wxSize
CalcMin();
556 void SetCols( int cols
) { m_cols
= cols
; }
557 void SetRows( int rows
) { m_rows
= rows
; }
558 void SetVGap( int gap
) { m_vgap
= gap
; }
559 void SetHGap( int gap
) { m_hgap
= gap
; }
560 int GetCols() const { return m_cols
; }
561 int GetRows() const { return m_rows
; }
562 int GetVGap() const { return m_vgap
; }
563 int GetHGap() const { return m_hgap
; }
571 // return the number of total items and the number of columns and rows
572 int CalcRowsCols(int& rows
, int& cols
) const;
574 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
577 DECLARE_CLASS(wxGridSizer
)
580 //---------------------------------------------------------------------------
582 //---------------------------------------------------------------------------
584 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
586 enum wxFlexSizerGrowMode
588 // don't resize the cells in non-flexible direction at all
589 wxFLEX_GROWMODE_NONE
,
591 // uniformly resize only the specified ones (default)
592 wxFLEX_GROWMODE_SPECIFIED
,
594 // uniformly resize all cells
598 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
602 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
603 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
604 virtual ~wxFlexGridSizer();
607 // set the rows/columns which will grow (the others will remain of the
608 // constant initial size)
609 void AddGrowableRow( size_t idx
, int proportion
= 0 );
610 void RemoveGrowableRow( size_t idx
);
611 void AddGrowableCol( size_t idx
, int proportion
= 0 );
612 void RemoveGrowableCol( size_t idx
);
615 // the sizer cells may grow in both directions, not grow at all or only
616 // grow in one direction but not the other
618 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
619 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
620 int GetFlexibleDirection() const { return m_flexDirection
; }
622 // note that the grow mode only applies to the direction which is not
624 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
625 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
627 // Read-only access to the row heights and col widths arrays
628 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
629 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
632 virtual void RecalcSizes();
633 virtual wxSize
CalcMin();
636 void AdjustForFlexDirection();
637 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
638 int nrows
, int ncols
);
640 // the heights/widths of all rows/columns
641 wxArrayInt m_rowHeights
,
644 // indices of the growable columns and rows
645 wxArrayInt m_growableRows
,
648 // proportion values of the corresponding growable rows and columns
649 wxArrayInt m_growableRowsProportions
,
650 m_growableColsProportions
;
652 // parameters describing whether the growable cells should be resized in
653 // both directions or only one
655 wxFlexSizerGrowMode m_growMode
;
657 // saves CalcMin result to optimize RecalcSizes
658 wxSize m_calculatedMinSize
;
661 DECLARE_CLASS(wxFlexGridSizer
)
662 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
665 //---------------------------------------------------------------------------
667 //---------------------------------------------------------------------------
669 class WXDLLEXPORT wxBoxSizer
: public wxSizer
672 wxBoxSizer( int orient
);
677 int GetOrientation() const
680 void SetOrientation(int orient
)
681 { m_orient
= orient
; }
692 DECLARE_CLASS(wxBoxSizer
)
695 //---------------------------------------------------------------------------
697 //---------------------------------------------------------------------------
701 class WXDLLEXPORT wxStaticBox
;
703 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
706 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
707 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
708 virtual ~wxStaticBoxSizer();
713 wxStaticBox
*GetStaticBox() const
714 { return m_staticBox
; }
716 // override to hide/show the static box as well
717 virtual void ShowItems (bool show
);
719 virtual bool Detach( wxWindow
*window
);
720 virtual bool Detach( wxSizer
*sizer
) { return wxBoxSizer::Detach(sizer
); }
721 virtual bool Detach( int index
) { return wxBoxSizer::Detach(index
); }
724 wxStaticBox
*m_staticBox
;
727 DECLARE_CLASS(wxStaticBoxSizer
)
728 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
731 #endif // wxUSE_STATBOX
735 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
738 // Constructor just creates a new wxBoxSizer, not much else.
739 // Box sizer orientation is automatically determined here:
740 // vertical for PDAs, horizontal for everything else?
741 wxStdDialogButtonSizer();
743 // Checks button ID against system IDs and sets one of the pointers below
744 // to this button. Does not do any sizer-related things here.
745 void AddButton(wxButton
*button
);
747 // Use these if no standard ID can/should be used
748 void SetAffirmativeButton( wxButton
*button
);
749 void SetNegativeButton( wxButton
*button
);
750 void SetCancelButton( wxButton
*button
);
752 // All platform-specific code here, checks which buttons exist and add
753 // them to the sizer accordingly.
754 // Note - one potential hack on Mac we could use here,
755 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
756 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
757 // I wouldn't add any other hacks like that into here,
758 // but this one I can see being useful.
761 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
762 wxButton
*GetApplyButton() const { return m_buttonApply
; }
763 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
764 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
765 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
768 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
769 wxButton
*m_buttonApply
;
770 wxButton
*m_buttonNegative
; // wxID_NO
771 wxButton
*m_buttonCancel
;
772 wxButton
*m_buttonHelp
;
775 DECLARE_CLASS(wxStdDialogButtonSizer
)
776 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
779 #endif // wxUSE_BUTTON
781 #if WXWIN_COMPATIBILITY_2_4
782 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
783 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
785 // ----------------------------------------------------------------------------
787 // ----------------------------------------------------------------------------
791 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
793 class WXDLLEXPORT wxBookCtrlBase
;
795 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
798 #if WXWIN_COMPATIBILITY_2_6
799 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
800 #endif // WXWIN_COMPATIBILITY_2_6
802 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
804 virtual void RecalcSizes();
805 virtual wxSize
CalcMin();
808 // this protected ctor lets us mark the real one above as deprecated
809 // and still have warning-free build of the library itself:
812 wxBookCtrlBase
*m_bookctrl
;
815 DECLARE_CLASS(wxBookCtrlSizer
)
816 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
822 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
824 class WXDLLEXPORT wxNotebook
;
826 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
829 #if WXWIN_COMPATIBILITY_2_6
830 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
831 #endif // WXWIN_COMPATIBILITY_2_6
833 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
836 DECLARE_CLASS(wxNotebookSizer
)
837 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
840 #endif // wxUSE_NOTEBOOK
842 #endif // wxUSE_BOOKCTRL
844 #endif // WXWIN_COMPATIBILITY_2_4
846 // ----------------------------------------------------------------------------
847 // inline functions implementation
848 // ----------------------------------------------------------------------------
851 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
853 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
857 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
859 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
863 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
865 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
869 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
871 return Add( new wxSizerItem(window
, flags
) );
875 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
877 return Add( new wxSizerItem(sizer
, flags
) );
881 wxSizer::Add( wxSizerItem
*item
)
883 return Insert( m_children
.GetCount(), item
);
887 wxSizer::AddSpacer(int size
)
889 return Add(size
, size
);
893 wxSizer::AddStretchSpacer(int prop
)
895 return Add(0, 0, prop
);
899 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
901 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
905 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
907 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
911 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
913 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
917 wxSizer::Prepend( wxSizerItem
*item
)
919 return Insert( 0, item
);
923 wxSizer::PrependSpacer(int size
)
925 return Prepend(size
, size
);
929 wxSizer::PrependStretchSpacer(int prop
)
931 return Prepend(0, 0, prop
);
935 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
937 return Prepend( new wxSizerItem(window
, flags
) );
941 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
943 return Prepend( new wxSizerItem(sizer
, flags
) );
947 wxSizer::Insert( size_t index
,
954 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
958 wxSizer::Insert( size_t index
,
965 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
969 wxSizer::Insert( size_t index
,
977 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
981 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
983 return Insert( index
, new wxSizerItem(window
, flags
) );
987 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
989 return Insert( index
, new wxSizerItem(sizer
, flags
) );
993 wxSizer::InsertSpacer(size_t index
, int size
)
995 return Insert(index
, size
, size
);
999 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
1001 return Insert(index
, 0, 0, prop
);
1005 #endif // __WXSIZER_H__