1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: provide wxSizer class for layounting
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
44 wxSizerItem( int width
, int height
, int option
, int flag
, int border
);
47 wxSizerItem( wxWindow
*window
, int option
, int flag
, int border
);
50 wxSizerItem( wxSizer
*sizer
, int option
, int flag
, int border
);
52 virtual wxSize
GetSize();
53 virtual wxSize
CalcMin();
54 virtual void SetDimension( wxPoint pos
, wxSize size
);
60 wxWindow
*GetWindow() const
62 wxSizer
*GetSizer() const
81 //---------------------------------------------------------------------------
83 //---------------------------------------------------------------------------
85 class WXDLLEXPORT wxSizer
: public wxObject
91 virtual void Add( wxWindow
*window
, int option
= 0, int flag
= 0, int border
= 0 );
92 virtual void Add( wxSizer
*sizer
, int option
= 0, int flag
= 0, int border
= 0 );
93 virtual void Add( int width
, int height
, int option
= 0, int flag
= 0, int border
= 0 );
95 virtual void Prepend( wxWindow
*window
, int option
= 0, int flag
= 0, int border
= 0 );
96 virtual void Prepend( wxSizer
*sizer
, int option
= 0, int flag
= 0, int border
= 0 );
97 virtual void Prepend( int width
, int height
, int option
= 0, int flag
= 0, int border
= 0 );
99 virtual bool Remove( wxWindow
*window
);
100 virtual bool Remove( wxSizer
*sizer
);
101 virtual bool Remove( int pos
);
103 void SetDimension( int x
, int y
, int width
, int height
);
107 wxPoint
GetPosition()
108 { return m_position
; }
110 { return CalcMin(); }
112 virtual void RecalcSizes() = 0;
113 virtual wxSize
CalcMin() = 0;
115 virtual void Layout();
117 void Fit( wxWindow
*window
);
118 void SetSizeHints( wxWindow
*window
);
125 wxSize
GetMinWindowSize( wxWindow
*window
);
128 //---------------------------------------------------------------------------
130 //---------------------------------------------------------------------------
132 class WXDLLEXPORT wxBoxSizer
: public wxSizer
135 wxBoxSizer( int orient
);
152 //---------------------------------------------------------------------------
154 //---------------------------------------------------------------------------
156 class WXDLLEXPORT wxStaticBoxSizer
: public wxBoxSizer
159 wxStaticBoxSizer( wxStaticBox
*box
, int orient
);
164 wxStaticBox
*GetStaticBox()
165 { return m_staticBox
; }
168 wxStaticBox
*m_staticBox
;