]>
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 | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // Define a new application | |
13 | class MyApp: public wxApp | |
14 | { | |
15 | public: | |
16 | MyApp(void) ; | |
17 | bool OnInit(void); | |
18 | }; | |
19 | ||
20 | // Define a new frame | |
21 | class MyTextWindow; | |
22 | class MyWindow; | |
23 | ||
24 | class MyFrame: public wxFrame | |
25 | { | |
26 | public: | |
27 | wxPanel *panel; | |
28 | MyTextWindow *text_window; | |
29 | MyWindow *canvas; | |
30 | MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h); | |
31 | void OnSize(wxSizeEvent& event); | |
32 | bool OnClose(void); | |
33 | void Draw(wxDC& dc, bool draw_bitmaps = TRUE); | |
34 | ||
35 | void LoadFile(wxCommandEvent& event); | |
36 | void Quit(wxCommandEvent& event); | |
37 | void TestSizers(wxCommandEvent& event); | |
38 | void About(wxCommandEvent& event); | |
39 | ||
40 | DECLARE_EVENT_TABLE() | |
41 | }; | |
42 | ||
43 | // Define a new text subwindow that can respond to drag-and-drop | |
44 | class MyTextWindow: public wxTextCtrl | |
45 | { | |
46 | public: | |
47 | MyTextWindow(wxFrame *frame, int x=-1, int y=-1, int width=-1, int height=-1, | |
48 | long style=wxTE_MULTILINE): | |
49 | wxTextCtrl(frame, -1, "", wxPoint(x, y), wxSize(width, height), style) | |
50 | { | |
51 | } | |
52 | }; | |
53 | ||
54 | // Define a new canvas which can receive some events | |
55 | class MyWindow: public wxWindow | |
56 | { | |
57 | public: | |
58 | MyWindow(wxFrame *frame, int x, int y, int w, int h, long style = wxRETAINED); | |
59 | ~MyWindow(void) ; | |
60 | void OnPaint(wxPaintEvent& event); | |
61 | ||
62 | DECLARE_EVENT_TABLE() | |
63 | }; | |
64 | ||
65 | class SizerFrame: public wxFrame | |
66 | { | |
67 | public: | |
68 | wxPanel *panel; | |
69 | SizerFrame(wxFrame *frame, char *title, int x, int y, int w, int h); | |
70 | void OnSize(wxSizeEvent& event); | |
71 | bool OnClose(void); | |
72 | ||
73 | DECLARE_EVENT_TABLE() | |
74 | }; | |
75 | ||
76 | #define LAYOUT_QUIT 100 | |
77 | #define LAYOUT_TEST 101 | |
78 | #define LAYOUT_ABOUT 102 | |
79 | #define LAYOUT_LOAD_FILE 103 |