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 // Deprecated in 2.6, use {G,S}etProportion instead.
233 wxDEPRECATED( void SetOption( int option
) );
234 wxDEPRECATED( int GetOption() const );
236 void SetProportion( int proportion
)
237 { m_proportion
= proportion
; }
238 int GetProportion() const
239 { return m_proportion
; }
240 void SetFlag( int flag
)
244 void SetBorder( int border
)
245 { m_border
= border
; }
246 int GetBorder() const
249 wxWindow
*GetWindow() const
250 { return m_kind
== Item_Window
? m_window
: NULL
; }
251 wxSizer
*GetSizer() const
252 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
253 wxSize
GetSpacer() const;
255 void Show(bool show
);
256 bool IsShown() const;
258 void SetUserData(wxObject
* userData
)
259 { delete m_userData
; m_userData
= userData
; }
260 wxObject
* GetUserData() const
261 { return m_userData
; }
262 wxPoint
GetPosition() const
266 // these functions do not free old sizer/spacer
267 void SetWindow(wxWindow
*window
);
268 void SetSizer(wxSizer
*sizer
);
269 void SetSpacer(const wxSize
& size
);
270 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
273 // common part of several ctors
274 void Init() { m_userData
= NULL
; }
276 // common part of ctors taking wxSizerFlags
277 void Init(const wxSizerFlags
& flags
);
291 wxSizerSpacer
*m_spacer
;
300 // on screen rectangle of this item (not including borders)
303 // Aspect ratio can always be calculated from m_size,
304 // but this would cause precision loss when the window
305 // is shrunk. It is safer to preserve the initial value.
308 wxObject
*m_userData
;
311 DECLARE_CLASS(wxSizerItem
)
312 DECLARE_NO_COPY_CLASS(wxSizerItem
)
315 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
318 //---------------------------------------------------------------------------
320 //---------------------------------------------------------------------------
322 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
328 // methods for adding elements to the sizer: there are Add/Insert/Prepend
329 // overloads for each of window/sizer/spacer/wxSizerItem
330 inline wxSizerItem
* Add( wxWindow
*window
,
334 wxObject
* userData
= NULL
);
335 inline wxSizerItem
* Add( wxSizer
*sizer
,
339 wxObject
* userData
= NULL
);
340 inline wxSizerItem
* Add( int width
,
345 wxObject
* userData
= NULL
);
346 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
347 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
348 inline wxSizerItem
* Add( wxSizerItem
*item
);
350 inline wxSizerItem
* AddSpacer(int size
);
351 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
353 inline wxSizerItem
* Insert( size_t index
,
358 wxObject
* userData
= NULL
);
359 inline wxSizerItem
* Insert( size_t index
,
364 wxObject
* userData
= NULL
);
365 inline wxSizerItem
* Insert( size_t index
,
371 wxObject
* userData
= NULL
);
372 inline wxSizerItem
* Insert( size_t index
,
374 const wxSizerFlags
& flags
);
375 inline wxSizerItem
* Insert( size_t index
,
377 const wxSizerFlags
& flags
);
378 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
380 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
381 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
383 inline wxSizerItem
* Prepend( wxWindow
*window
,
387 wxObject
* userData
= NULL
);
388 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
392 wxObject
* userData
= NULL
);
393 inline wxSizerItem
* Prepend( int width
,
398 wxObject
* userData
= NULL
);
399 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
400 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
401 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
403 inline wxSizerItem
* PrependSpacer(int size
);
404 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
407 // Deprecated in 2.6 since historically it does not delete the window,
408 // use Detach instead.
409 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
410 virtual bool Remove( wxSizer
*sizer
);
411 virtual bool Remove( int index
);
413 virtual bool Detach( wxWindow
*window
);
414 virtual bool Detach( wxSizer
*sizer
);
415 virtual bool Detach( int index
);
417 virtual void Clear( bool delete_windows
= false );
418 virtual void DeleteWindows();
420 void SetMinSize( int width
, int height
)
421 { DoSetMinSize( width
, height
); }
422 void SetMinSize( const wxSize
& size
)
423 { DoSetMinSize( size
.x
, size
.y
); }
425 // Searches recursively
426 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
427 { return DoSetItemMinSize( window
, width
, height
); }
428 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
429 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
431 // Searches recursively
432 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
433 { return DoSetItemMinSize( sizer
, width
, height
); }
434 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
435 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
437 bool SetItemMinSize( size_t index
, int width
, int height
)
438 { return DoSetItemMinSize( index
, width
, height
); }
439 bool SetItemMinSize( size_t index
, const wxSize
& size
)
440 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
442 wxSize
GetSize() const
444 wxPoint
GetPosition() const
445 { return m_position
; }
447 // Calculate the minimal size or return m_minSize if bigger.
450 virtual void RecalcSizes() = 0;
451 virtual wxSize
CalcMin() = 0;
453 virtual void Layout();
455 wxSize
Fit( wxWindow
*window
);
456 void FitInside( wxWindow
*window
);
457 void SetSizeHints( wxWindow
*window
);
458 void SetVirtualSizeHints( wxWindow
*window
);
460 wxSizerItemList
& GetChildren()
461 { return m_children
; }
463 void SetDimension( int x
, int y
, int width
, int height
);
465 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
466 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
467 wxSizerItem
* GetItem( size_t index
);
469 // Manage whether individual scene items are considered
470 // in the layout calculations or not.
471 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
472 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
473 bool Show( size_t index
, bool show
= true );
475 bool Hide( wxSizer
*sizer
, bool recursive
= false )
476 { return Show( sizer
, false, recursive
); }
477 bool Hide( wxWindow
*window
, bool recursive
= false )
478 { return Show( window
, false, recursive
); }
479 bool Hide( size_t index
)
480 { return Show( index
, false ); }
482 bool IsShown( wxWindow
*window
) const;
483 bool IsShown( wxSizer
*sizer
) const;
484 bool IsShown( size_t index
) const;
486 // Recursively call wxWindow::Show () on all sizer items.
487 virtual void ShowItems (bool show
);
493 bool IsShown() const { return m_isShown
; }
499 wxSizerItemList m_children
;
502 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
503 wxSize
GetMinWindowSize( wxWindow
*window
);
504 wxSize
GetMaxClientSize( wxWindow
*window
) const;
505 wxSize
GetMinClientSize( wxWindow
*window
);
506 wxSize
FitSize( wxWindow
*window
);
507 wxSize
VirtualFitSize( wxWindow
*window
);
509 virtual void DoSetMinSize( int width
, int height
);
510 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
511 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
512 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
515 DECLARE_CLASS(wxSizer
)
518 //---------------------------------------------------------------------------
520 //---------------------------------------------------------------------------
522 class WXDLLEXPORT wxGridSizer
: public wxSizer
525 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
526 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
528 virtual void RecalcSizes();
529 virtual wxSize
CalcMin();
531 void SetCols( int cols
) { m_cols
= cols
; }
532 void SetRows( int rows
) { m_rows
= rows
; }
533 void SetVGap( int gap
) { m_vgap
= gap
; }
534 void SetHGap( int gap
) { m_hgap
= gap
; }
535 int GetCols() const { return m_cols
; }
536 int GetRows() const { return m_rows
; }
537 int GetVGap() const { return m_vgap
; }
538 int GetHGap() const { return m_hgap
; }
546 // return the number of total items and the number of columns and rows
547 int CalcRowsCols(int& rows
, int& cols
) const;
549 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
552 DECLARE_CLASS(wxGridSizer
)
555 //---------------------------------------------------------------------------
557 //---------------------------------------------------------------------------
559 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
561 enum wxFlexSizerGrowMode
563 // don't resize the cells in non-flexible direction at all
564 wxFLEX_GROWMODE_NONE
,
566 // uniformly resize only the specified ones (default)
567 wxFLEX_GROWMODE_SPECIFIED
,
569 // uniformly resize all cells
573 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
577 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
578 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
579 virtual ~wxFlexGridSizer();
582 // set the rows/columns which will grow (the others will remain of the
583 // constant initial size)
584 void AddGrowableRow( size_t idx
, int proportion
= 0 );
585 void RemoveGrowableRow( size_t idx
);
586 void AddGrowableCol( size_t idx
, int proportion
= 0 );
587 void RemoveGrowableCol( size_t idx
);
590 // the sizer cells may grow in both directions, not grow at all or only
591 // grow in one direction but not the other
593 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
594 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
595 int GetFlexibleDirection() const { return m_flexDirection
; }
597 // note that the grow mode only applies to the direction which is not
599 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
600 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
602 // Read-only access to the row heights and col widths arrays
603 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
604 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
607 virtual void RecalcSizes();
608 virtual wxSize
CalcMin();
611 void AdjustForFlexDirection();
612 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
613 int nrows
, int ncols
);
615 // the heights/widths of all rows/columns
616 wxArrayInt m_rowHeights
,
619 // indices of the growable columns and rows
620 wxArrayInt m_growableRows
,
623 // proportion values of the corresponding growable rows and columns
624 wxArrayInt m_growableRowsProportions
,
625 m_growableColsProportions
;
627 // parameters describing whether the growable cells should be resized in
628 // both directions or only one
630 wxFlexSizerGrowMode m_growMode
;
632 // saves CalcMin result to optimize RecalcSizes
633 wxSize m_calculatedMinSize
;
636 DECLARE_CLASS(wxFlexGridSizer
)
637 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
640 //---------------------------------------------------------------------------
642 //---------------------------------------------------------------------------
644 class WXDLLEXPORT wxBoxSizer
: public wxSizer
647 wxBoxSizer( int orient
);
652 int GetOrientation() const
655 void SetOrientation(int orient
)
656 { m_orient
= orient
; }
667 DECLARE_CLASS(wxBoxSizer
)
670 //---------------------------------------------------------------------------
672 //---------------------------------------------------------------------------
676 class WXDLLEXPORT wxStaticBox
;
678 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
681 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
682 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
687 wxStaticBox
*GetStaticBox() const
688 { return m_staticBox
; }
690 // override to hide/show the static box as well
691 virtual void ShowItems (bool show
);
694 wxStaticBox
*m_staticBox
;
697 DECLARE_CLASS(wxStaticBoxSizer
)
698 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
701 #endif // wxUSE_STATBOX
705 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
708 // Constructor just creates a new wxBoxSizer, not much else.
709 // Box sizer orientation is automatically determined here:
710 // vertical for PDAs, horizontal for everything else?
711 wxStdDialogButtonSizer();
713 // Checks button ID against system IDs and sets one of the pointers below
714 // to this button. Does not do any sizer-related things here.
715 void AddButton(wxButton
*button
);
717 // Use these if no standard ID can/should be used
718 void SetAffirmativeButton( wxButton
*button
);
719 void SetNegativeButton( wxButton
*button
);
720 void SetCancelButton( wxButton
*button
);
722 // All platform-specific code here, checks which buttons exist and add
723 // them to the sizer accordingly.
724 // Note - one potential hack on Mac we could use here,
725 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
726 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
727 // I wouldn't add any other hacks like that into here,
728 // but this one I can see being useful.
731 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
732 wxButton
*GetApplyButton() const { return m_buttonApply
; }
733 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
734 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
735 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
738 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
739 wxButton
*m_buttonApply
;
740 wxButton
*m_buttonNegative
; // wxID_NO
741 wxButton
*m_buttonCancel
;
742 wxButton
*m_buttonHelp
;
745 DECLARE_CLASS(wxStdDialogButtonSizer
)
746 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
749 #endif // wxUSE_BUTTON
751 #if WXWIN_COMPATIBILITY_2_4
752 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
753 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
755 // ----------------------------------------------------------------------------
757 // ----------------------------------------------------------------------------
761 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
763 class WXDLLEXPORT wxBookCtrlBase
;
765 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
768 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
770 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
772 virtual void RecalcSizes();
773 virtual wxSize
CalcMin();
776 // this protected ctor lets us mark the real one above as deprecated
777 // and still have warning-free build of the library itself:
780 wxBookCtrlBase
*m_bookctrl
;
783 DECLARE_CLASS(wxBookCtrlSizer
)
784 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
790 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
792 class WXDLLEXPORT wxNotebook
;
794 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
797 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
799 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
802 DECLARE_CLASS(wxNotebookSizer
)
803 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
806 #endif // wxUSE_NOTEBOOK
808 #endif // wxUSE_BOOKCTRL
810 #endif // WXWIN_COMPATIBILITY_2_4
812 // ----------------------------------------------------------------------------
813 // inline functions implementation
814 // ----------------------------------------------------------------------------
817 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
819 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
823 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
825 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
829 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
831 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
835 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
837 return Add( new wxSizerItem(window
, flags
) );
841 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
843 return Add( new wxSizerItem(sizer
, flags
) );
847 wxSizer::Add( wxSizerItem
*item
)
849 return Insert( m_children
.GetCount(), item
);
853 wxSizer::AddSpacer(int size
)
855 return Add(size
, size
);
859 wxSizer::AddStretchSpacer(int prop
)
861 return Add(0, 0, prop
);
865 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
867 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
871 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
873 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
877 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
879 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
883 wxSizer::Prepend( wxSizerItem
*item
)
885 return Insert( 0, item
);
889 wxSizer::PrependSpacer(int size
)
891 return Prepend(size
, size
);
895 wxSizer::PrependStretchSpacer(int prop
)
897 return Prepend(0, 0, prop
);
901 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
903 return Prepend( new wxSizerItem(window
, flags
) );
907 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
909 return Prepend( new wxSizerItem(sizer
, flags
) );
913 wxSizer::Insert( size_t index
,
920 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
924 wxSizer::Insert( size_t index
,
931 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
935 wxSizer::Insert( size_t index
,
943 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
947 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
949 return Insert( index
, new wxSizerItem(window
, flags
) );
953 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
955 return Insert( index
, new wxSizerItem(sizer
, flags
) );
959 wxSizer::InsertSpacer(size_t index
, int size
)
961 return Insert(index
, size
, size
);
965 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
967 return Insert(index
, 0, 0, prop
);
971 #endif // __WXSIZER_H__