]> git.saurik.com Git - wxWidgets.git/blame_incremental - samples/layout/layout.h
adding a app-defined event seems to quit inner eventloops like eg the popup of the...
[wxWidgets.git] / samples / layout / layout.h
... / ...
CommitLineData
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 licence
10/////////////////////////////////////////////////////////////////////////////
11
12// Define a new application
13class MyApp: public wxApp
14{
15public:
16 MyApp(){};
17 bool OnInit();
18};
19
20// the main frame class
21class MyFrame : public wxFrame
22{
23public:
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 TestNested(wxCommandEvent& event);
31 void TestSetMinimal(wxCommandEvent& event);
32 void TestWrap(wxCommandEvent& event);
33
34 void OnAbout(wxCommandEvent& event);
35 void OnQuit(wxCommandEvent& event);
36
37private:
38 DECLARE_EVENT_TABLE()
39};
40
41// a frame showing the box sizer proportions
42class MyProportionsFrame : public wxFrame
43{
44public:
45 MyProportionsFrame(wxFrame *parent);
46
47protected:
48 void UpdateProportions();
49
50 void OnProportionChanged(wxSpinEvent& event);
51 void OnProportionUpdated(wxCommandEvent& event);
52
53 wxSpinCtrl *m_spins[3]; // size can be changed without changing anything else
54 wxSizer *m_sizer;
55};
56
57// a frame using flex sizers for layout
58class MyFlexSizerFrame : public wxFrame
59{
60public:
61 MyFlexSizerFrame(const wxString &title, int x, int y );
62
63private:
64 void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
65};
66
67
68// a dialog using notebook sizer for layout
69class MySizerDialog : public wxDialog
70{
71public:
72 MySizerDialog(wxWindow *parent, const wxString &title );
73};
74
75
76// a frame using wxGridBagSizer for layout
77class MyGridBagSizerFrame : public wxFrame
78{
79public:
80 MyGridBagSizerFrame(const wxString &title, int x, int y );
81
82 void OnHideBtn(wxCommandEvent&);
83 void OnShowBtn(wxCommandEvent&);
84 void OnMoveBtn(wxCommandEvent&);
85
86private:
87 wxGridBagSizer* m_gbs;
88 wxPanel* m_panel;
89 wxButton* m_hideBtn;
90 wxButton* m_showBtn;
91 wxTextCtrl* m_hideTxt;
92
93 wxButton* m_moveBtn1;
94 wxButton* m_moveBtn2;
95 wxGBPosition m_lastPos;
96
97 DECLARE_EVENT_TABLE()
98};
99
100
101// a frame for testing simple setting of "default size"
102class MySimpleSizerFrame : public wxFrame
103{
104public:
105 MySimpleSizerFrame(const wxString &title, int x, int y );
106
107 void OnSetSmallSize( wxCommandEvent &event);
108 void OnSetBigSize( wxCommandEvent &event);
109
110private:
111 wxTextCtrl *m_target;
112
113 DECLARE_EVENT_TABLE()
114};
115
116
117// a frame for testing simple setting of a frame containing
118// a sizer containing a panel containing a sizer containing
119// controls
120class MyNestedSizerFrame : public wxFrame
121{
122public:
123 MyNestedSizerFrame(const wxString &title, int x, int y );
124
125
126private:
127 wxTextCtrl *m_target;
128};
129
130// a frame with several wrapping sizers
131
132class MyWrapSizerFrame: public wxFrame
133{
134public:
135 MyWrapSizerFrame(const wxString &title, int x, int y );
136};
137
138// controls and menu constants
139enum
140{
141 LAYOUT_TEST_SIZER = 101,
142 LAYOUT_TEST_NB_SIZER,
143 LAYOUT_TEST_GB_SIZER,
144 LAYOUT_TEST_PROPORTIONS,
145 LAYOUT_TEST_SET_MINIMAL,
146 LAYOUT_TEST_NESTED,
147 LAYOUT_TEST_WRAP,
148 LAYOUT_QUIT = wxID_EXIT,
149 LAYOUT_ABOUT = wxID_ABOUT
150};
151