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