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
85 // no borders by default on limited size screen
86 wxUnusedVar(direction
);
90 return Border(direction
, 5);
95 // accessors for wxSizer only
96 int GetProportion() const { return m_proportion
; }
97 int GetFlags() const { return m_flags
; }
98 int GetBorderInPixels() const { return m_borderInPixels
; }
103 int m_borderInPixels
;
107 // ----------------------------------------------------------------------------
108 // wxSizerSpacer: used by wxSizerItem to represent a spacer
109 // ----------------------------------------------------------------------------
111 class WXDLLEXPORT wxSizerSpacer
114 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
116 void SetSize(const wxSize
& size
) { m_size
= size
; }
117 const wxSize
& GetSize() const { return m_size
; }
119 void Show(bool show
) { m_isShown
= show
; }
120 bool IsShown() const { return m_isShown
; }
123 // the size, in pixel
126 // is the spacer currently shown?
130 // ----------------------------------------------------------------------------
132 // ----------------------------------------------------------------------------
134 class WXDLLEXPORT wxSizerItem
: public wxObject
138 wxSizerItem( wxWindow
*window
,
142 wxObject
* userData
);
145 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
153 wxSizerItem( wxSizer
*sizer
,
157 wxObject
* userData
);
160 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
168 wxSizerItem( int width
,
176 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
180 SetSpacer(width
, height
);
184 virtual ~wxSizerItem();
186 virtual void DeleteWindows();
188 // Enable deleting the SizerItem without destroying the contained sizer.
189 void DetachSizer() { m_sizer
= NULL
; }
191 virtual wxSize
GetSize() const;
192 virtual wxSize
CalcMin();
193 virtual void SetDimension( const wxPoint
& pos
, const wxSize
& size
);
195 wxSize
GetMinSize() const
196 { return m_minSize
; }
197 wxSize
GetMinSizeWithBorder() const;
199 void SetMinSize(const wxSize
& size
)
202 m_window
->SetMinSize(size
);
205 void SetMinSize( int x
, int y
)
206 { SetMinSize(wxSize(x
, y
)); }
207 void SetInitSize( int x
, int y
)
208 { SetMinSize(wxSize(x
, y
)); }
210 // if either of dimensions is zero, ratio is assumed to be 1
211 // to avoid "divide by zero" errors
212 void SetRatio(int width
, int height
)
213 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
214 void SetRatio(const wxSize
& size
)
215 { SetRatio(size
.x
, size
.y
); }
216 void SetRatio(float ratio
)
218 float GetRatio() const
221 virtual wxRect
GetRect() { return m_rect
; }
223 bool IsWindow() const { return m_kind
== Item_Window
; }
224 bool IsSizer() const { return m_kind
== Item_Sizer
; }
225 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
227 // Deprecated in 2.6, use {G,S}etProportion instead.
228 wxDEPRECATED( void SetOption( int option
) );
229 wxDEPRECATED( int GetOption() const );
231 void SetProportion( int proportion
)
232 { m_proportion
= proportion
; }
233 int GetProportion() const
234 { return m_proportion
; }
235 void SetFlag( int flag
)
239 void SetBorder( int border
)
240 { m_border
= border
; }
241 int GetBorder() const
244 wxWindow
*GetWindow() const
245 { return m_kind
== Item_Window
? m_window
: NULL
; }
246 wxSizer
*GetSizer() const
247 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
248 wxSize
GetSpacer() const;
250 void Show(bool show
);
251 bool IsShown() const;
253 wxObject
* GetUserData() const
254 { return m_userData
; }
255 wxPoint
GetPosition() const
259 // these functions do not free old sizer/spacer
260 void SetWindow(wxWindow
*window
);
261 void SetSizer(wxSizer
*sizer
);
262 void SetSpacer(const wxSize
& size
);
263 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
266 // common part of several ctors
267 void Init() { m_userData
= NULL
; }
269 // common part of ctors taking wxSizerFlags
270 void Init(const wxSizerFlags
& flags
);
284 wxSizerSpacer
*m_spacer
;
293 // on screen rectangle of this item (not including borders)
296 // Aspect ratio can always be calculated from m_size,
297 // but this would cause precision loss when the window
298 // is shrunk. It is safer to preserve the initial value.
301 wxObject
*m_userData
;
304 DECLARE_CLASS(wxSizerItem
)
305 DECLARE_NO_COPY_CLASS(wxSizerItem
)
308 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
311 //---------------------------------------------------------------------------
313 //---------------------------------------------------------------------------
315 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
321 // methods for adding elements to the sizer: there are Add/Insert/Prepend
322 // overloads for each of window/sizer/spacer/wxSizerItem
323 inline wxSizerItem
* Add( wxWindow
*window
,
327 wxObject
* userData
= NULL
);
328 inline wxSizerItem
* Add( wxSizer
*sizer
,
332 wxObject
* userData
= NULL
);
333 inline wxSizerItem
* Add( int width
,
338 wxObject
* userData
= NULL
);
339 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
340 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
341 inline wxSizerItem
* Add( wxSizerItem
*item
);
343 inline wxSizerItem
* AddSpacer(int size
);
344 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
346 inline wxSizerItem
* Insert( size_t index
,
351 wxObject
* userData
= NULL
);
352 inline wxSizerItem
* Insert( size_t index
,
357 wxObject
* userData
= NULL
);
358 inline wxSizerItem
* Insert( size_t index
,
364 wxObject
* userData
= NULL
);
365 inline wxSizerItem
* Insert( size_t index
,
367 const wxSizerFlags
& flags
);
368 inline wxSizerItem
* Insert( size_t index
,
370 const wxSizerFlags
& flags
);
371 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
373 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
374 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
376 inline wxSizerItem
* Prepend( wxWindow
*window
,
380 wxObject
* userData
= NULL
);
381 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
385 wxObject
* userData
= NULL
);
386 inline wxSizerItem
* Prepend( int width
,
391 wxObject
* userData
= NULL
);
392 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
393 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
394 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
396 inline wxSizerItem
* PrependSpacer(int size
);
397 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
400 // Deprecated in 2.6 since historically it does not delete the window,
401 // use Detach instead.
402 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
403 virtual bool Remove( wxSizer
*sizer
);
404 virtual bool Remove( int index
);
406 virtual bool Detach( wxWindow
*window
);
407 virtual bool Detach( wxSizer
*sizer
);
408 virtual bool Detach( int index
);
410 virtual void Clear( bool delete_windows
= false );
411 virtual void DeleteWindows();
413 void SetMinSize( int width
, int height
)
414 { DoSetMinSize( width
, height
); }
415 void SetMinSize( const wxSize
& size
)
416 { DoSetMinSize( size
.x
, size
.y
); }
418 // Searches recursively
419 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
420 { return DoSetItemMinSize( window
, width
, height
); }
421 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
422 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
424 // Searches recursively
425 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
426 { return DoSetItemMinSize( sizer
, width
, height
); }
427 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
428 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
430 bool SetItemMinSize( size_t index
, int width
, int height
)
431 { return DoSetItemMinSize( index
, width
, height
); }
432 bool SetItemMinSize( size_t index
, const wxSize
& size
)
433 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
435 wxSize
GetSize() const
437 wxPoint
GetPosition() const
438 { return m_position
; }
440 // Calculate the minimal size or return m_minSize if bigger.
443 virtual void RecalcSizes() = 0;
444 virtual wxSize
CalcMin() = 0;
446 virtual void Layout();
448 wxSize
Fit( wxWindow
*window
);
449 void FitInside( wxWindow
*window
);
450 void SetSizeHints( wxWindow
*window
);
451 void SetVirtualSizeHints( wxWindow
*window
);
453 wxSizerItemList
& GetChildren()
454 { return m_children
; }
456 void SetDimension( int x
, int y
, int width
, int height
);
458 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
459 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
460 wxSizerItem
* GetItem( size_t index
);
462 // Manage whether individual scene items are considered
463 // in the layout calculations or not.
464 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
465 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
466 bool Show( size_t index
, bool show
= true );
468 bool Hide( wxSizer
*sizer
, bool recursive
= false )
469 { return Show( sizer
, false, recursive
); }
470 bool Hide( wxWindow
*window
, bool recursive
= false )
471 { return Show( window
, false, recursive
); }
472 bool Hide( size_t index
)
473 { return Show( index
, false ); }
475 bool IsShown( wxWindow
*window
) const;
476 bool IsShown( wxSizer
*sizer
) const;
477 bool IsShown( size_t index
) const;
479 // Recursively call wxWindow::Show () on all sizer items.
480 virtual void ShowItems (bool show
);
486 bool IsShown() const { return m_isShown
; }
492 wxSizerItemList m_children
;
495 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
496 wxSize
GetMinWindowSize( wxWindow
*window
);
497 wxSize
GetMaxClientSize( wxWindow
*window
) const;
498 wxSize
GetMinClientSize( wxWindow
*window
);
499 wxSize
FitSize( wxWindow
*window
);
500 wxSize
VirtualFitSize( wxWindow
*window
);
502 virtual void DoSetMinSize( int width
, int height
);
503 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
504 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
505 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
508 DECLARE_CLASS(wxSizer
)
511 //---------------------------------------------------------------------------
513 //---------------------------------------------------------------------------
515 class WXDLLEXPORT wxGridSizer
: public wxSizer
518 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
519 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
521 virtual void RecalcSizes();
522 virtual wxSize
CalcMin();
524 void SetCols( int cols
) { m_cols
= cols
; }
525 void SetRows( int rows
) { m_rows
= rows
; }
526 void SetVGap( int gap
) { m_vgap
= gap
; }
527 void SetHGap( int gap
) { m_hgap
= gap
; }
528 int GetCols() const { return m_cols
; }
529 int GetRows() const { return m_rows
; }
530 int GetVGap() const { return m_vgap
; }
531 int GetHGap() const { return m_hgap
; }
539 // return the number of total items and the number of columns and rows
540 int CalcRowsCols(int& rows
, int& cols
) const;
542 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
545 DECLARE_CLASS(wxGridSizer
)
548 //---------------------------------------------------------------------------
550 //---------------------------------------------------------------------------
552 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
554 enum wxFlexSizerGrowMode
556 // don't resize the cells in non-flexible direction at all
557 wxFLEX_GROWMODE_NONE
,
559 // uniformly resize only the specified ones (default)
560 wxFLEX_GROWMODE_SPECIFIED
,
562 // uniformly resize all cells
566 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
570 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
571 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
572 virtual ~wxFlexGridSizer();
575 // set the rows/columns which will grow (the others will remain of the
576 // constant initial size)
577 void AddGrowableRow( size_t idx
, int proportion
= 0 );
578 void RemoveGrowableRow( size_t idx
);
579 void AddGrowableCol( size_t idx
, int proportion
= 0 );
580 void RemoveGrowableCol( size_t idx
);
583 // the sizer cells may grow in both directions, not grow at all or only
584 // grow in one direction but not the other
586 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
587 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
588 int GetFlexibleDirection() const { return m_flexDirection
; }
590 // note that the grow mode only applies to the direction which is not
592 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
593 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
595 // Read-only access to the row heights and col widths arrays
596 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
597 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
600 virtual void RecalcSizes();
601 virtual wxSize
CalcMin();
604 void AdjustForFlexDirection();
605 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
606 int nrows
, int ncols
);
608 // the heights/widths of all rows/columns
609 wxArrayInt m_rowHeights
,
612 // indices of the growable columns and rows
613 wxArrayInt m_growableRows
,
616 // proportion values of the corresponding growable rows and columns
617 wxArrayInt m_growableRowsProportions
,
618 m_growableColsProportions
;
620 // parameters describing whether the growable cells should be resized in
621 // both directions or only one
623 wxFlexSizerGrowMode m_growMode
;
625 // saves CalcMin result to optimize RecalcSizes
626 wxSize m_calculatedMinSize
;
629 DECLARE_CLASS(wxFlexGridSizer
)
630 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
633 //---------------------------------------------------------------------------
635 //---------------------------------------------------------------------------
637 class WXDLLEXPORT wxBoxSizer
: public wxSizer
640 wxBoxSizer( int orient
);
645 int GetOrientation() const
648 void SetOrientation(int orient
)
649 { m_orient
= orient
; }
660 DECLARE_CLASS(wxBoxSizer
)
663 //---------------------------------------------------------------------------
665 //---------------------------------------------------------------------------
669 class WXDLLEXPORT wxStaticBox
;
671 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
674 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
675 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
680 wxStaticBox
*GetStaticBox() const
681 { return m_staticBox
; }
683 // override to hide/show the static box as well
684 virtual void ShowItems (bool show
);
687 wxStaticBox
*m_staticBox
;
690 DECLARE_CLASS(wxStaticBoxSizer
)
691 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
694 #endif // wxUSE_STATBOX
698 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
701 // Constructor just creates a new wxBoxSizer, not much else.
702 // Box sizer orientation is automatically determined here:
703 // vertical for PDAs, horizontal for everything else?
704 wxStdDialogButtonSizer();
706 // Checks button ID against system IDs and sets one of the pointers below
707 // to this button. Does not do any sizer-related things here.
708 void AddButton(wxButton
*button
);
710 // Use these if no standard ID can/should be used
711 void SetAffirmativeButton( wxButton
*button
);
712 void SetNegativeButton( wxButton
*button
);
713 void SetCancelButton( wxButton
*button
);
715 // All platform-specific code here, checks which buttons exist and add
716 // them to the sizer accordingly.
717 // Note - one potential hack on Mac we could use here,
718 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
719 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
720 // I wouldn't add any other hacks like that into here,
721 // but this one I can see being useful.
724 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
725 wxButton
*GetApplyButton() const { return m_buttonApply
; }
726 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
727 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
728 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
731 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
732 wxButton
*m_buttonApply
;
733 wxButton
*m_buttonNegative
; // wxID_NO
734 wxButton
*m_buttonCancel
;
735 wxButton
*m_buttonHelp
;
738 DECLARE_CLASS(wxStdDialogButtonSizer
)
739 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
742 #endif // wxUSE_BUTTON
744 #if WXWIN_COMPATIBILITY_2_4
745 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
746 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
748 // ----------------------------------------------------------------------------
750 // ----------------------------------------------------------------------------
754 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
756 class WXDLLEXPORT wxBookCtrlBase
;
758 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
761 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
763 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
765 virtual void RecalcSizes();
766 virtual wxSize
CalcMin();
769 // this protected ctor lets us mark the real one above as deprecated
770 // and still have warning-free build of the library itself:
773 wxBookCtrlBase
*m_bookctrl
;
776 DECLARE_CLASS(wxBookCtrlSizer
)
777 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
783 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
785 class WXDLLEXPORT wxNotebook
;
787 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
790 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
792 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
795 DECLARE_CLASS(wxNotebookSizer
)
796 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
799 #endif // wxUSE_NOTEBOOK
801 #endif // wxUSE_BOOKCTRL
803 #endif // WXWIN_COMPATIBILITY_2_4
805 // ----------------------------------------------------------------------------
806 // inline functions implementation
807 // ----------------------------------------------------------------------------
810 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
812 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
816 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
818 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
822 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
824 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
828 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
830 return Add( new wxSizerItem(window
, flags
) );
834 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
836 return Add( new wxSizerItem(sizer
, flags
) );
840 wxSizer::Add( wxSizerItem
*item
)
842 return Insert( m_children
.GetCount(), item
);
846 wxSizer::AddSpacer(int size
)
848 return Add(size
, size
);
852 wxSizer::AddStretchSpacer(int prop
)
854 return Add(0, 0, prop
);
858 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
860 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
864 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
866 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
870 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
872 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
876 wxSizer::Prepend( wxSizerItem
*item
)
878 return Insert( 0, item
);
882 wxSizer::PrependSpacer(int size
)
884 return Prepend(size
, size
);
888 wxSizer::PrependStretchSpacer(int prop
)
890 return Prepend(0, 0, prop
);
894 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
896 return Prepend( new wxSizerItem(window
, flags
) );
900 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
902 return Prepend( new wxSizerItem(sizer
, flags
) );
906 wxSizer::Insert( size_t index
,
913 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
917 wxSizer::Insert( size_t index
,
924 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
928 wxSizer::Insert( size_t index
,
936 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
940 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
942 return Insert( index
, new wxSizerItem(window
, flags
) );
946 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
948 return Insert( index
, new wxSizerItem(sizer
, flags
) );
952 wxSizer::InsertSpacer(size_t index
, int size
)
954 return Insert(index
, size
, size
);
958 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
960 return Insert(index
, 0, 0, prop
);
964 #endif // __WXSIZER_H__