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 35650 2005-09-23 12:56:45Z MR $ 8// Copyright: (c) Julian Smart 9// Licence: wxWindows license 10///////////////////////////////////////////////////////////////////////////// 11 12#ifndef __VIEWSAMPLEH__ 13#define __VIEWSAMPLEH__ 14 15#include "wx/docview.h" 16 17class MyCanvas: public wxScrolledWindow 18{ 19public: 20 wxView *view; 21 22 MyCanvas(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style); 23 virtual void OnDraw(wxDC& dc); 24 void OnMouseEvent(wxMouseEvent& event); 25 26private: 27 DECLARE_EVENT_TABLE() 28}; 29 30class MyTextWindow: public wxTextCtrl 31{ 32public: 33 wxView *view; 34 35 MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style); 36}; 37 38class DrawingView: public wxView 39{ 40public: 41 wxMDIChildFrame *frame; 42 MyCanvas *canvas; 43 44 DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxMDIChildFrame *) NULL; } 45 ~DrawingView() {} 46 47 bool OnCreate(wxDocument *doc, long flags); 48 void OnDraw(wxDC *dc); 49 void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL); 50 bool OnClose(bool deleteWindow = true); 51 52 void OnCut(wxCommandEvent& event); 53 54private: 55 DECLARE_DYNAMIC_CLASS(DrawingView) 56 DECLARE_EVENT_TABLE() 57}; 58 59class TextEditView: public wxView 60{ 61public: 62 wxMDIChildFrame *frame; 63 MyTextWindow *textsw; 64 65 TextEditView(): wxView() { frame = (wxMDIChildFrame *) NULL; textsw = (MyTextWindow *) NULL; } 66 ~TextEditView() {} 67 68 bool OnCreate(wxDocument *doc, long flags); 69 void OnDraw(wxDC *dc); 70 void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL); 71 bool OnClose(bool deleteWindow = true); 72 73private: 74 DECLARE_DYNAMIC_CLASS(TextEditView) 75}; 76 77#endif 78