]> git.saurik.com Git - wxWidgets.git/blame_incremental - samples/layout/layout.h
fix compilation problem when wxUSE_FSVOLUME==0 after last commit: declare wxIsDriveAv...
[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 license
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
33 void OnAbout(wxCommandEvent& event);
34 void OnQuit(wxCommandEvent& event);
35
36private:
37 DECLARE_EVENT_TABLE()
38};
39
40// a frame showing the box sizer proportions
41class MyProportionsFrame : public wxFrame
42{
43public:
44 MyProportionsFrame(wxFrame *parent);
45
46protected:
47 void UpdateProportions();
48
49 void OnProportionChanged(wxSpinEvent& event);
50 void OnProportionUpdated(wxCommandEvent& event);
51
52 wxSpinCtrl *m_spins[3]; // size can be changed without changing anything else
53 wxSizer *m_sizer;
54};
55
56// a frame using flex sizers for layout
57class MyFlexSizerFrame : public wxFrame
58{
59public:
60 MyFlexSizerFrame(const wxChar *title, int x, int y );
61
62private:
63 void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
64};
65
66
67// a dialog using notebook sizer for layout
68class MySizerDialog : public wxDialog
69{
70public:
71 MySizerDialog(wxWindow *parent, const wxChar *title);
72};
73
74
75// a frame using wxGridBagSizer for layout
76class MyGridBagSizerFrame : public wxFrame
77{
78public:
79 MyGridBagSizerFrame(const wxChar *title, int x, int y );
80
81 void OnHideBtn(wxCommandEvent&);
82 void OnShowBtn(wxCommandEvent&);
83 void OnMoveBtn(wxCommandEvent&);
84
85private:
86 wxGridBagSizer* m_gbs;
87 wxPanel* m_panel;
88 wxButton* m_hideBtn;
89 wxButton* m_showBtn;
90 wxTextCtrl* m_hideTxt;
91
92 wxButton* m_moveBtn1;
93 wxButton* m_moveBtn2;
94 wxGBPosition m_lastPos;
95
96 DECLARE_EVENT_TABLE()
97};
98
99
100// a frame for testing simple setting of "default size"
101class MySimpleSizerFrame : public wxFrame
102{
103public:
104 MySimpleSizerFrame(const wxChar *title, int x, int y );
105
106 void OnSetSmallSize( wxCommandEvent &event);
107 void OnSetBigSize( wxCommandEvent &event);
108
109private:
110 wxTextCtrl *m_target;
111
112 DECLARE_EVENT_TABLE()
113};
114
115
116// a frame for testing simple setting of a frame containing
117// a sizer containing a panel containing a sizer containing
118// controls
119class MyNestedSizerFrame : public wxFrame
120{
121public:
122 MyNestedSizerFrame(const wxChar *title, int x, int y );
123
124
125private:
126 wxTextCtrl *m_target;
127};
128
129// controls and menu constants
130enum
131{
132 LAYOUT_TEST_SIZER = 101,
133 LAYOUT_TEST_NB_SIZER,
134 LAYOUT_TEST_GB_SIZER,
135 LAYOUT_TEST_PROPORTIONS,
136 LAYOUT_TEST_SET_MINIMAL,
137 LAYOUT_TEST_NESTED,
138 LAYOUT_QUIT = wxID_EXIT,
139 LAYOUT_ABOUT = wxID_ABOUT
140};
141