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 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "sizer.h"
21 #include "wx/button.h"
22 #include "wx/window.h"
24 #include "wx/dialog.h"
25 #include "wx/bookctrl.h"
27 //---------------------------------------------------------------------------
29 //---------------------------------------------------------------------------
31 class WXDLLEXPORT wxSizerItem
;
32 class WXDLLEXPORT wxSizer
;
33 class WXDLLEXPORT wxBoxSizer
;
36 // ----------------------------------------------------------------------------
37 // wxSizerFlags: flags used for an item in the sizer
38 // ----------------------------------------------------------------------------
40 class WXDLLEXPORT wxSizerFlags
43 // construct the flags object initialized with the given proportion (0 by
45 wxSizerFlags(int proportion
= 0) : m_proportion(proportion
)
51 // setters for all sizer flags, they all return the object itself so that
52 // calls to them can be chained
54 wxSizerFlags
& Proportion(int proportion
)
56 m_proportion
= proportion
;
60 wxSizerFlags
& Align(int alignment
) // combination of wxAlignment values
68 // some shortcuts for Align()
69 wxSizerFlags
& Expand() { return Align(wxEXPAND
); }
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
89 return Border(direction
, 5);
93 // accessors for wxSizer only
94 int GetProportion() const { return m_proportion
; }
95 int GetFlags() const { return m_flags
; }
96 int GetBorderInPixels() const { return m_borderInPixels
; }
101 int m_borderInPixels
;
105 // ----------------------------------------------------------------------------
106 // wxSizerSpacer: used by wxSizerItem to represent a spacer
107 // ----------------------------------------------------------------------------
109 class WXDLLEXPORT wxSizerSpacer
112 wxSizerSpacer(const wxSize
& size
) : m_size(size
), m_isShown(true) { }
114 void SetSize(const wxSize
& size
) { m_size
= size
; }
115 const wxSize
& GetSize() const { return m_size
; }
117 void Show(bool show
) { m_isShown
= show
; }
118 bool IsShown() const { return m_isShown
; }
121 // the size, in pixel
124 // is the spacer currently shown?
128 // ----------------------------------------------------------------------------
130 // ----------------------------------------------------------------------------
132 class WXDLLEXPORT wxSizerItem
: public wxObject
136 wxSizerItem( wxWindow
*window
,
140 wxObject
* userData
);
143 wxSizerItem(wxWindow
*window
, const wxSizerFlags
& flags
)
151 wxSizerItem( wxSizer
*sizer
,
155 wxObject
* userData
);
158 wxSizerItem(wxSizer
*sizer
, const wxSizerFlags
& flags
)
166 wxSizerItem( int width
,
174 wxSizerItem(int width
, int height
, const wxSizerFlags
& flags
)
178 SetSpacer(width
, height
);
182 virtual ~wxSizerItem();
184 virtual void DeleteWindows();
186 // Enable deleting the SizerItem without destroying the contained sizer.
187 void DetachSizer() { m_sizer
= NULL
; }
189 virtual wxSize
GetSize() const;
190 virtual wxSize
CalcMin();
191 virtual void SetDimension( wxPoint pos
, wxSize size
);
193 wxSize
GetMinSize() const
194 { return m_minSize
; }
195 wxSize
GetMinSizeWithBorder() const;
197 void SetMinSize(const wxSize
& size
)
200 m_window
->SetMinSize(size
);
203 void SetMinSize( int x
, int y
)
204 { SetMinSize(wxSize(x
, y
)); }
205 void SetInitSize( int x
, int y
)
206 { SetMinSize(wxSize(x
, y
)); }
208 // if either of dimensions is zero, ratio is assumed to be 1
209 // to avoid "divide by zero" errors
210 void SetRatio(int width
, int height
)
211 { m_ratio
= (width
&& height
) ? ((float) width
/ (float) height
) : 1; }
212 void SetRatio(const wxSize
& size
)
213 { SetRatio(size
.x
, size
.y
); }
214 void SetRatio(float ratio
)
216 float GetRatio() const
219 virtual wxRect
GetRect() { return m_rect
; }
221 bool IsWindow() const { return m_kind
== Item_Window
; }
222 bool IsSizer() const { return m_kind
== Item_Sizer
; }
223 bool IsSpacer() const { return m_kind
== Item_Spacer
; }
225 // Deprecated in 2.6, use {G,S}etProportion instead.
226 wxDEPRECATED( void SetOption( int option
) );
227 wxDEPRECATED( int GetOption() const );
229 void SetProportion( int proportion
)
230 { m_proportion
= proportion
; }
231 int GetProportion() const
232 { return m_proportion
; }
233 void SetFlag( int flag
)
237 void SetBorder( int border
)
238 { m_border
= border
; }
239 int GetBorder() const
242 wxWindow
*GetWindow() const
243 { return m_kind
== Item_Window
? m_window
: NULL
; }
244 wxSizer
*GetSizer() const
245 { return m_kind
== Item_Sizer
? m_sizer
: NULL
; }
246 wxSize
GetSpacer() const;
248 void Show(bool show
);
249 bool IsShown() const;
251 wxObject
* GetUserData() const
252 { return m_userData
; }
253 wxPoint
GetPosition() const
257 // these functions do not free old sizer/spacer
258 void SetWindow(wxWindow
*window
);
259 void SetSizer(wxSizer
*sizer
);
260 void SetSpacer(const wxSize
& size
);
261 void SetSpacer(int width
, int height
) { SetSpacer(wxSize(width
, height
)); }
264 // common part of several ctors
265 void Init() { m_userData
= NULL
; }
267 // common part of ctors taking wxSizerFlags
268 void Init(const wxSizerFlags
& flags
);
282 wxSizerSpacer
*m_spacer
;
291 // on screen rectangle of this item (not including borders)
294 // Aspect ratio can always be calculated from m_size,
295 // but this would cause precision loss when the window
296 // is shrunk. It is safer to preserve the initial value.
299 wxObject
*m_userData
;
302 DECLARE_CLASS(wxSizerItem
)
303 DECLARE_NO_COPY_CLASS(wxSizerItem
)
306 WX_DECLARE_EXPORTED_LIST( wxSizerItem
, wxSizerItemList
);
309 //---------------------------------------------------------------------------
311 //---------------------------------------------------------------------------
313 class WXDLLEXPORT wxSizer
: public wxObject
, public wxClientDataContainer
319 // methods for adding elements to the sizer: there are Add/Insert/Prepend
320 // overloads for each of window/sizer/spacer/wxSizerItem
321 inline wxSizerItem
* Add( wxWindow
*window
,
325 wxObject
* userData
= NULL
);
326 inline wxSizerItem
* Add( wxSizer
*sizer
,
330 wxObject
* userData
= NULL
);
331 inline wxSizerItem
* Add( int width
,
336 wxObject
* userData
= NULL
);
337 inline wxSizerItem
* Add( wxWindow
*window
, const wxSizerFlags
& flags
);
338 inline wxSizerItem
* Add( wxSizer
*sizer
, const wxSizerFlags
& flags
);
339 inline wxSizerItem
* Add( wxSizerItem
*item
);
341 inline wxSizerItem
* AddSpacer(int size
);
342 inline wxSizerItem
* AddStretchSpacer(int prop
= 1);
344 inline wxSizerItem
* Insert( size_t index
,
349 wxObject
* userData
= NULL
);
350 inline wxSizerItem
* Insert( size_t index
,
355 wxObject
* userData
= NULL
);
356 inline wxSizerItem
* Insert( size_t index
,
362 wxObject
* userData
= NULL
);
363 inline wxSizerItem
* Insert( size_t index
,
365 const wxSizerFlags
& flags
);
366 inline wxSizerItem
* Insert( size_t index
,
368 const wxSizerFlags
& flags
);
369 virtual wxSizerItem
* Insert( size_t index
, wxSizerItem
*item
);
371 inline wxSizerItem
* InsertSpacer(size_t index
, int size
);
372 inline wxSizerItem
* InsertStretchSpacer(size_t index
, int prop
= 1);
374 inline wxSizerItem
* Prepend( wxWindow
*window
,
378 wxObject
* userData
= NULL
);
379 inline wxSizerItem
* Prepend( wxSizer
*sizer
,
383 wxObject
* userData
= NULL
);
384 inline wxSizerItem
* Prepend( int width
,
389 wxObject
* userData
= NULL
);
390 inline wxSizerItem
* Prepend( wxWindow
*window
, const wxSizerFlags
& flags
);
391 inline wxSizerItem
* Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
);
392 inline wxSizerItem
* Prepend( wxSizerItem
*item
);
394 inline wxSizerItem
* PrependSpacer(int size
);
395 inline wxSizerItem
* PrependStretchSpacer(int prop
= 1);
398 // Deprecated in 2.6 since historically it does not delete the window,
399 // use Detach instead.
400 wxDEPRECATED( virtual bool Remove( wxWindow
*window
) );
401 virtual bool Remove( wxSizer
*sizer
);
402 virtual bool Remove( int index
);
404 virtual bool Detach( wxWindow
*window
);
405 virtual bool Detach( wxSizer
*sizer
);
406 virtual bool Detach( int index
);
408 virtual void Clear( bool delete_windows
= false );
409 virtual void DeleteWindows();
411 void SetMinSize( int width
, int height
)
412 { DoSetMinSize( width
, height
); }
413 void SetMinSize( wxSize size
)
414 { DoSetMinSize( size
.x
, size
.y
); }
416 // Searches recursively
417 bool SetItemMinSize( wxWindow
*window
, int width
, int height
)
418 { return DoSetItemMinSize( window
, width
, height
); }
419 bool SetItemMinSize( wxWindow
*window
, wxSize size
)
420 { return DoSetItemMinSize( window
, size
.x
, size
.y
); }
422 // Searches recursively
423 bool SetItemMinSize( wxSizer
*sizer
, int width
, int height
)
424 { return DoSetItemMinSize( sizer
, width
, height
); }
425 bool SetItemMinSize( wxSizer
*sizer
, wxSize size
)
426 { return DoSetItemMinSize( sizer
, size
.x
, size
.y
); }
428 bool SetItemMinSize( size_t index
, int width
, int height
)
429 { return DoSetItemMinSize( index
, width
, height
); }
430 bool SetItemMinSize( size_t index
, wxSize size
)
431 { return DoSetItemMinSize( index
, size
.x
, size
.y
); }
433 wxSize
GetSize() const
435 wxPoint
GetPosition() const
436 { return m_position
; }
438 // Calculate the minimal size or return m_minSize if bigger.
441 virtual void RecalcSizes() = 0;
442 virtual wxSize
CalcMin() = 0;
444 virtual void Layout();
446 wxSize
Fit( wxWindow
*window
);
447 void FitInside( wxWindow
*window
);
448 void SetSizeHints( wxWindow
*window
);
449 void SetVirtualSizeHints( wxWindow
*window
);
451 wxSizerItemList
& GetChildren()
452 { return m_children
; }
454 void SetDimension( int x
, int y
, int width
, int height
);
456 wxSizerItem
* GetItem( wxWindow
*window
, bool recursive
= false );
457 wxSizerItem
* GetItem( wxSizer
*sizer
, bool recursive
= false );
458 wxSizerItem
* GetItem( size_t index
);
460 // Manage whether individual scene items are considered
461 // in the layout calculations or not.
462 bool Show( wxWindow
*window
, bool show
= true, bool recursive
= false );
463 bool Show( wxSizer
*sizer
, bool show
= true, bool recursive
= false );
464 bool Show( size_t index
, bool show
= true );
466 bool Hide( wxSizer
*sizer
, bool recursive
= false )
467 { return Show( sizer
, false, recursive
); }
468 bool Hide( wxWindow
*window
, bool recursive
= false )
469 { return Show( window
, false, recursive
); }
470 bool Hide( size_t index
)
471 { return Show( index
, false ); }
473 bool IsShown( wxWindow
*window
) const;
474 bool IsShown( wxSizer
*sizer
) const;
475 bool IsShown( size_t index
) const;
477 // Recursively call wxWindow::Show () on all sizer items.
478 virtual void ShowItems (bool show
);
480 void Show(bool show
) { m_isShown
= show
; }
481 bool IsShown() const { return m_isShown
; }
487 wxSizerItemList m_children
;
490 wxSize
GetMaxWindowSize( wxWindow
*window
) const;
491 wxSize
GetMinWindowSize( wxWindow
*window
);
492 wxSize
GetMaxClientSize( wxWindow
*window
) const;
493 wxSize
GetMinClientSize( wxWindow
*window
);
494 wxSize
FitSize( wxWindow
*window
);
495 wxSize
VirtualFitSize( wxWindow
*window
);
497 virtual void DoSetMinSize( int width
, int height
);
498 virtual bool DoSetItemMinSize( wxWindow
*window
, int width
, int height
);
499 virtual bool DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
);
500 virtual bool DoSetItemMinSize( size_t index
, int width
, int height
);
503 DECLARE_CLASS(wxSizer
)
506 //---------------------------------------------------------------------------
508 //---------------------------------------------------------------------------
510 class WXDLLEXPORT wxGridSizer
: public wxSizer
513 wxGridSizer( int rows
, int cols
, int vgap
, int hgap
);
514 wxGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
516 virtual void RecalcSizes();
517 virtual wxSize
CalcMin();
519 void SetCols( int cols
) { m_cols
= cols
; }
520 void SetRows( int rows
) { m_rows
= rows
; }
521 void SetVGap( int gap
) { m_vgap
= gap
; }
522 void SetHGap( int gap
) { m_hgap
= gap
; }
523 int GetCols() const { return m_cols
; }
524 int GetRows() const { return m_rows
; }
525 int GetVGap() const { return m_vgap
; }
526 int GetHGap() const { return m_hgap
; }
534 // return the number of total items and the number of columns and rows
535 int CalcRowsCols(int& rows
, int& cols
) const;
537 void SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
);
540 DECLARE_CLASS(wxGridSizer
)
543 //---------------------------------------------------------------------------
545 //---------------------------------------------------------------------------
547 // the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible"
549 enum wxFlexSizerGrowMode
551 // don't resize the cells in non-flexible direction at all
552 wxFLEX_GROWMODE_NONE
,
554 // uniformly resize only the specified ones (default)
555 wxFLEX_GROWMODE_SPECIFIED
,
557 // uniformly resize all cells
561 class WXDLLEXPORT wxFlexGridSizer
: public wxGridSizer
565 wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
);
566 wxFlexGridSizer( int cols
, int vgap
= 0, int hgap
= 0 );
567 virtual ~wxFlexGridSizer();
570 // set the rows/columns which will grow (the others will remain of the
571 // constant initial size)
572 void AddGrowableRow( size_t idx
, int proportion
= 0 );
573 void RemoveGrowableRow( size_t idx
);
574 void AddGrowableCol( size_t idx
, int proportion
= 0 );
575 void RemoveGrowableCol( size_t idx
);
578 // the sizer cells may grow in both directions, not grow at all or only
579 // grow in one direction but not the other
581 // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
582 void SetFlexibleDirection(int direction
) { m_flexDirection
= direction
; }
583 int GetFlexibleDirection() const { return m_flexDirection
; }
585 // note that the grow mode only applies to the direction which is not
587 void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode
) { m_growMode
= mode
; }
588 wxFlexSizerGrowMode
GetNonFlexibleGrowMode() const { return m_growMode
; }
590 // Read-only access to the row heights and col widths arrays
591 const wxArrayInt
& GetRowHeights() const { return m_rowHeights
; }
592 const wxArrayInt
& GetColWidths() const { return m_colWidths
; }
595 virtual void RecalcSizes();
596 virtual wxSize
CalcMin();
599 void AdjustForFlexDirection();
600 void AdjustForGrowables(const wxSize
& sz
, const wxSize
& minsz
,
601 int nrows
, int ncols
);
603 // the heights/widths of all rows/columns
604 wxArrayInt m_rowHeights
,
607 // indices of the growable columns and rows
608 wxArrayInt m_growableRows
,
611 // proportion values of the corresponding growable rows and columns
612 wxArrayInt m_growableRowsProportions
,
613 m_growableColsProportions
;
615 // parameters describing whether the growable cells should be resized in
616 // both directions or only one
618 wxFlexSizerGrowMode m_growMode
;
620 // saves CalcMin result to optimize RecalcSizes
621 wxSize m_calculatedMinSize
;
624 DECLARE_CLASS(wxFlexGridSizer
)
625 DECLARE_NO_COPY_CLASS(wxFlexGridSizer
)
628 //---------------------------------------------------------------------------
630 //---------------------------------------------------------------------------
632 class WXDLLEXPORT wxBoxSizer
: public wxSizer
635 wxBoxSizer( int orient
);
640 int GetOrientation() const
643 void SetOrientation(int orient
)
644 { m_orient
= orient
; }
655 DECLARE_CLASS(wxBoxSizer
)
658 //---------------------------------------------------------------------------
660 //---------------------------------------------------------------------------
664 class WXDLLEXPORT wxStaticBox
;
666 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
669 wxStaticBoxSizer(wxStaticBox
*box
, int orient
);
670 wxStaticBoxSizer(int orient
, wxWindow
*win
, const wxString
& label
= wxEmptyString
);
675 wxStaticBox
*GetStaticBox() const
676 { return m_staticBox
; }
678 // override to hide/show the static box as well
679 virtual void ShowItems (bool show
);
682 wxStaticBox
*m_staticBox
;
685 DECLARE_CLASS(wxStaticBoxSizer
)
686 DECLARE_NO_COPY_CLASS(wxStaticBoxSizer
)
689 #endif // wxUSE_STATBOX
693 class WXDLLEXPORT wxStdDialogButtonSizer
: public wxBoxSizer
696 // Constructor just creates a new wxBoxSizer, not much else.
697 // Box sizer orientation is automatically determined here:
698 // vertical for PDAs, horizontal for everything else?
699 wxStdDialogButtonSizer();
701 // Checks button ID against system IDs and sets one of the pointers below
702 // to this button. Does not do any sizer-related things here.
703 void AddButton(wxButton
*button
);
705 // Use these if no standard ID can/should be used
706 void SetAffirmativeButton( wxButton
*button
);
707 void SetNegativeButton( wxButton
*button
);
708 void SetCancelButton( wxButton
*button
);
710 // All platform-specific code here, checks which buttons exist and add
711 // them to the sizer accordingly.
712 // Note - one potential hack on Mac we could use here,
713 // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
714 // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
715 // I wouldn't add any other hacks like that into here,
716 // but this one I can see being useful.
719 wxButton
*GetAffirmativeButton() const { return m_buttonAffirmative
; }
720 wxButton
*GetApplyButton() const { return m_buttonApply
; }
721 wxButton
*GetNegativeButton() const { return m_buttonNegative
; }
722 wxButton
*GetCancelButton() const { return m_buttonCancel
; }
723 wxButton
*GetHelpButton() const { return m_buttonHelp
; }
726 wxButton
*m_buttonAffirmative
; // wxID_OK, wxID_YES, wxID_SAVE go here
727 wxButton
*m_buttonApply
;
728 wxButton
*m_buttonNegative
; // wxID_NO
729 wxButton
*m_buttonCancel
;
730 wxButton
*m_buttonHelp
;
733 DECLARE_CLASS(wxStdDialogButtonSizer
)
734 DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer
)
737 #endif // wxUSE_BUTTON
739 #if WXWIN_COMPATIBILITY_2_4
740 // NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they
741 // don't do anything. wxBookCtrlBase::DoGetBestSize does the job now.
743 // ----------------------------------------------------------------------------
745 // ----------------------------------------------------------------------------
749 // this sizer works with wxNotebook/wxListbook/... and sizes the control to
751 class WXDLLEXPORT wxBookCtrlBase
;
753 class WXDLLEXPORT wxBookCtrlSizer
: public wxSizer
756 wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase
*bookctrl
) );
758 wxBookCtrlBase
*GetControl() const { return m_bookctrl
; }
760 virtual void RecalcSizes();
761 virtual wxSize
CalcMin();
764 // this protected ctor lets us mark the real one above as deprecated
765 // and still have warning-free build of the library itself:
768 wxBookCtrlBase
*m_bookctrl
;
771 DECLARE_CLASS(wxBookCtrlSizer
)
772 DECLARE_NO_COPY_CLASS(wxBookCtrlSizer
)
778 // before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards
780 class WXDLLEXPORT wxNotebook
;
782 class WXDLLEXPORT wxNotebookSizer
: public wxBookCtrlSizer
785 wxDEPRECATED( wxNotebookSizer(wxNotebook
*nb
) );
787 wxNotebook
*GetNotebook() const { return (wxNotebook
*)m_bookctrl
; }
790 DECLARE_CLASS(wxNotebookSizer
)
791 DECLARE_NO_COPY_CLASS(wxNotebookSizer
)
794 #endif // wxUSE_NOTEBOOK
796 #endif // wxUSE_BOOKCTRL
798 #endif // WXWIN_COMPATIBILITY_2_4
800 // ----------------------------------------------------------------------------
801 // inline functions implementation
802 // ----------------------------------------------------------------------------
805 wxSizer::Add( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
807 return Add( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
811 wxSizer::Add( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
813 return Add( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
817 wxSizer::Add( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
819 return Add( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
823 wxSizer::Add( wxWindow
*window
, const wxSizerFlags
& flags
)
825 return Add( new wxSizerItem(window
, flags
) );
829 wxSizer::Add( wxSizer
*sizer
, const wxSizerFlags
& flags
)
831 return Add( new wxSizerItem(sizer
, flags
) );
835 wxSizer::Add( wxSizerItem
*item
)
837 return Insert( m_children
.GetCount(), item
);
841 wxSizer::AddSpacer(int size
)
843 return Add(size
, size
);
847 wxSizer::AddStretchSpacer(int prop
)
849 return Add(0, 0, prop
);
853 wxSizer::Prepend( wxWindow
*window
, int proportion
, int flag
, int border
, wxObject
* userData
)
855 return Prepend( new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
859 wxSizer::Prepend( wxSizer
*sizer
, int proportion
, int flag
, int border
, wxObject
* userData
)
861 return Prepend( new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
865 wxSizer::Prepend( int width
, int height
, int proportion
, int flag
, int border
, wxObject
* userData
)
867 return Prepend( new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
871 wxSizer::Prepend( wxSizerItem
*item
)
873 return Insert( 0, item
);
877 wxSizer::PrependSpacer(int size
)
879 return Prepend(size
, size
);
883 wxSizer::PrependStretchSpacer(int prop
)
885 return Prepend(0, 0, prop
);
889 wxSizer::Prepend( wxWindow
*window
, const wxSizerFlags
& flags
)
891 return Prepend( new wxSizerItem(window
, flags
) );
895 wxSizer::Prepend( wxSizer
*sizer
, const wxSizerFlags
& flags
)
897 return Prepend( new wxSizerItem(sizer
, flags
) );
901 wxSizer::Insert( size_t index
,
908 return Insert( index
, new wxSizerItem( window
, proportion
, flag
, border
, userData
) );
912 wxSizer::Insert( size_t index
,
919 return Insert( index
, new wxSizerItem( sizer
, proportion
, flag
, border
, userData
) );
923 wxSizer::Insert( size_t index
,
931 return Insert( index
, new wxSizerItem( width
, height
, proportion
, flag
, border
, userData
) );
935 wxSizer::Insert( size_t index
, wxWindow
*window
, const wxSizerFlags
& flags
)
937 return Insert( index
, new wxSizerItem(window
, flags
) );
941 wxSizer::Insert( size_t index
, wxSizer
*sizer
, const wxSizerFlags
& flags
)
943 return Insert( index
, new wxSizerItem(sizer
, flags
) );
947 wxSizer::InsertSpacer(size_t index
, int size
)
949 return Insert(index
, size
, size
);
953 wxSizer::InsertStretchSpacer(size_t index
, int prop
)
955 return Insert(index
, 0, 0, prop
);
959 #endif // __WXSIZER_H__