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"
21 #include "wx/bookctrl.h"
23 //---------------------------------------------------------------------------
25 //---------------------------------------------------------------------------
27 class WXDLLEXPORT wxSizerItem
;
28 class WXDLLEXPORT wxSizer
;
29 class WXDLLEXPORT wxBoxSizer
;
32 // ----------------------------------------------------------------------------
33 // wxSizerFlags: flags used for an item in the sizer
34 // ----------------------------------------------------------------------------
36 class WXDLLEXPORT wxSizerFlags
39 // construct the flags object initialized with the given proportion (0 by
41 wxSizerFlags(int proportion
= 0) : m_proportion(proportion
)
47 // setters for all sizer flags, they all return the object itself so that
48 // calls to them can be chained
50 wxSizerFlags
& Proportion(int proportion
)
52 m_proportion
= proportion
;
56 wxSizerFlags
& Align(int alignment
) // combination of wxAlignment values
64 // some shortcuts for Align()
65 wxSizerFlags
& Expand() { return Align(wxEXPAND
); }
66 wxSizerFlags
& Centre() { return Align(wxCENTRE
); }
67 wxSizerFlags
& Center() { return Centre(); }
68 wxSizerFlags
& Left() { return Align(wxALIGN_LEFT
); }
69 wxSizerFlags
& Right() { return Align(wxALIGN_RIGHT
); }
72 wxSizerFlags
& Border(int direction
, int borderInPixels
)
77 m_borderInPixels
= borderInPixels
;
82 wxSizerFlags
& Border(int direction
= wxALL
)
84 // FIXME: default border size shouldn't be hardcoded
85 return Border(direction
, 5);
89 // accessors for wxSizer only
90 int GetProportion() const { return m_proportion
; }
91 int GetFlags() const { return m_flags
; }
92 int GetBorderInPixels() const { return m_borderInPixels
; }
101 // ----------------------------------------------------------------------------
102 // wxSizerSpacer: used by wxSizerItem to represent a spacer
103 // ----------------------------------------------------------------------------
105 class WXDLLEXPORT wxSizerSpacer
108 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
110 void SetSize(const wxSize
& size
) { m_size
= size
; }
111 const wxSize
& GetSize() const { return m_size
; }
113 void Show(bool show
) { m_isShown
= show
; }
114 bool IsShown() const { return m_isShown
; }
117 // the size, in pixel
120 // is the spacer currently shown?
124 // ----------------------------------------------------------------------------
126 // ----------------------------------------------------------------------------
128 class WXDLLEXPORT wxSizerItem
: public wxObject
132 wxSizerItem( wxWindow
*window
,
136 wxObject
* userData
);
139 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
147 wxSizerItem( wxSizer
*sizer
,
151 wxObject
* userData
);
154 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
162 wxSizerItem( int width
,
170 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
174 SetSpacer(width
, height
);
178 virtual ~wxSizerItem();
180 virtual void DeleteWindows();
182 // Enable deleting the SizerItem without destroying the contained sizer.
183 void DetachSizer() { m_sizer
= NULL
; }
185 virtual wxSize
GetSize() const;
186 virtual wxSize
CalcMin();
187 virtual void SetDimension( const wxPoint
& pos
, const wxSize
& size
);
189 wxSize
GetMinSize() const
190 { return m_minSize
; }
191 wxSize
GetMinSizeWithBorder() const;
193 void SetMinSize(const wxSize
& size
)
196 m_window
->SetMinSize(size
);
199 void SetMinSize( int x
, int y
)
200 { SetMinSize(wxSize(x
, y
)); }
201 void SetInitSize( int x
, int y
)
202 { SetMinSize(wxSize(x
, y
)); }
204 // if either of dimensions is zero, ratio is assumed to be 1
205 // to avoid "divide by zero" errors
206 void SetRatio(int width
, int height
)
207 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
208 void SetRatio(const wxSize
& size
)
209 { SetRatio(size
.x
, size
.y
); }
210 void SetRatio(float ratio
)
212 float GetRatio() const
215 virtual wxRect
GetRect() { return m_rect
; }
217 bool IsWindow() const { return m_kind
== Item_Window
; }
218 bool IsSizer() const { return m_kind
== Item_Sizer
; }
219 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
221 // Deprecated in 2.6, use {G,S}etProportion instead.
222 wxDEPRECATED( void SetOption( int option
) );
223 wxDEPRECATED( int GetOption() const );
225 void SetProportion( int proportion
)
226 { m_proportion
= proportion
; }
227 int GetProportion() const
228 { return m_proportion
; }
229 void SetFlag( int flag
)
233 void SetBorder( int border
)
234 { m_border
= border
; }
235 int GetBorder() const
238 wxWindow
*GetWindow() const
239 { return m_kind
== Item_Window
? m_window
: NULL
; }
240 wxSizer
*GetSizer() const
241 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
242 wxSize
GetSpacer() const;
244 void Show(bool show
);
245 bool IsShown() const;
247 wxObject
* GetUserData() const
248 { return m_userData
; }
249 wxPoint
GetPosition() const
253 // these functions do not free old sizer/spacer
254 void SetWindow(wxWindow
*window
);
255 void SetSizer(wxSizer
*sizer
);
256 void SetSpacer(const wxSize
& size
);
257 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
260 // common part of several ctors
261 void Init() { m_userData
= NULL
; }
263 // common part of ctors taking wxSizerFlags
264 void Init(const wxSizerFlags
& flags
);
278 wxSizerSpacer
*m_spacer
;
287 // on screen rectangle of this item (not including borders)
290 // Aspect ratio can always be calculated from m_size,
291 // but this would cause precision loss when the window
292 // is shrunk. It is safer to preserve the initial value.
295 wxObject
*m_userData
;
298 DECLARE_CLASS(wxSizerItem
)
299 DECLARE_NO_COPY_CLASS(wxSizerItem
)
302 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
305 //---------------------------------------------------------------------------
307 //---------------------------------------------------------------------------
309 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
315 // methods for adding elements to the sizer: there are Add/Insert/Prepend
316 // overloads for each of window/sizer/spacer/wxSizerItem
317 inline wxSizerItem
* Add( wxWindow
*window
,
321 wxObject
* userData
= NULL
);
322 inline wxSizerItem
* Add( wxSizer
*sizer
,
326 wxObject
* userData
= NULL
);
327 inline wxSizerItem
* Add( int width
,
332 wxObject
* userData
= NULL
);
333 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
334 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
335 inline wxSizerItem
* Add( wxSizerItem
*item
);
337 inline wxSizerItem
* AddSpacer(int size
);
338 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
340 inline wxSizerItem
* Insert( size_t index
,
345 wxObject
* userData
= NULL
);
346 inline wxSizerItem
* Insert( size_t index
,
351 wxObject
* userData
= NULL
);
352 inline wxSizerItem
* Insert( size_t index
,
358 wxObject
* userData
= NULL
);
359 inline wxSizerItem
* Insert( size_t index
,
361 const wxSizerFlags
& flags
);
362 inline wxSizerItem
* Insert( size_t index
,
364 const wxSizerFlags
& flags
);
365 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
367 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
368 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
370 inline wxSizerItem
* Prepend( wxWindow
*window
,
374 wxObject
* userData
= NULL
);
375 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
379 wxObject
* userData
= NULL
);
380 inline wxSizerItem
* Prepend( int width
,
385 wxObject
* userData
= NULL
);
386 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
387 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
388 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
390 inline wxSizerItem
* PrependSpacer(int size
);
391 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
394 // Deprecated in 2.6 since historically it does not delete the window,
395 // use Detach instead.
396 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
397 virtual bool Remove( wxSizer
*sizer
);
398 virtual bool Remove( int index
);
400 virtual bool Detach( wxWindow
*window
);
401 virtual bool Detach( wxSizer
*sizer
);
402 virtual bool Detach( int index
);
404 virtual void Clear( bool delete_windows
= false );
405 virtual void DeleteWindows();
407 void SetMinSize( int width
, int height
)
408 { DoSetMinSize( width
, height
); }
409 void SetMinSize( const wxSize
& size
)
410 { DoSetMinSize( size
.x
, size
.y
); }
412 // Searches recursively
413 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
414 { return DoSetItemMinSize( window
, width
, height
); }
415 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
416 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
418 // Searches recursively
419 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
420 { return DoSetItemMinSize( sizer
, width
, height
); }
421 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
422 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
424 bool SetItemMinSize( size_t index
, int width
, int height
)
425 { return DoSetItemMinSize( index
, width
, height
); }
426 bool SetItemMinSize( size_t index
, const wxSize
& size
)
427 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
429 wxSize
GetSize() const
431 wxPoint
GetPosition() const
432 { return m_position
; }
434 // Calculate the minimal size or return m_minSize if bigger.
437 virtual void RecalcSizes() = 0;
438 virtual wxSize
CalcMin() = 0;
440 virtual void Layout();
442 wxSize
Fit( wxWindow
*window
);
443 void FitInside( wxWindow
*window
);
444 void SetSizeHints( wxWindow
*window
);
445 void SetVirtualSizeHints( wxWindow
*window
);
447 wxSizerItemList
& GetChildren()
448 { return m_children
; }
450 void SetDimension( int x
, int y
, int width
, int height
);
452 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
453 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
454 wxSizerItem
* GetItem( size_t index
);
456 // Manage whether individual scene items are considered
457 // in the layout calculations or not.
458 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
459 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
460 bool Show( size_t index
, bool show
= true );
462 bool Hide( wxSizer
*sizer
, bool recursive
= false )
463 { return Show( sizer
, false, recursive
); }
464 bool Hide( wxWindow
*window
, bool recursive
= false )
465 { return Show( window
, false, recursive
); }
466 bool Hide( size_t index
)
467 { return Show( index
, false ); }
469 bool IsShown( wxWindow
*window
) const;
470 bool IsShown( wxSizer
*sizer
) const;
471 bool IsShown( size_t index
) const;
473 // Recursively call wxWindow::Show () on all sizer items.
474 virtual void ShowItems (bool show
);
480 bool IsShown() const { return m_isShown
; }
486 wxSizerItemList m_children
;
489 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
490 wxSize
GetMinWindowSize( wxWindow
*window
);
491 wxSize
GetMaxClientSize( wxWindow
*window
) const;
492 wxSize
GetMinClientSize( wxWindow
*window
);
493 wxSize
FitSize( wxWindow
*window
);
494 wxSize
VirtualFitSize( wxWindow
*window
);
496 virtual void DoSetMinSize( int width
, int height
);
497 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
498 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
499 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
502 DECLARE_CLASS(wxSizer
)
505 //---------------------------------------------------------------------------
507 //---------------------------------------------------------------------------
509 class WXDLLEXPORT wxGridSizer
: public wxSizer
512 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
513 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
515 virtual void RecalcSizes();
516 virtual wxSize
CalcMin();
518 void SetCols( int cols
) { m_cols
= cols
; }
519 void SetRows( int rows
) { m_rows
= rows
; }
520 void SetVGap( int gap
) { m_vgap
= gap
; }
521 void SetHGap( int gap
) { m_hgap
= gap
; }
522 int GetCols() const { return m_cols
; }
523 int GetRows() const { return m_rows
; }
524 int GetVGap() const { return m_vgap
; }
525 int GetHGap() const { return m_hgap
; }
533 // return the number of total items and the number of columns and rows
534 int CalcRowsCols(int& rows
, int& cols
) const;
536 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
539 DECLARE_CLASS(wxGridSizer
)
542 //---------------------------------------------------------------------------
544 //---------------------------------------------------------------------------
546 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
548 enum wxFlexSizerGrowMode
550 // don't resize the cells in non-flexible direction at all
551 wxFLEX_GROWMODE_NONE
,
553 // uniformly resize only the specified ones (default)
554 wxFLEX_GROWMODE_SPECIFIED
,
556 // uniformly resize all cells
560 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
564 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
565 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
566 virtual ~wxFlexGridSizer();
569 // set the rows/columns which will grow (the others will remain of the
570 // constant initial size)
571 void AddGrowableRow( size_t idx
, int proportion
= 0 );
572 void RemoveGrowableRow( size_t idx
);
573 void AddGrowableCol( size_t idx
, int proportion
= 0 );
574 void RemoveGrowableCol( size_t idx
);
577 // the sizer cells may grow in both directions, not grow at all or only
578 // grow in one direction but not the other
580 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
581 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
582 int GetFlexibleDirection() const { return m_flexDirection
; }
584 // note that the grow mode only applies to the direction which is not
586 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
587 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
589 // Read-only access to the row heights and col widths arrays
590 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
591 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
594 virtual void RecalcSizes();
595 virtual wxSize
CalcMin();
598 void AdjustForFlexDirection();
599 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
600 int nrows
, int ncols
);
602 // the heights/widths of all rows/columns
603 wxArrayInt m_rowHeights
,
606 // indices of the growable columns and rows
607 wxArrayInt m_growableRows
,
610 // proportion values of the corresponding growable rows and columns
611 wxArrayInt m_growableRowsProportions
,
612 m_growableColsProportions
;
614 // parameters describing whether the growable cells should be resized in
615 // both directions or only one
617 wxFlexSizerGrowMode m_growMode
;
619 // saves CalcMin result to optimize RecalcSizes
620 wxSize m_calculatedMinSize
;
623 DECLARE_CLASS(wxFlexGridSizer
)
624 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
627 //---------------------------------------------------------------------------
629 //---------------------------------------------------------------------------
631 class WXDLLEXPORT wxBoxSizer
: public wxSizer
634 wxBoxSizer( int orient
);
639 int GetOrientation() const
642 void SetOrientation(int orient
)
643 { m_orient
= orient
; }
654 DECLARE_CLASS(wxBoxSizer
)
657 //---------------------------------------------------------------------------
659 //---------------------------------------------------------------------------
663 class WXDLLEXPORT wxStaticBox
;
665 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
668 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
669 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
674 wxStaticBox
*GetStaticBox() const
675 { return m_staticBox
; }
677 // override to hide/show the static box as well
678 virtual void ShowItems (bool show
);
681 wxStaticBox
*m_staticBox
;
684 DECLARE_CLASS(wxStaticBoxSizer
)
685 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
688 #endif // wxUSE_STATBOX
692 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
695 // Constructor just creates a new wxBoxSizer, not much else.
696 // Box sizer orientation is automatically determined here:
697 // vertical for PDAs, horizontal for everything else?
698 wxStdDialogButtonSizer();
700 // Checks button ID against system IDs and sets one of the pointers below
701 // to this button. Does not do any sizer-related things here.
702 void AddButton(wxButton
*button
);
704 // Use these if no standard ID can/should be used
705 void SetAffirmativeButton( wxButton
*button
);
706 void SetNegativeButton( wxButton
*button
);
707 void SetCancelButton( wxButton
*button
);
709 // All platform-specific code here, checks which buttons exist and add
710 // them to the sizer accordingly.
711 // Note - one potential hack on Mac we could use here,
712 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
713 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
714 // I wouldn't add any other hacks like that into here,
715 // but this one I can see being useful.
718 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
719 wxButton
*GetApplyButton() const { return m_buttonApply
; }
720 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
721 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
722 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
725 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
726 wxButton
*m_buttonApply
;
727 wxButton
*m_buttonNegative
; // wxID_NO
728 wxButton
*m_buttonCancel
;
729 wxButton
*m_buttonHelp
;
732 DECLARE_CLASS(wxStdDialogButtonSizer
)
733 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
736 #endif // wxUSE_BUTTON
738 #if WXWIN_COMPATIBILITY_2_4
739 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
740 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
742 // ----------------------------------------------------------------------------
744 // ----------------------------------------------------------------------------
748 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
750 class WXDLLEXPORT wxBookCtrlBase
;
752 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
755 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
757 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
759 virtual void RecalcSizes();
760 virtual wxSize
CalcMin();
763 // this protected ctor lets us mark the real one above as deprecated
764 // and still have warning-free build of the library itself:
767 wxBookCtrlBase
*m_bookctrl
;
770 DECLARE_CLASS(wxBookCtrlSizer
)
771 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
777 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
779 class WXDLLEXPORT wxNotebook
;
781 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
784 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
786 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
789 DECLARE_CLASS(wxNotebookSizer
)
790 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
793 #endif // wxUSE_NOTEBOOK
795 #endif // wxUSE_BOOKCTRL
797 #endif // WXWIN_COMPATIBILITY_2_4
799 // ----------------------------------------------------------------------------
800 // inline functions implementation
801 // ----------------------------------------------------------------------------
804 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
806 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
810 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
812 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
816 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
818 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
822 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
824 return Add( new wxSizerItem(window
, flags
) );
828 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
830 return Add( new wxSizerItem(sizer
, flags
) );
834 wxSizer::Add( wxSizerItem
*item
)
836 return Insert( m_children
.GetCount(), item
);
840 wxSizer::AddSpacer(int size
)
842 return Add(size
, size
);
846 wxSizer::AddStretchSpacer(int prop
)
848 return Add(0, 0, prop
);
852 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
854 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
858 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
860 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
864 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
866 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
870 wxSizer::Prepend( wxSizerItem
*item
)
872 return Insert( 0, item
);
876 wxSizer::PrependSpacer(int size
)
878 return Prepend(size
, size
);
882 wxSizer::PrependStretchSpacer(int prop
)
884 return Prepend(0, 0, prop
);
888 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
890 return Prepend( new wxSizerItem(window
, flags
) );
894 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
896 return Prepend( new wxSizerItem(sizer
, flags
) );
900 wxSizer::Insert( size_t index
,
907 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
911 wxSizer::Insert( size_t index
,
918 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
922 wxSizer::Insert( size_t index
,
930 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
934 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
936 return Insert( index
, new wxSizerItem(window
, flags
) );
940 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
942 return Insert( index
, new wxSizerItem(sizer
, flags
) );
946 wxSizer::InsertSpacer(size_t index
, int size
)
948 return Insert(index
, size
, size
);
952 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
954 return Insert(index
, 0, 0, prop
);
958 #endif // __WXSIZER_H__