]> git.saurik.com Git - wxWidgets.git/blob - samples/layout/layout.h
PCH support.
[wxWidgets.git] / samples / layout / layout.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: layout.h
3 // Purpose: Layout sample
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 // Define a new application
13 class MyApp: public wxApp
14 {
15 public:
16 MyApp(){};
17 bool OnInit();
18 };
19
20 // the main frame class
21 class MyFrame : public wxFrame
22 {
23 public:
24 MyFrame();
25
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);
31
32 void OnAbout(wxCommandEvent& event);
33 void OnQuit(wxCommandEvent& event);
34
35 private:
36 DECLARE_EVENT_TABLE()
37 };
38
39 // a frame showing the box sizer proportions
40 class MyProportionsFrame : public wxFrame
41 {
42 public:
43 MyProportionsFrame(wxFrame *parent);
44
45 protected:
46 void UpdateProportions();
47
48 void OnProportionChanged(wxSpinEvent& event);
49 void OnProportionUpdated(wxCommandEvent& event);
50
51 wxSpinCtrl *m_spins[3]; // size can be changed without changing anything else
52 wxSizer *m_sizer;
53 };
54
55 // a frame using flex sizers for layout
56 class MyFlexSizerFrame : public wxFrame
57 {
58 public:
59 MyFlexSizerFrame(const wxChar *title, int x, int y );
60
61 private:
62 void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
63 };
64
65
66 // a dialog using notebook sizer for layout
67 class MySizerDialog : public wxDialog
68 {
69 public:
70 MySizerDialog(wxWindow *parent, const wxChar *title);
71 };
72
73
74 // a frame using wxGridBagSizer for layout
75 class MyGridBagSizerFrame : public wxFrame
76 {
77 public:
78 MyGridBagSizerFrame(const wxChar *title, int x, int y );
79
80 void OnHideBtn(wxCommandEvent&);
81 void OnShowBtn(wxCommandEvent&);
82 void OnMoveBtn(wxCommandEvent&);
83
84 private:
85 wxGridBagSizer* m_gbs;
86 wxPanel* m_panel;
87 wxButton* m_hideBtn;
88 wxButton* m_showBtn;
89 wxTextCtrl* m_hideTxt;
90
91 wxButton* m_moveBtn1;
92 wxButton* m_moveBtn2;
93 wxGBPosition m_lastPos;
94
95 DECLARE_EVENT_TABLE()
96 };
97
98
99 // a frame for testing simple setting of "default size"
100 class MySimpleSizerFrame : public wxFrame
101 {
102 public:
103 MySimpleSizerFrame(const wxChar *title, int x, int y );
104
105 void OnSetSmallSize( wxCommandEvent &event);
106 void OnSetBigSize( wxCommandEvent &event);
107
108 private:
109 wxTextCtrl *m_target;
110
111 DECLARE_EVENT_TABLE()
112 };
113
114
115 // controls and menu constants
116 enum
117 {
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
125 };
126