]> git.saurik.com Git - wxWidgets.git/blame - samples/layout/layout.h
regenerated all makefiles with bakefile 0.2.0; removed REZ option from config.bkl...
[wxWidgets.git] / samples / layout / layout.h
CommitLineData
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
13class MyApp: public wxApp
14{
83edc0a5 15public:
925e9792 16 MyApp(){};
83edc0a5 17 bool OnInit();
c801d85f
KB
18};
19
9e023db7
VZ
20// the main frame class
21class MyFrame : public wxFrame
c801d85f 22{
83edc0a5 23public:
9e023db7 24 MyFrame();
c801d85f 25
7235f8e1 26 void TestProportions(wxCommandEvent& event);
9e023db7 27 void TestFlexSizers(wxCommandEvent& event);
83edc0a5 28 void TestNotebookSizers(wxCommandEvent& event);
20b35a69 29 void TestGridBagSizer(wxCommandEvent& event);
925e9792 30
9e023db7
VZ
31 void OnAbout(wxCommandEvent& event);
32 void OnQuit(wxCommandEvent& event);
c801d85f 33
83edc0a5
RR
34private:
35 DECLARE_EVENT_TABLE()
c801d85f
KB
36};
37
7235f8e1
VZ
38// a frame showing the box sizer proportions
39class MyProportionsFrame : public wxFrame
40{
41public:
42 MyProportionsFrame(wxFrame *parent);
43
44protected:
45 void UpdateProportions();
46
47 void OnProportionChanged(wxSpinEvent& event);
48 void OnProportionUpdated(wxCommandEvent& event);
49
50 wxSpinCtrl *m_spins[3]; // size can be changed without changing anything else
51 wxSizer *m_sizer;
52};
53
9e023db7
VZ
54// a frame using flex sizers for layout
55class MyFlexSizerFrame : public wxFrame
c801d85f 56{
83edc0a5 57public:
9e023db7 58 MyFlexSizerFrame(const wxChar *title, int x, int y );
83edc0a5 59
2b5f62a0 60private:
bdbb07ed 61 void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
c801d85f
KB
62};
63
20b35a69 64
9e023db7
VZ
65// a dialog using notebook sizer for layout
66class MySizerDialog : public wxDialog
c62ac5b6 67{
83edc0a5 68public:
9e023db7
VZ
69 MySizerDialog(wxWindow *parent, const wxChar *title);
70};
71
20b35a69
RD
72
73// a frame using wxGridBagSizer for layout
74class MyGridBagSizerFrame : public wxFrame
75{
76public:
77 MyGridBagSizerFrame(const wxChar *title, int x, int y );
78
79 void OnHideBtn(wxCommandEvent&);
80 void OnShowBtn(wxCommandEvent&);
81 void OnMoveBtn(wxCommandEvent&);
925e9792 82
20b35a69
RD
83private:
84 wxGridBagSizer* m_gbs;
85 wxPanel* m_panel;
86 wxButton* m_hideBtn;
87 wxButton* m_showBtn;
88 wxTextCtrl* m_hideTxt;
89
90 wxButton* m_moveBtn1;
91 wxButton* m_moveBtn2;
92 wxGBPosition m_lastPos;
925e9792 93
20b35a69
RD
94 DECLARE_EVENT_TABLE()
95};
96
97
98
99
100
101// controls and menu constants
9e023db7
VZ
102enum
103{
91b07357 104 LAYOUT_TEST_SIZER = 101,
7235f8e1
VZ
105 LAYOUT_TEST_NB_SIZER,
106 LAYOUT_TEST_GB_SIZER,
107 LAYOUT_TEST_PROPORTIONS,
108 LAYOUT_QUIT = wxID_EXIT,
109 LAYOUT_ABOUT = wxID_ABOUT
c62ac5b6
RR
110};
111