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
63 // some shortcuts for Align()
64 wxSizerFlags
& Expand() { return Align(wxEXPAND
); }
65 wxSizerFlags
& Centre() { return Align(wxCENTRE
); }
66 wxSizerFlags
& Center() { return Centre(); }
67 wxSizerFlags
& Left() { return Align(wxALIGN_LEFT
); }
68 wxSizerFlags
& Right() { return Align(wxALIGN_RIGHT
); }
71 wxSizerFlags
& Border(int direction
, int borderInPixels
)
76 m_borderInPixels
= borderInPixels
;
81 wxSizerFlags
& Border(int direction
= wxALL
)
83 // FIXME: default border size shouldn't be hardcoded
84 return Border(direction
, 5);
88 // accessors for wxSizer only
89 int GetProportion() const { return m_proportion
; }
90 int GetFlags() const { return m_flags
; }
91 int GetBorderInPixels() const { return m_borderInPixels
; }
100 // ----------------------------------------------------------------------------
101 // wxSizerSpacer: used by wxSizerItem to represent a spacer
102 // ----------------------------------------------------------------------------
104 class WXDLLEXPORT wxSizerSpacer
107 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
109 void SetSize(const wxSize
& size
) { m_size
= size
; }
110 const wxSize
& GetSize() const { return m_size
; }
112 void Show(bool show
) { m_isShown
= show
; }
113 bool IsShown() const { return m_isShown
; }
116 // the size, in pixel
119 // is the spacer currently shown?
123 // ----------------------------------------------------------------------------
125 // ----------------------------------------------------------------------------
127 class WXDLLEXPORT wxSizerItem
: public wxObject
131 wxSizerItem( wxWindow
*window
,
135 wxObject
* userData
);
138 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
146 wxSizerItem( wxSizer
*sizer
,
150 wxObject
* userData
);
153 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
161 wxSizerItem( int width
,
169 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
173 SetSpacer(width
, height
);
177 virtual ~wxSizerItem();
179 virtual void DeleteWindows();
181 // Enable deleting the SizerItem without destroying the contained sizer.
182 void DetachSizer() { m_sizer
= NULL
; }
184 virtual wxSize
GetSize() const;
185 virtual wxSize
CalcMin();
186 virtual void SetDimension( const wxPoint
& pos
, const wxSize
& size
);
188 wxSize
GetMinSize() const
189 { return m_minSize
; }
190 wxSize
GetMinSizeWithBorder() const;
192 void SetMinSize(const wxSize
& size
)
195 m_window
->SetMinSize(size
);
198 void SetMinSize( int x
, int y
)
199 { SetMinSize(wxSize(x
, y
)); }
200 void SetInitSize( int x
, int y
)
201 { SetMinSize(wxSize(x
, y
)); }
203 // if either of dimensions is zero, ratio is assumed to be 1
204 // to avoid "divide by zero" errors
205 void SetRatio(int width
, int height
)
206 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
207 void SetRatio(const wxSize
& size
)
208 { SetRatio(size
.x
, size
.y
); }
209 void SetRatio(float ratio
)
211 float GetRatio() const
214 virtual wxRect
GetRect() { return m_rect
; }
216 bool IsWindow() const { return m_kind
== Item_Window
; }
217 bool IsSizer() const { return m_kind
== Item_Sizer
; }
218 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
220 // Deprecated in 2.6, use {G,S}etProportion instead.
221 wxDEPRECATED( void SetOption( int option
) );
222 wxDEPRECATED( int GetOption() const );
224 void SetProportion( int proportion
)
225 { m_proportion
= proportion
; }
226 int GetProportion() const
227 { return m_proportion
; }
228 void SetFlag( int flag
)
232 void SetBorder( int border
)
233 { m_border
= border
; }
234 int GetBorder() const
237 wxWindow
*GetWindow() const
238 { return m_kind
== Item_Window
? m_window
: NULL
; }
239 wxSizer
*GetSizer() const
240 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
241 wxSize
GetSpacer() const;
243 void Show(bool show
);
244 bool IsShown() const;
246 wxObject
* GetUserData() const
247 { return m_userData
; }
248 wxPoint
GetPosition() const
252 // these functions do not free old sizer/spacer
253 void SetWindow(wxWindow
*window
);
254 void SetSizer(wxSizer
*sizer
);
255 void SetSpacer(const wxSize
& size
);
256 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
259 // common part of several ctors
260 void Init() { m_userData
= NULL
; }
262 // common part of ctors taking wxSizerFlags
263 void Init(const wxSizerFlags
& flags
);
277 wxSizerSpacer
*m_spacer
;
286 // on screen rectangle of this item (not including borders)
289 // Aspect ratio can always be calculated from m_size,
290 // but this would cause precision loss when the window
291 // is shrunk. It is safer to preserve the initial value.
294 wxObject
*m_userData
;
297 DECLARE_CLASS(wxSizerItem
)
298 DECLARE_NO_COPY_CLASS(wxSizerItem
)
301 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
304 //---------------------------------------------------------------------------
306 //---------------------------------------------------------------------------
308 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
314 // methods for adding elements to the sizer: there are Add/Insert/Prepend
315 // overloads for each of window/sizer/spacer/wxSizerItem
316 inline wxSizerItem
* Add( wxWindow
*window
,
320 wxObject
* userData
= NULL
);
321 inline wxSizerItem
* Add( wxSizer
*sizer
,
325 wxObject
* userData
= NULL
);
326 inline wxSizerItem
* Add( int width
,
331 wxObject
* userData
= NULL
);
332 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
333 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
334 inline wxSizerItem
* Add( wxSizerItem
*item
);
336 inline wxSizerItem
* AddSpacer(int size
);
337 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
339 inline wxSizerItem
* Insert( size_t index
,
344 wxObject
* userData
= NULL
);
345 inline wxSizerItem
* Insert( size_t index
,
350 wxObject
* userData
= NULL
);
351 inline wxSizerItem
* Insert( size_t index
,
357 wxObject
* userData
= NULL
);
358 inline wxSizerItem
* Insert( size_t index
,
360 const wxSizerFlags
& flags
);
361 inline wxSizerItem
* Insert( size_t index
,
363 const wxSizerFlags
& flags
);
364 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
366 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
367 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
369 inline wxSizerItem
* Prepend( wxWindow
*window
,
373 wxObject
* userData
= NULL
);
374 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
378 wxObject
* userData
= NULL
);
379 inline wxSizerItem
* Prepend( int width
,
384 wxObject
* userData
= NULL
);
385 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
386 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
387 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
389 inline wxSizerItem
* PrependSpacer(int size
);
390 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
393 // Deprecated in 2.6 since historically it does not delete the window,
394 // use Detach instead.
395 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
396 virtual bool Remove( wxSizer
*sizer
);
397 virtual bool Remove( int index
);
399 virtual bool Detach( wxWindow
*window
);
400 virtual bool Detach( wxSizer
*sizer
);
401 virtual bool Detach( int index
);
403 virtual void Clear( bool delete_windows
= false );
404 virtual void DeleteWindows();
406 void SetMinSize( int width
, int height
)
407 { DoSetMinSize( width
, height
); }
408 void SetMinSize( const wxSize
& size
)
409 { DoSetMinSize( size
.x
, size
.y
); }
411 // Searches recursively
412 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
413 { return DoSetItemMinSize( window
, width
, height
); }
414 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
415 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
417 // Searches recursively
418 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
419 { return DoSetItemMinSize( sizer
, width
, height
); }
420 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
421 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
423 bool SetItemMinSize( size_t index
, int width
, int height
)
424 { return DoSetItemMinSize( index
, width
, height
); }
425 bool SetItemMinSize( size_t index
, const wxSize
& size
)
426 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
428 wxSize
GetSize() const
430 wxPoint
GetPosition() const
431 { return m_position
; }
433 // Calculate the minimal size or return m_minSize if bigger.
436 virtual void RecalcSizes() = 0;
437 virtual wxSize
CalcMin() = 0;
439 virtual void Layout();
441 wxSize
Fit( wxWindow
*window
);
442 void FitInside( wxWindow
*window
);
443 void SetSizeHints( wxWindow
*window
);
444 void SetVirtualSizeHints( wxWindow
*window
);
446 wxSizerItemList
& GetChildren()
447 { return m_children
; }
449 void SetDimension( int x
, int y
, int width
, int height
);
451 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
452 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
453 wxSizerItem
* GetItem( size_t index
);
455 // Manage whether individual scene items are considered
456 // in the layout calculations or not.
457 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
458 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
459 bool Show( size_t index
, bool show
= true );
461 bool Hide( wxSizer
*sizer
, bool recursive
= false )
462 { return Show( sizer
, false, recursive
); }
463 bool Hide( wxWindow
*window
, bool recursive
= false )
464 { return Show( window
, false, recursive
); }
465 bool Hide( size_t index
)
466 { return Show( index
, false ); }
468 bool IsShown( wxWindow
*window
) const;
469 bool IsShown( wxSizer
*sizer
) const;
470 bool IsShown( size_t index
) const;
472 // Recursively call wxWindow::Show () on all sizer items.
473 virtual void ShowItems (bool show
);
479 bool IsShown() const { return m_isShown
; }
485 wxSizerItemList m_children
;
488 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
489 wxSize
GetMinWindowSize( wxWindow
*window
);
490 wxSize
GetMaxClientSize( wxWindow
*window
) const;
491 wxSize
GetMinClientSize( wxWindow
*window
);
492 wxSize
FitSize( wxWindow
*window
);
493 wxSize
VirtualFitSize( wxWindow
*window
);
495 virtual void DoSetMinSize( int width
, int height
);
496 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
497 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
498 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
501 DECLARE_CLASS(wxSizer
)
504 //---------------------------------------------------------------------------
506 //---------------------------------------------------------------------------
508 class WXDLLEXPORT wxGridSizer
: public wxSizer
511 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
512 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
514 virtual void RecalcSizes();
515 virtual wxSize
CalcMin();
517 void SetCols( int cols
) { m_cols
= cols
; }
518 void SetRows( int rows
) { m_rows
= rows
; }
519 void SetVGap( int gap
) { m_vgap
= gap
; }
520 void SetHGap( int gap
) { m_hgap
= gap
; }
521 int GetCols() const { return m_cols
; }
522 int GetRows() const { return m_rows
; }
523 int GetVGap() const { return m_vgap
; }
524 int GetHGap() const { return m_hgap
; }
532 // return the number of total items and the number of columns and rows
533 int CalcRowsCols(int& rows
, int& cols
) const;
535 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
538 DECLARE_CLASS(wxGridSizer
)
541 //---------------------------------------------------------------------------
543 //---------------------------------------------------------------------------
545 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
547 enum wxFlexSizerGrowMode
549 // don't resize the cells in non-flexible direction at all
550 wxFLEX_GROWMODE_NONE
,
552 // uniformly resize only the specified ones (default)
553 wxFLEX_GROWMODE_SPECIFIED
,
555 // uniformly resize all cells
559 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
563 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
564 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
565 virtual ~wxFlexGridSizer();
568 // set the rows/columns which will grow (the others will remain of the
569 // constant initial size)
570 void AddGrowableRow( size_t idx
, int proportion
= 0 );
571 void RemoveGrowableRow( size_t idx
);
572 void AddGrowableCol( size_t idx
, int proportion
= 0 );
573 void RemoveGrowableCol( size_t idx
);
576 // the sizer cells may grow in both directions, not grow at all or only
577 // grow in one direction but not the other
579 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
580 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
581 int GetFlexibleDirection() const { return m_flexDirection
; }
583 // note that the grow mode only applies to the direction which is not
585 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
586 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
588 // Read-only access to the row heights and col widths arrays
589 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
590 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
593 virtual void RecalcSizes();
594 virtual wxSize
CalcMin();
597 void AdjustForFlexDirection();
598 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
599 int nrows
, int ncols
);
601 // the heights/widths of all rows/columns
602 wxArrayInt m_rowHeights
,
605 // indices of the growable columns and rows
606 wxArrayInt m_growableRows
,
609 // proportion values of the corresponding growable rows and columns
610 wxArrayInt m_growableRowsProportions
,
611 m_growableColsProportions
;
613 // parameters describing whether the growable cells should be resized in
614 // both directions or only one
616 wxFlexSizerGrowMode m_growMode
;
618 // saves CalcMin result to optimize RecalcSizes
619 wxSize m_calculatedMinSize
;
622 DECLARE_CLASS(wxFlexGridSizer
)
623 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
626 //---------------------------------------------------------------------------
628 //---------------------------------------------------------------------------
630 class WXDLLEXPORT wxBoxSizer
: public wxSizer
633 wxBoxSizer( int orient
);
638 int GetOrientation() const
641 void SetOrientation(int orient
)
642 { m_orient
= orient
; }
653 DECLARE_CLASS(wxBoxSizer
)
656 //---------------------------------------------------------------------------
658 //---------------------------------------------------------------------------
662 class WXDLLEXPORT wxStaticBox
;
664 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
667 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
668 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
673 wxStaticBox
*GetStaticBox() const
674 { return m_staticBox
; }
676 // override to hide/show the static box as well
677 virtual void ShowItems (bool show
);
680 wxStaticBox
*m_staticBox
;
683 DECLARE_CLASS(wxStaticBoxSizer
)
684 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
687 #endif // wxUSE_STATBOX
691 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
694 // Constructor just creates a new wxBoxSizer, not much else.
695 // Box sizer orientation is automatically determined here:
696 // vertical for PDAs, horizontal for everything else?
697 wxStdDialogButtonSizer();
699 // Checks button ID against system IDs and sets one of the pointers below
700 // to this button. Does not do any sizer-related things here.
701 void AddButton(wxButton
*button
);
703 // Use these if no standard ID can/should be used
704 void SetAffirmativeButton( wxButton
*button
);
705 void SetNegativeButton( wxButton
*button
);
706 void SetCancelButton( wxButton
*button
);
708 // All platform-specific code here, checks which buttons exist and add
709 // them to the sizer accordingly.
710 // Note - one potential hack on Mac we could use here,
711 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
712 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
713 // I wouldn't add any other hacks like that into here,
714 // but this one I can see being useful.
717 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
718 wxButton
*GetApplyButton() const { return m_buttonApply
; }
719 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
720 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
721 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
724 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
725 wxButton
*m_buttonApply
;
726 wxButton
*m_buttonNegative
; // wxID_NO
727 wxButton
*m_buttonCancel
;
728 wxButton
*m_buttonHelp
;
731 DECLARE_CLASS(wxStdDialogButtonSizer
)
732 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
735 #endif // wxUSE_BUTTON
737 #if WXWIN_COMPATIBILITY_2_4
738 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
739 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
741 // ----------------------------------------------------------------------------
743 // ----------------------------------------------------------------------------
747 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
749 class WXDLLEXPORT wxBookCtrlBase
;
751 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
754 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
756 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
758 virtual void RecalcSizes();
759 virtual wxSize
CalcMin();
762 // this protected ctor lets us mark the real one above as deprecated
763 // and still have warning-free build of the library itself:
766 wxBookCtrlBase
*m_bookctrl
;
769 DECLARE_CLASS(wxBookCtrlSizer
)
770 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
776 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
778 class WXDLLEXPORT wxNotebook
;
780 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
783 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
785 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
788 DECLARE_CLASS(wxNotebookSizer
)
789 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
792 #endif // wxUSE_NOTEBOOK
794 #endif // wxUSE_BOOKCTRL
796 #endif // WXWIN_COMPATIBILITY_2_4
798 // ----------------------------------------------------------------------------
799 // inline functions implementation
800 // ----------------------------------------------------------------------------
803 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
805 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
809 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
811 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
815 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
817 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
821 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
823 return Add( new wxSizerItem(window
, flags
) );
827 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
829 return Add( new wxSizerItem(sizer
, flags
) );
833 wxSizer::Add( wxSizerItem
*item
)
835 return Insert( m_children
.GetCount(), item
);
839 wxSizer::AddSpacer(int size
)
841 return Add(size
, size
);
845 wxSizer::AddStretchSpacer(int prop
)
847 return Add(0, 0, prop
);
851 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
853 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
857 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
859 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
863 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
865 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
869 wxSizer::Prepend( wxSizerItem
*item
)
871 return Insert( 0, item
);
875 wxSizer::PrependSpacer(int size
)
877 return Prepend(size
, size
);
881 wxSizer::PrependStretchSpacer(int prop
)
883 return Prepend(0, 0, prop
);
887 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
889 return Prepend( new wxSizerItem(window
, flags
) );
893 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
895 return Prepend( new wxSizerItem(sizer
, flags
) );
899 wxSizer::Insert( size_t index
,
906 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
910 wxSizer::Insert( size_t index
,
917 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
921 wxSizer::Insert( size_t index
,
929 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
933 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
935 return Insert( index
, new wxSizerItem(window
, flags
) );
939 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
941 return Insert( index
, new wxSizerItem(sizer
, flags
) );
945 wxSizer::InsertSpacer(size_t index
, int size
)
947 return Insert(index
, size
, size
);
951 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
953 return Insert(index
, 0, 0, prop
);
957 #endif // __WXSIZER_H__