]>
Commit | Line | Data |
---|---|---|
2108f33a JS |
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$ | |
6aa89a22 | 8 | // Copyright: (c) Julian Smart |
2f6c54eb | 9 | // Licence: wxWindows license |
2108f33a JS |
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 | { | |
354aa1e3 | 23 | public: |
2108f33a JS |
24 | wxView *view; |
25 | ||
b9f933ab | 26 | MyCanvas(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style); |
2108f33a JS |
27 | virtual void OnDraw(wxDC& dc); |
28 | void OnMouseEvent(wxMouseEvent& event); | |
29 | ||
354aa1e3 RR |
30 | private: |
31 | DECLARE_EVENT_TABLE() | |
2108f33a JS |
32 | }; |
33 | ||
34 | class MyTextWindow: public wxTextCtrl | |
35 | { | |
354aa1e3 | 36 | public: |
2108f33a JS |
37 | wxView *view; |
38 | ||
b9f933ab | 39 | MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style); |
2108f33a JS |
40 | }; |
41 | ||
42 | class DrawingView: public wxView | |
43 | { | |
354aa1e3 | 44 | public: |
b9f933ab | 45 | wxMDIChildFrame *frame; |
354aa1e3 | 46 | MyCanvas *canvas; |
2108f33a | 47 | |
b9f933ab | 48 | DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxMDIChildFrame *) NULL; } |
354aa1e3 | 49 | ~DrawingView() {} |
2108f33a | 50 | |
354aa1e3 RR |
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); | |
2108f33a | 55 | |
354aa1e3 | 56 | void OnCut(wxCommandEvent& event); |
2108f33a | 57 | |
354aa1e3 RR |
58 | private: |
59 | DECLARE_DYNAMIC_CLASS(DrawingView) | |
60 | DECLARE_EVENT_TABLE() | |
2108f33a JS |
61 | }; |
62 | ||
63 | class TextEditView: public wxView | |
64 | { | |
354aa1e3 | 65 | public: |
b9f933ab | 66 | wxMDIChildFrame *frame; |
354aa1e3 | 67 | MyTextWindow *textsw; |
2108f33a | 68 | |
b9f933ab | 69 | TextEditView(): wxView() { frame = (wxMDIChildFrame *) NULL; textsw = (MyTextWindow *) NULL; } |
354aa1e3 | 70 | ~TextEditView() {} |
2108f33a | 71 | |
354aa1e3 RR |
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) | |
2108f33a JS |
79 | }; |
80 | ||
81 | #endif |