]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
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$ | |
6aa89a22 | 8 | // Copyright: (c) Julian Smart |
2f6c54eb | 9 | // Licence: wxWindows license |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | // Define a new application | |
13 | class MyApp: public wxApp | |
14 | { | |
83edc0a5 RR |
15 | public: |
16 | MyApp(); | |
17 | bool OnInit(); | |
c801d85f KB |
18 | }; |
19 | ||
9e023db7 VZ |
20 | // the main frame class |
21 | class MyFrame : public wxFrame | |
c801d85f | 22 | { |
83edc0a5 | 23 | public: |
9e023db7 | 24 | MyFrame(); |
c801d85f | 25 | |
9e023db7 VZ |
26 | void TestConstraints(wxCommandEvent& event); |
27 | void TestFlexSizers(wxCommandEvent& event); | |
83edc0a5 | 28 | void TestNotebookSizers(wxCommandEvent& event); |
20b35a69 RD |
29 | void TestGridBagSizer(wxCommandEvent& event); |
30 | ||
9e023db7 VZ |
31 | void OnAbout(wxCommandEvent& event); |
32 | void OnQuit(wxCommandEvent& event); | |
c801d85f | 33 | |
83edc0a5 RR |
34 | private: |
35 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
36 | }; |
37 | ||
9e023db7 VZ |
38 | // a frame using constraints for layout |
39 | class MyConstraintsFrame : public wxFrame | |
c801d85f | 40 | { |
83edc0a5 | 41 | public: |
9e023db7 | 42 | MyConstraintsFrame(const wxChar *title, int x, int y ); |
c801d85f KB |
43 | }; |
44 | ||
9e023db7 VZ |
45 | // a frame using flex sizers for layout |
46 | class MyFlexSizerFrame : public wxFrame | |
c801d85f | 47 | { |
83edc0a5 | 48 | public: |
9e023db7 | 49 | MyFlexSizerFrame(const wxChar *title, int x, int y ); |
83edc0a5 | 50 | |
2b5f62a0 | 51 | private: |
9e023db7 | 52 | void InitFlexSizer(wxFlexGridSizer *sizer); |
c801d85f KB |
53 | }; |
54 | ||
20b35a69 | 55 | |
9e023db7 VZ |
56 | // a dialog using notebook sizer for layout |
57 | class MySizerDialog : public wxDialog | |
c62ac5b6 | 58 | { |
83edc0a5 | 59 | public: |
9e023db7 VZ |
60 | MySizerDialog(wxWindow *parent, const wxChar *title); |
61 | }; | |
62 | ||
20b35a69 RD |
63 | |
64 | // a frame using wxGridBagSizer for layout | |
65 | class MyGridBagSizerFrame : public wxFrame | |
66 | { | |
67 | public: | |
68 | MyGridBagSizerFrame(const wxChar *title, int x, int y ); | |
69 | ||
70 | void OnHideBtn(wxCommandEvent&); | |
71 | void OnShowBtn(wxCommandEvent&); | |
72 | void OnMoveBtn(wxCommandEvent&); | |
73 | ||
74 | private: | |
75 | wxGridBagSizer* m_gbs; | |
76 | wxPanel* m_panel; | |
77 | wxButton* m_hideBtn; | |
78 | wxButton* m_showBtn; | |
79 | wxTextCtrl* m_hideTxt; | |
80 | ||
81 | wxButton* m_moveBtn1; | |
82 | wxButton* m_moveBtn2; | |
83 | wxGBPosition m_lastPos; | |
84 | ||
85 | DECLARE_EVENT_TABLE() | |
86 | }; | |
87 | ||
88 | ||
89 | ||
90 | ||
91 | ||
92 | // controls and menu constants | |
9e023db7 VZ |
93 | enum |
94 | { | |
95 | LAYOUT_QUIT = 100, | |
96 | LAYOUT_ABOUT, | |
97 | LAYOUT_TEST_CONSTRAINTS, | |
98 | LAYOUT_TEST_SIZER, | |
20b35a69 RD |
99 | LAYOUT_TEST_NB_SIZER, |
100 | LAYOUT_TEST_GB_SIZER | |
c62ac5b6 RR |
101 | }; |
102 |