1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: provide wxSizer class for layouting
4 // Author: Robert Roebling and Robin Dunn
8 // Copyright: (c) Robin Dunn, Dirk Holtwick and Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "sizer.h"
21 #include "wx/window.h"
23 #include "wx/dialog.h"
25 //---------------------------------------------------------------------------
27 //---------------------------------------------------------------------------
34 class wxStaticBoxSizer
;
36 //---------------------------------------------------------------------------
38 //---------------------------------------------------------------------------
40 class WXDLLEXPORT wxSizerItem
: public wxObject
42 DECLARE_CLASS(wxSizerItem
);
45 wxSizerItem( int width
, int height
, int option
, int flag
, int border
, wxObject
* userData
);
48 wxSizerItem( wxWindow
*window
, int option
, int flag
, int border
, wxObject
* userData
);
51 wxSizerItem( wxSizer
*sizer
, int option
, int flag
, int border
, wxObject
* userData
);
55 virtual wxSize
GetSize();
56 virtual wxSize
CalcMin();
57 virtual void SetDimension( wxPoint pos
, wxSize size
);
63 wxWindow
*GetWindow() const
65 wxSizer
*GetSizer() const
73 wxObject
* GetUserData()
74 { return m_userData
; }
87 //---------------------------------------------------------------------------
89 //---------------------------------------------------------------------------
91 class WXDLLEXPORT wxSizer
: public wxObject
93 DECLARE_CLASS(wxSizer
);
98 virtual void Add( wxWindow
*window
, int option
= 0, int flag
= 0, int border
= 0, wxObject
* userData
= NULL
);
99 virtual void Add( wxSizer
*sizer
, int option
= 0, int flag
= 0, int border
= 0, wxObject
* userData
= NULL
);
100 virtual void Add( int width
, int height
, int option
= 0, int flag
= 0, int border
= 0, wxObject
* userData
= NULL
);
102 virtual void Prepend( wxWindow
*window
, int option
= 0, int flag
= 0, int border
= 0, wxObject
* userData
= NULL
);
103 virtual void Prepend( wxSizer
*sizer
, int option
= 0, int flag
= 0, int border
= 0, wxObject
* userData
= NULL
);
104 virtual void Prepend( int width
, int height
, int option
= 0, int flag
= 0, int border
= 0, wxObject
* userData
= NULL
);
106 virtual bool Remove( wxWindow
*window
);
107 virtual bool Remove( wxSizer
*sizer
);
108 virtual bool Remove( int pos
);
110 void SetDimension( int x
, int y
, int width
, int height
);
114 wxPoint
GetPosition()
115 { return m_position
; }
117 { return CalcMin(); }
119 virtual void RecalcSizes() = 0;
120 virtual wxSize
CalcMin() = 0;
122 virtual void Layout();
124 void Fit( wxWindow
*window
);
125 void SetSizeHints( wxWindow
*window
);
127 wxList
& GetChildren()
128 { return m_children
; }
135 wxSize
GetMinWindowSize( wxWindow
*window
);
138 //---------------------------------------------------------------------------
140 //---------------------------------------------------------------------------
142 class WXDLLEXPORT wxBoxSizer
: public wxSizer
144 DECLARE_CLASS(wxBoxSizer
);
146 wxBoxSizer( int orient
);
163 //---------------------------------------------------------------------------
165 //---------------------------------------------------------------------------
167 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
169 DECLARE_CLASS(wxStaticBoxSizer
);
171 wxStaticBoxSizer( wxStaticBox
*box
, int orient
);
176 wxStaticBox
*GetStaticBox()
177 { return m_staticBox
; }
180 wxStaticBox
*m_staticBox
;