]>
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$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
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 | ||
20 | // Define a new frame | |
21 | class MyTextWindow; | |
22 | class MyWindow; | |
23 | ||
24 | class MyFrame: public wxFrame | |
25 | { | |
83edc0a5 | 26 | public: |
42ed7532 | 27 | MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h); |
2b5f62a0 VZ |
28 | |
29 | void OnQuit(wxCommandEvent& event); | |
c801d85f | 30 | |
83edc0a5 RR |
31 | void TestSizers(wxCommandEvent& event); |
32 | void TestNotebookSizers(wxCommandEvent& event); | |
c801d85f KB |
33 | void About(wxCommandEvent& event); |
34 | ||
83edc0a5 RR |
35 | private: |
36 | DECLARE_EVENT_TABLE() | |
c801d85f KB |
37 | }; |
38 | ||
39 | // Define a new text subwindow that can respond to drag-and-drop | |
40 | class MyTextWindow: public wxTextCtrl | |
41 | { | |
83edc0a5 RR |
42 | public: |
43 | MyTextWindow(wxFrame *frame, int x=-1, int y=-1, int width=-1, int height=-1, | |
c801d85f | 44 | long style=wxTE_MULTILINE): |
42ed7532 | 45 | wxTextCtrl(frame, -1, _T(""), wxPoint(x, y), wxSize(width, height), style) |
83edc0a5 RR |
46 | { |
47 | } | |
48 | ||
c801d85f KB |
49 | }; |
50 | ||
51 | // Define a new canvas which can receive some events | |
52 | class MyWindow: public wxWindow | |
53 | { | |
83edc0a5 | 54 | public: |
c801d85f | 55 | MyWindow(wxFrame *frame, int x, int y, int w, int h, long style = wxRETAINED); |
83edc0a5 | 56 | ~MyWindow(); |
c801d85f | 57 | void OnPaint(wxPaintEvent& event); |
83edc0a5 | 58 | |
2b5f62a0 | 59 | private: |
c801d85f KB |
60 | DECLARE_EVENT_TABLE() |
61 | }; | |
62 | ||
83edc0a5 | 63 | class MySizerFrame: public wxFrame |
c62ac5b6 | 64 | { |
83edc0a5 | 65 | public: |
c62ac5b6 | 66 | wxPanel *panel; |
42ed7532 | 67 | MySizerFrame(wxFrame *frame, wxChar *title, int x, int y ); |
c62ac5b6 RR |
68 | }; |
69 | ||
c801d85f KB |
70 | #define LAYOUT_QUIT 100 |
71 | #define LAYOUT_TEST 101 | |
72 | #define LAYOUT_ABOUT 102 | |
83edc0a5 RR |
73 | #define LAYOUT_TEST_SIZER 104 |
74 | #define LAYOUT_TEST_NB 105 |