]>
Commit | Line | Data |
---|---|---|
a6d70308 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: sashtest.h | |
3 | // Purpose: Layout window/sash 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 | #include <wx/toolbar.h> | |
13 | ||
14 | // Define a new application | |
15 | class MyApp: public wxApp | |
16 | { | |
17 | public: | |
18 | bool OnInit(void); | |
19 | }; | |
20 | ||
21 | class MyCanvas: public wxScrolledWindow | |
22 | { | |
23 | public: | |
24 | MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size); | |
25 | virtual void OnDraw(wxDC& dc); | |
26 | void OnEvent(wxMouseEvent& event); | |
27 | ||
28 | DECLARE_EVENT_TABLE() | |
29 | }; | |
30 | ||
31 | // Define a new frame | |
32 | class MyFrame: public wxMDIParentFrame | |
33 | { | |
34 | public: | |
35 | ||
36 | MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); | |
37 | ||
38 | bool OnClose(void); | |
39 | void OnSize(wxSizeEvent& event); | |
40 | void OnAbout(wxCommandEvent& event); | |
41 | void OnNewWindow(wxCommandEvent& event); | |
42 | void OnQuit(wxCommandEvent& event); | |
43 | void OnToggleWindow(wxCommandEvent& event); | |
44 | void OnSashDrag(wxSashEvent& event); | |
45 | ||
46 | protected: | |
47 | wxSashLayoutWindow* m_topWindow; | |
48 | wxSashLayoutWindow* m_leftWindow1; | |
49 | wxSashLayoutWindow* m_leftWindow2; | |
50 | wxSashLayoutWindow* m_bottomWindow; | |
51 | ||
52 | DECLARE_EVENT_TABLE() | |
53 | }; | |
54 | ||
55 | class MyChild: public wxMDIChildFrame | |
56 | { | |
57 | public: | |
58 | MyCanvas *canvas; | |
59 | MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); | |
60 | ~MyChild(void); | |
61 | bool OnClose(void); | |
62 | void OnActivate(wxActivateEvent& event); | |
63 | void OnQuit(wxCommandEvent& event); | |
64 | ||
65 | DECLARE_EVENT_TABLE() | |
66 | }; | |
67 | ||
68 | #define SASHTEST_QUIT 1 | |
69 | #define SASHTEST_NEW_WINDOW 2 | |
70 | #define SASHTEST_REFRESH 3 | |
71 | #define SASHTEST_CHILD_QUIT 4 | |
72 | #define SASHTEST_ABOUT 5 | |
73 | #define SASHTEST_TOGGLE_WINDOW 6 | |
74 | ||
75 | #define ID_WINDOW_TOP 100 | |
76 | #define ID_WINDOW_LEFT1 101 | |
77 | #define ID_WINDOW_LEFT2 102 | |
78 | #define ID_WINDOW_BOTTOM 103 | |
79 |