home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2233.zip / wxOS2-2_3_3.zip / wxWindows-2.3.3 / samples / docview / view.h < prev   
C/C++ Source or Header  |  2002-03-20  |  2KB  |  80 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.5 2002/03/17 14:15:40 VZ 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, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
  27.     virtual void OnDraw(wxDC& dc);
  28.     void OnMouseEvent(wxMouseEvent& event);
  29.     
  30.     DECLARE_EVENT_TABLE()
  31. };
  32.  
  33. class MyTextWindow: public wxTextCtrl
  34. {
  35. public:
  36.     wxView *view;
  37.     
  38.     MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
  39. };
  40.  
  41. class DrawingView: public wxView
  42. {
  43.     DECLARE_DYNAMIC_CLASS(DrawingView)
  44. private:
  45. public:
  46.     wxFrame *frame;
  47.     MyCanvas *canvas;
  48.     
  49.     DrawingView(void) { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; };
  50.     ~DrawingView(void) {};
  51.     
  52.     bool OnCreate(wxDocument *doc, long flags);
  53.     void OnDraw(wxDC *dc);
  54.     void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
  55.     bool OnClose(bool deleteWindow = TRUE);
  56.     
  57.     void OnCut(wxCommandEvent& event);
  58.     
  59.     DECLARE_EVENT_TABLE()
  60. };
  61.  
  62. class TextEditView: public wxView
  63. {
  64.     DECLARE_DYNAMIC_CLASS(TextEditView)
  65. private:
  66. public:
  67.     wxFrame *frame;
  68.     MyTextWindow *textsw;
  69.     
  70.     TextEditView(): wxView() { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
  71.     ~TextEditView(void) {}
  72.     
  73.     bool OnCreate(wxDocument *doc, long flags);
  74.     void OnDraw(wxDC *dc);
  75.     void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
  76.     bool OnClose(bool deleteWindow = TRUE);
  77. };
  78.  
  79. #endif
  80.