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
);
257 void SetUserData(wxObject
* userData
)
258 { delete m_userData
; m_userData
= userData
; }
259 wxObject
* GetUserData() const
260 { return m_userData
; }
261 wxPoint
GetPosition() const
265 // these functions do not free old sizer/spacer
266 void SetWindow(wxWindow
*window
);
267 void SetSizer(wxSizer
*sizer
);
268 void SetSpacer(const wxSize
& size
);
269 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
271 // this function is deprecated because if this item is a sizer, then it
272 // doesn't really make sense: sizer is neither shown nor hidden, because
273 // some of its elements may be hidden while others are shown
274 wxDEPRECATED( bool IsShown() const );
277 // common part of several ctors
278 void Init() { m_userData
= NULL
; }
280 // common part of ctors taking wxSizerFlags
281 void Init(const wxSizerFlags
& flags
);
284 // discriminated union: depending on m_kind one of the fields is valid
297 wxSizerSpacer
*m_spacer
;
306 // on screen rectangle of this item (not including borders)
309 // Aspect ratio can always be calculated from m_size,
310 // but this would cause precision loss when the window
311 // is shrunk. It is safer to preserve the initial value.
314 wxObject
*m_userData
;
317 DECLARE_CLASS(wxSizerItem
)
318 DECLARE_NO_COPY_CLASS(wxSizerItem
)
321 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
324 //---------------------------------------------------------------------------
326 //---------------------------------------------------------------------------
328 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
334 // methods for adding elements to the sizer: there are Add/Insert/Prepend
335 // overloads for each of window/sizer/spacer/wxSizerItem
336 inline wxSizerItem
* Add( wxWindow
*window
,
340 wxObject
* userData
= NULL
);
341 inline wxSizerItem
* Add( wxSizer
*sizer
,
345 wxObject
* userData
= NULL
);
346 inline wxSizerItem
* Add( int width
,
351 wxObject
* userData
= NULL
);
352 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
353 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
354 inline wxSizerItem
* Add( wxSizerItem
*item
);
356 inline wxSizerItem
* AddSpacer(int size
);
357 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
359 inline wxSizerItem
* Insert( size_t index
,
364 wxObject
* userData
= NULL
);
365 inline wxSizerItem
* Insert( size_t index
,
370 wxObject
* userData
= NULL
);
371 inline wxSizerItem
* Insert( size_t index
,
377 wxObject
* userData
= NULL
);
378 inline wxSizerItem
* Insert( size_t index
,
380 const wxSizerFlags
& flags
);
381 inline wxSizerItem
* Insert( size_t index
,
383 const wxSizerFlags
& flags
);
384 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
386 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
387 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
389 inline wxSizerItem
* Prepend( wxWindow
*window
,
393 wxObject
* userData
= NULL
);
394 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
398 wxObject
* userData
= NULL
);
399 inline wxSizerItem
* Prepend( int width
,
404 wxObject
* userData
= NULL
);
405 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
406 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
407 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
409 inline wxSizerItem
* PrependSpacer(int size
);
410 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
413 // Deprecated in 2.6 since historically it does not delete the window,
414 // use Detach instead.
415 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
416 virtual bool Remove( wxSizer
*sizer
);
417 virtual bool Remove( int index
);
419 virtual bool Detach( wxWindow
*window
);
420 virtual bool Detach( wxSizer
*sizer
);
421 virtual bool Detach( int index
);
423 virtual void Clear( bool delete_windows
= false );
424 virtual void DeleteWindows();
426 void SetMinSize( int width
, int height
)
427 { DoSetMinSize( width
, height
); }
428 void SetMinSize( const wxSize
& size
)
429 { DoSetMinSize( size
.x
, size
.y
); }
431 // Searches recursively
432 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
433 { return DoSetItemMinSize( window
, width
, height
); }
434 bool SetItemMinSize( wxWindow
*window
, const wxSize
& size
)
435 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
437 // Searches recursively
438 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
439 { return DoSetItemMinSize( sizer
, width
, height
); }
440 bool SetItemMinSize( wxSizer
*sizer
, const wxSize
& size
)
441 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
443 bool SetItemMinSize( size_t index
, int width
, int height
)
444 { return DoSetItemMinSize( index
, width
, height
); }
445 bool SetItemMinSize( size_t index
, const wxSize
& size
)
446 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
448 wxSize
GetSize() const
450 wxPoint
GetPosition() const
451 { return m_position
; }
453 // Calculate the minimal size or return m_minSize if bigger.
456 virtual void RecalcSizes() = 0;
457 virtual wxSize
CalcMin() = 0;
459 virtual void Layout();
461 wxSize
Fit( wxWindow
*window
);
462 void FitInside( wxWindow
*window
);
463 void SetSizeHints( wxWindow
*window
);
464 void SetVirtualSizeHints( wxWindow
*window
);
466 wxSizerItemList
& GetChildren()
467 { return m_children
; }
469 void SetDimension( int x
, int y
, int width
, int height
);
471 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
472 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
473 wxSizerItem
* GetItem( size_t index
);
475 // Manage whether individual scene items are considered
476 // in the layout calculations or not.
477 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
478 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
479 bool Show( size_t index
, bool show
= true );
481 bool Hide( wxSizer
*sizer
, bool recursive
= false )
482 { return Show( sizer
, false, recursive
); }
483 bool Hide( wxWindow
*window
, bool recursive
= false )
484 { return Show( window
, false, recursive
); }
485 bool Hide( size_t index
)
486 { return Show( index
, false ); }
488 bool IsShown( wxWindow
*window
) const;
489 bool IsShown( wxSizer
*sizer
) const;
490 bool IsShown( size_t index
) const;
492 // Recursively call wxWindow::Show () on all sizer items.
493 virtual void ShowItems (bool show
);
495 void Show(bool show
) { ShowItems(show
); }
501 wxSizerItemList m_children
;
503 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
504 wxSize
GetMinWindowSize( wxWindow
*window
);
505 wxSize
GetMaxClientSize( wxWindow
*window
) const;
506 wxSize
GetMinClientSize( wxWindow
*window
);
507 wxSize
FitSize( wxWindow
*window
);
508 wxSize
VirtualFitSize( wxWindow
*window
);
510 virtual void DoSetMinSize( int width
, int height
);
511 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
512 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
513 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
516 DECLARE_CLASS(wxSizer
)
519 //---------------------------------------------------------------------------
521 //---------------------------------------------------------------------------
523 class WXDLLEXPORT wxGridSizer
: public wxSizer
526 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
527 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
529 virtual void RecalcSizes();
530 virtual wxSize
CalcMin();
532 void SetCols( int cols
) { m_cols
= cols
; }
533 void SetRows( int rows
) { m_rows
= rows
; }
534 void SetVGap( int gap
) { m_vgap
= gap
; }
535 void SetHGap( int gap
) { m_hgap
= gap
; }
536 int GetCols() const { return m_cols
; }
537 int GetRows() const { return m_rows
; }
538 int GetVGap() const { return m_vgap
; }
539 int GetHGap() const { return m_hgap
; }
547 // return the number of total items and the number of columns and rows
548 int CalcRowsCols(int& rows
, int& cols
) const;
550 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
553 DECLARE_CLASS(wxGridSizer
)
556 //---------------------------------------------------------------------------
558 //---------------------------------------------------------------------------
560 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
562 enum wxFlexSizerGrowMode
564 // don't resize the cells in non-flexible direction at all
565 wxFLEX_GROWMODE_NONE
,
567 // uniformly resize only the specified ones (default)
568 wxFLEX_GROWMODE_SPECIFIED
,
570 // uniformly resize all cells
574 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
578 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
579 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
580 virtual ~wxFlexGridSizer();
583 // set the rows/columns which will grow (the others will remain of the
584 // constant initial size)
585 void AddGrowableRow( size_t idx
, int proportion
= 0 );
586 void RemoveGrowableRow( size_t idx
);
587 void AddGrowableCol( size_t idx
, int proportion
= 0 );
588 void RemoveGrowableCol( size_t idx
);
591 // the sizer cells may grow in both directions, not grow at all or only
592 // grow in one direction but not the other
594 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
595 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
596 int GetFlexibleDirection() const { return m_flexDirection
; }
598 // note that the grow mode only applies to the direction which is not
600 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
601 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
603 // Read-only access to the row heights and col widths arrays
604 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
605 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
608 virtual void RecalcSizes();
609 virtual wxSize
CalcMin();
612 void AdjustForFlexDirection();
613 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
614 int nrows
, int ncols
);
616 // the heights/widths of all rows/columns
617 wxArrayInt m_rowHeights
,
620 // indices of the growable columns and rows
621 wxArrayInt m_growableRows
,
624 // proportion values of the corresponding growable rows and columns
625 wxArrayInt m_growableRowsProportions
,
626 m_growableColsProportions
;
628 // parameters describing whether the growable cells should be resized in
629 // both directions or only one
631 wxFlexSizerGrowMode m_growMode
;
633 // saves CalcMin result to optimize RecalcSizes
634 wxSize m_calculatedMinSize
;
637 DECLARE_CLASS(wxFlexGridSizer
)
638 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
641 //---------------------------------------------------------------------------
643 //---------------------------------------------------------------------------
645 class WXDLLEXPORT wxBoxSizer
: public wxSizer
648 wxBoxSizer( int orient
);
653 int GetOrientation() const
656 void SetOrientation(int orient
)
657 { m_orient
= orient
; }
668 DECLARE_CLASS(wxBoxSizer
)
671 //---------------------------------------------------------------------------
673 //---------------------------------------------------------------------------
677 class WXDLLEXPORT wxStaticBox
;
679 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
682 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
683 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
688 wxStaticBox
*GetStaticBox() const
689 { return m_staticBox
; }
691 // override to hide/show the static box as well
692 virtual void ShowItems (bool show
);
695 wxStaticBox
*m_staticBox
;
698 DECLARE_CLASS(wxStaticBoxSizer
)
699 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
702 #endif // wxUSE_STATBOX
706 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
709 // Constructor just creates a new wxBoxSizer, not much else.
710 // Box sizer orientation is automatically determined here:
711 // vertical for PDAs, horizontal for everything else?
712 wxStdDialogButtonSizer();
714 // Checks button ID against system IDs and sets one of the pointers below
715 // to this button. Does not do any sizer-related things here.
716 void AddButton(wxButton
*button
);
718 // Use these if no standard ID can/should be used
719 void SetAffirmativeButton( wxButton
*button
);
720 void SetNegativeButton( wxButton
*button
);
721 void SetCancelButton( wxButton
*button
);
723 // All platform-specific code here, checks which buttons exist and add
724 // them to the sizer accordingly.
725 // Note - one potential hack on Mac we could use here,
726 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
727 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
728 // I wouldn't add any other hacks like that into here,
729 // but this one I can see being useful.
732 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
733 wxButton
*GetApplyButton() const { return m_buttonApply
; }
734 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
735 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
736 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
739 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
740 wxButton
*m_buttonApply
;
741 wxButton
*m_buttonNegative
; // wxID_NO
742 wxButton
*m_buttonCancel
;
743 wxButton
*m_buttonHelp
;
746 DECLARE_CLASS(wxStdDialogButtonSizer
)
747 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
750 #endif // wxUSE_BUTTON
752 #if WXWIN_COMPATIBILITY_2_4
753 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
754 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
756 // ----------------------------------------------------------------------------
758 // ----------------------------------------------------------------------------
762 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
764 class WXDLLEXPORT wxBookCtrlBase
;
766 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
769 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
771 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
773 virtual void RecalcSizes();
774 virtual wxSize
CalcMin();
777 // this protected ctor lets us mark the real one above as deprecated
778 // and still have warning-free build of the library itself:
781 wxBookCtrlBase
*m_bookctrl
;
784 DECLARE_CLASS(wxBookCtrlSizer
)
785 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
791 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
793 class WXDLLEXPORT wxNotebook
;
795 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
798 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
800 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
803 DECLARE_CLASS(wxNotebookSizer
)
804 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
807 #endif // wxUSE_NOTEBOOK
809 #endif // wxUSE_BOOKCTRL
811 #endif // WXWIN_COMPATIBILITY_2_4
813 // ----------------------------------------------------------------------------
814 // inline functions implementation
815 // ----------------------------------------------------------------------------
818 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
820 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
824 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
826 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
830 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
832 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
836 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
838 return Add( new wxSizerItem(window
, flags
) );
842 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
844 return Add( new wxSizerItem(sizer
, flags
) );
848 wxSizer::Add( wxSizerItem
*item
)
850 return Insert( m_children
.GetCount(), item
);
854 wxSizer::AddSpacer(int size
)
856 return Add(size
, size
);
860 wxSizer::AddStretchSpacer(int prop
)
862 return Add(0, 0, prop
);
866 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
868 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
872 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
874 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
878 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
880 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
884 wxSizer::Prepend( wxSizerItem
*item
)
886 return Insert( 0, item
);
890 wxSizer::PrependSpacer(int size
)
892 return Prepend(size
, size
);
896 wxSizer::PrependStretchSpacer(int prop
)
898 return Prepend(0, 0, prop
);
902 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
904 return Prepend( new wxSizerItem(window
, flags
) );
908 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
910 return Prepend( new wxSizerItem(sizer
, flags
) );
914 wxSizer::Insert( size_t index
,
921 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
925 wxSizer::Insert( size_t index
,
932 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
936 wxSizer::Insert( size_t index
,
944 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
948 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
950 return Insert( index
, new wxSizerItem(window
, flags
) );
954 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
956 return Insert( index
, new wxSizerItem(sizer
, flags
) );
960 wxSizer::InsertSpacer(size_t index
, int size
)
962 return Insert(index
, size
, size
);
966 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
968 return Insert(index
, 0, 0, prop
);
972 #endif // __WXSIZER_H__