sashtest.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: sashtest.h
  3. // Purpose: Layout window/sash sample
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 04/01/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #include "wx/toolbar.h"
  11. // Define a new application
  12. class MyApp: public wxApp
  13. {
  14. public:
  15. bool OnInit(void);
  16. };
  17. class MyCanvas: public wxScrolledWindow
  18. {
  19. public:
  20. MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
  21. virtual void OnDraw(wxDC& dc);
  22. void OnEvent(wxMouseEvent& event);
  23. wxDECLARE_EVENT_TABLE();
  24. };
  25. // Define a new frame
  26. class MyFrame: public wxMDIParentFrame
  27. {
  28. public:
  29. MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
  30. void OnSize(wxSizeEvent& event);
  31. void OnAbout(wxCommandEvent& event);
  32. void OnNewWindow(wxCommandEvent& event);
  33. void OnQuit(wxCommandEvent& event);
  34. void OnToggleWindow(wxCommandEvent& event);
  35. void OnSashDrag(wxSashEvent& event);
  36. protected:
  37. wxSashLayoutWindow* m_topWindow;
  38. wxSashLayoutWindow* m_leftWindow1;
  39. wxSashLayoutWindow* m_leftWindow2;
  40. wxSashLayoutWindow* m_bottomWindow;
  41. DECLARE_EVENT_TABLE()
  42. };
  43. class MyChild: public wxMDIChildFrame
  44. {
  45. public:
  46. MyCanvas *canvas;
  47. MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
  48. ~MyChild(void);
  49. void OnActivate(wxActivateEvent& event);
  50. void OnQuit(wxCommandEvent& event);
  51. DECLARE_EVENT_TABLE()
  52. };
  53. #define SASHTEST_QUIT wxID_EXIT
  54. #define SASHTEST_NEW_WINDOW 2
  55. #define SASHTEST_REFRESH 3
  56. #define SASHTEST_CHILD_QUIT 4
  57. #define SASHTEST_ABOUT wxID_ABOUT
  58. #define SASHTEST_TOGGLE_WINDOW 6
  59. #define ID_WINDOW_TOP 100
  60. #define ID_WINDOW_LEFT1 101
  61. #define ID_WINDOW_LEFT2 102
  62. #define ID_WINDOW_BOTTOM 103