| 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 | void OnSize(wxSizeEvent& event); |
| 39 | void OnAbout(wxCommandEvent& event); |
| 40 | void OnNewWindow(wxCommandEvent& event); |
| 41 | void OnQuit(wxCommandEvent& event); |
| 42 | void OnToggleWindow(wxCommandEvent& event); |
| 43 | void OnSashDrag(wxSashEvent& event); |
| 44 | |
| 45 | protected: |
| 46 | wxSashLayoutWindow* m_topWindow; |
| 47 | wxSashLayoutWindow* m_leftWindow1; |
| 48 | wxSashLayoutWindow* m_leftWindow2; |
| 49 | wxSashLayoutWindow* m_bottomWindow; |
| 50 | |
| 51 | DECLARE_EVENT_TABLE() |
| 52 | }; |
| 53 | |
| 54 | class MyChild: public wxMDIChildFrame |
| 55 | { |
| 56 | public: |
| 57 | MyCanvas *canvas; |
| 58 | MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); |
| 59 | ~MyChild(void); |
| 60 | void OnActivate(wxActivateEvent& event); |
| 61 | void OnQuit(wxCommandEvent& event); |
| 62 | |
| 63 | DECLARE_EVENT_TABLE() |
| 64 | }; |
| 65 | |
| 66 | #define SASHTEST_QUIT wxID_EXIT |
| 67 | #define SASHTEST_NEW_WINDOW 2 |
| 68 | #define SASHTEST_REFRESH 3 |
| 69 | #define SASHTEST_CHILD_QUIT 4 |
| 70 | #define SASHTEST_ABOUT wxID_ABOUT |
| 71 | #define SASHTEST_TOGGLE_WINDOW 6 |
| 72 | |
| 73 | #define ID_WINDOW_TOP 100 |
| 74 | #define ID_WINDOW_LEFT1 101 |
| 75 | #define ID_WINDOW_LEFT2 102 |
| 76 | #define ID_WINDOW_BOTTOM 103 |
| 77 | |