]>
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
);
31 void OnAbout(wxCommandEvent
& event
);
32 void OnQuit(wxCommandEvent
& event
);
38 // a frame showing the box sizer proportions
39 class MyProportionsFrame
: public wxFrame
42 MyProportionsFrame(wxFrame
*parent
);
45 void UpdateProportions();
47 void OnProportionChanged(wxSpinEvent
& event
);
48 void OnProportionUpdated(wxCommandEvent
& event
);
50 wxSpinCtrl
*m_spins
[3]; // size can be changed without changing anything else
54 // a frame using flex sizers for layout
55 class MyFlexSizerFrame
: public wxFrame
58 MyFlexSizerFrame(const wxChar
*title
, int x
, int y
);
61 void InitFlexSizer(wxFlexGridSizer
*sizer
, wxWindow
* parent
);
65 // a dialog using notebook sizer for layout
66 class MySizerDialog
: public wxDialog
69 MySizerDialog(wxWindow
*parent
, const wxChar
*title
);
73 // a frame using wxGridBagSizer for layout
74 class MyGridBagSizerFrame
: public wxFrame
77 MyGridBagSizerFrame(const wxChar
*title
, int x
, int y
);
79 void OnHideBtn(wxCommandEvent
&);
80 void OnShowBtn(wxCommandEvent
&);
81 void OnMoveBtn(wxCommandEvent
&);
84 wxGridBagSizer
* m_gbs
;
88 wxTextCtrl
* m_hideTxt
;
92 wxGBPosition m_lastPos
;
101 // controls and menu constants
104 LAYOUT_TEST_SIZER
= 101,
105 LAYOUT_TEST_NB_SIZER
,
106 LAYOUT_TEST_GB_SIZER
,
107 LAYOUT_TEST_PROPORTIONS
,
108 LAYOUT_QUIT
= wxID_EXIT
,
109 LAYOUT_ABOUT
= wxID_ABOUT