]>
git.saurik.com Git - wxWidgets.git/blob - samples/docview/view.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: View classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __VIEWSAMPLEH__
13 #define __VIEWSAMPLEH__
15 #include "wx/docview.h"
17 class MyCanvas
: public wxScrolledWindow
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
);
29 class MyTextWindow
: public wxTextCtrl
34 MyTextWindow(wxView
*v
, wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, const long style
);
37 class DrawingView
: public wxView
39 DECLARE_DYNAMIC_CLASS(DrawingView
)
45 DrawingView(void) { canvas
= (MyCanvas
*) NULL
; frame
= (wxFrame
*) NULL
; };
46 ~DrawingView(void) {};
48 bool OnCreate(wxDocument
*doc
, long flags
);
49 void OnDraw(wxDC
*dc
);
50 void OnUpdate(wxView
*sender
, wxObject
*hint
= (wxObject
*) NULL
);
51 bool OnClose(bool deleteWindow
= true);
53 void OnCut(wxCommandEvent
& event
);
58 class TextEditView
: public wxView
60 DECLARE_DYNAMIC_CLASS(TextEditView
)
66 TextEditView(): wxView() { frame
= (wxFrame
*) NULL
; textsw
= (MyTextWindow
*) NULL
; }
67 ~TextEditView(void) {}
69 bool OnCreate(wxDocument
*doc
, long flags
);
70 void OnDraw(wxDC
*dc
);
71 void OnUpdate(wxView
*sender
, wxObject
*hint
= (wxObject
*) NULL
);
72 bool OnClose(bool deleteWindow
= true);