]>
git.saurik.com Git - wxWidgets.git/blob - samples/docvwmdi/view.h
8ac7c98ca9bccdd425151e48fb84e159dc4ac628
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: View classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/docview.h"
18 class MyCanvas
: public wxScrolledWindow
23 MyCanvas(DrawingView
*, wxMDIChildFrame
*, const wxPoint
&, const wxSize
&, long style
);
24 virtual void OnDraw(wxDC
&);
26 void OnMouseEvent(wxMouseEvent
&);
30 class MyTextWindow
: public wxTextCtrl
35 MyTextWindow(wxView
*, wxMDIChildFrame
*, const wxPoint
&, const wxSize
&, long style
);
38 class DrawingDocument
;
39 class DrawingView
: public wxView
41 DECLARE_DYNAMIC_CLASS(DrawingView
)
43 wxMDIChildFrame
* m_frame
;
46 DrawingView() { m_canvas
= NULL
; m_frame
= NULL
; }
47 virtual ~DrawingView() {}
49 virtual bool OnCreate(wxDocument
*doc
, long flags
);
50 virtual void OnDraw(wxDC
*dc
);
51 virtual void OnUpdate(wxView
*sender
, wxObject
*hint
= NULL
);
52 virtual bool OnClose(bool deleteWindow
= true);
54 DrawingDocument
* GetDocument();
57 void OnCut(wxCommandEvent
& event
);
61 class TextEditView
: public wxView
64 wxMDIChildFrame
* m_frame
;
65 MyTextWindow
* m_textsw
;
67 TextEditView() : wxView() { m_frame
= NULL
; m_textsw
= NULL
; }
68 virtual ~TextEditView() {}
70 virtual bool OnCreate(wxDocument
*, long flags
);
71 virtual void OnDraw(wxDC
* dc
);
72 virtual void OnUpdate(wxView
*sender
, wxObject
*hint
= NULL
);
73 virtual bool OnClose(bool deleteWindow
= true);
74 virtual bool ProcessEvent(wxEvent
&);
77 void OnCopy(wxCommandEvent
& WXUNUSED(event
)) { m_textsw
->Copy(); }
78 void OnPaste(wxCommandEvent
& WXUNUSED(event
)) { m_textsw
->Paste(); }
79 void OnSelectAll(wxCommandEvent
& WXUNUSED(event
)) { m_textsw
->SelectAll(); }
82 DECLARE_DYNAMIC_CLASS(TextEditView
)