1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: provide wxNewSizer 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 //---------------------------------------------------------------------------
33 //---------------------------------------------------------------------------
35 //---------------------------------------------------------------------------
37 class WXDLLEXPORT wxNewSizerItem
: public wxObject
41 wxNewSizerItem( int width
, int height
, int option
);
44 wxNewSizerItem( wxWindow
*window
, int option
);
47 wxNewSizerItem( wxNewSizer
*sizer
, int option
);
49 virtual wxSize
GetSize();
50 virtual wxSize
CalcMin();
51 virtual void SetDimension( wxPoint pos
, wxSize size
);
57 wxWindow
*GetWindow() const
59 wxNewSizer
*GetNewSizer() const
71 //---------------------------------------------------------------------------
73 //---------------------------------------------------------------------------
75 class WXDLLEXPORT wxNewSizer
: public wxObject
81 virtual void Add( wxWindow
*window
, int option
= 0 );
82 virtual void Add( wxNewSizer
*sizer
, int option
= 0 );
83 virtual void Add( int width
, int height
, int option
= 0 );
85 void SetDimension( int x
, int y
, int width
, int height
);
90 { return m_position
; }
94 virtual void RecalcSizes() = 0;
95 virtual wxSize
CalcMin() = 0;
97 virtual void Layout();
99 void Fit( wxWindow
*window
);
100 void SetSizeHints( wxWindow
*window
);
107 wxSize
GetMinWindowSize( wxWindow
*window
);
110 //---------------------------------------------------------------------------
112 //---------------------------------------------------------------------------
114 #define wxWEST wxLEFT
115 #define wxEAST wxRIGHT
117 #define wxSOUTH wxDOWN
118 #define wxALL_DIRECTIONS (wxNORTH | wxSOUTH | wxEAST | wxWEST)
120 class WXDLLEXPORT wxBorderNewSizer
: public wxNewSizer
123 wxBorderNewSizer( int sides
= wxALL_DIRECTIONS
);
125 virtual void Add( wxWindow
*window
, int option
= 10 );
126 virtual void Add( wxNewSizer
*sizer
, int option
= 10 );
127 virtual void Add( int width
, int height
, int option
= 10 );