home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2240.zip / wxWindows-2.4.0 / samples / docvwmdi / view.h < prev   
C/C++ Source or Header  |  2002-08-20  |  2KB  |  82 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        view.h
  3. // Purpose:     View classes
  4. // Author:      Julian Smart
  5. // Modified by:
  6. // Created:     04/01/98
  7. // RCS-ID:      $Id: view.h,v 1.7 2002/08/20 09:09:53 JS Exp $
  8. // Copyright:   (c) Julian Smart and Markus Holzem
  9. // Licence:     wxWindows license
  10. /////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifdef __GNUG__
  13. // #pragma interface
  14. #endif
  15.  
  16. #ifndef __VIEWSAMPLEH__
  17. #define __VIEWSAMPLEH__
  18.  
  19. #include "wx/docview.h"
  20.  
  21. class MyCanvas: public wxScrolledWindow
  22. {
  23. public:
  24.     wxView *view;
  25.     
  26.     MyCanvas(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style);
  27.     virtual void OnDraw(wxDC& dc);
  28.     void OnMouseEvent(wxMouseEvent& event);
  29.  
  30. private:
  31.     DECLARE_EVENT_TABLE()
  32. };
  33.  
  34. class MyTextWindow: public wxTextCtrl
  35. {
  36. public:
  37.     wxView *view;
  38.     
  39.     MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style);
  40. };
  41.  
  42. class DrawingView: public wxView
  43. {
  44. public:
  45.     wxMDIChildFrame *frame;
  46.     MyCanvas *canvas;
  47.   
  48.     DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxMDIChildFrame *) NULL; }
  49.     ~DrawingView() {}
  50.  
  51.     bool OnCreate(wxDocument *doc, long flags);
  52.     void OnDraw(wxDC *dc);
  53.     void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
  54.     bool OnClose(bool deleteWindow = TRUE);
  55.  
  56.     void OnCut(wxCommandEvent& event);
  57.  
  58. private:
  59.     DECLARE_DYNAMIC_CLASS(DrawingView)
  60.     DECLARE_EVENT_TABLE()
  61. };
  62.  
  63. class TextEditView: public wxView
  64. {
  65. public:
  66.     wxMDIChildFrame *frame;
  67.     MyTextWindow *textsw;
  68.   
  69.     TextEditView(): wxView() { frame = (wxMDIChildFrame *) NULL; textsw = (MyTextWindow *) NULL; }
  70.     ~TextEditView() {}
  71.  
  72.     bool OnCreate(wxDocument *doc, long flags);
  73.     void OnDraw(wxDC *dc);
  74.     void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
  75.     bool OnClose(bool deleteWindow = TRUE);
  76.     
  77. private:
  78.   DECLARE_DYNAMIC_CLASS(TextEditView)
  79. };
  80.  
  81. #endif
  82.