]>
git.saurik.com Git - wxWidgets.git/blob - samples/docvwmdi/view.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: View classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #ifndef __VIEWSAMPLEH__
17 #define __VIEWSAMPLEH__
19 #include "wx/docview.h"
21 class MyCanvas
: public wxScrolledWindow
26 MyCanvas(wxView
*v
, wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, long style
);
27 virtual void OnDraw(wxDC
& dc
);
28 void OnMouseEvent(wxMouseEvent
& event
);
34 class MyTextWindow
: public wxTextCtrl
39 MyTextWindow(wxView
*v
, wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, long style
);
42 class DrawingView
: public wxView
48 DrawingView() { canvas
= (MyCanvas
*) NULL
; frame
= (wxFrame
*) NULL
; }
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
);
56 void OnCut(wxCommandEvent
& event
);
59 DECLARE_DYNAMIC_CLASS(DrawingView
)
63 class TextEditView
: public wxView
69 TextEditView(): wxView() { frame
= (wxFrame
*) NULL
; textsw
= (MyTextWindow
*) NULL
; }
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
);
78 DECLARE_DYNAMIC_CLASS(TextEditView
)