]>
git.saurik.com Git - wxWidgets.git/blob - samples/layout/layout.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Layout sample
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // Define a new application
13 class MyApp
: public wxApp
20 // the main frame class
21 class MyFrame
: public wxFrame
26 void TestProportions(wxCommandEvent
& event
);
27 void TestFlexSizers(wxCommandEvent
& event
);
28 void TestNotebookSizers(wxCommandEvent
& event
);
29 void TestGridBagSizer(wxCommandEvent
& event
);
30 void TestSetMinimal(wxCommandEvent
& event
);
32 void OnAbout(wxCommandEvent
& event
);
33 void OnQuit(wxCommandEvent
& event
);
39 // a frame showing the box sizer proportions
40 class MyProportionsFrame
: public wxFrame
43 MyProportionsFrame(wxFrame
*parent
);
46 void UpdateProportions();
48 void OnProportionChanged(wxSpinEvent
& event
);
49 void OnProportionUpdated(wxCommandEvent
& event
);
51 wxSpinCtrl
*m_spins
[3]; // size can be changed without changing anything else
55 // a frame using flex sizers for layout
56 class MyFlexSizerFrame
: public wxFrame
59 MyFlexSizerFrame(const wxChar
*title
, int x
, int y
);
62 void InitFlexSizer(wxFlexGridSizer
*sizer
, wxWindow
* parent
);
66 // a dialog using notebook sizer for layout
67 class MySizerDialog
: public wxDialog
70 MySizerDialog(wxWindow
*parent
, const wxChar
*title
);
74 // a frame using wxGridBagSizer for layout
75 class MyGridBagSizerFrame
: public wxFrame
78 MyGridBagSizerFrame(const wxChar
*title
, int x
, int y
);
80 void OnHideBtn(wxCommandEvent
&);
81 void OnShowBtn(wxCommandEvent
&);
82 void OnMoveBtn(wxCommandEvent
&);
85 wxGridBagSizer
* m_gbs
;
89 wxTextCtrl
* m_hideTxt
;
93 wxGBPosition m_lastPos
;
99 // a frame for testing simple setting of "default size"
100 class MySimpleSizerFrame
: public wxFrame
103 MySimpleSizerFrame(const wxChar
*title
, int x
, int y
);
105 void OnSetSmallSize( wxCommandEvent
&event
);
106 void OnSetBigSize( wxCommandEvent
&event
);
109 wxTextCtrl
*m_target
;
111 DECLARE_EVENT_TABLE()
115 // controls and menu constants
118 LAYOUT_TEST_SIZER
= 101,
119 LAYOUT_TEST_NB_SIZER
,
120 LAYOUT_TEST_GB_SIZER
,
121 LAYOUT_TEST_PROPORTIONS
,
122 LAYOUT_TEST_SET_MINIMAL
,
123 LAYOUT_QUIT
= wxID_EXIT
,
124 LAYOUT_ABOUT
= wxID_ABOUT