]>
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
);
33 class MyTextWindow
: public wxTextCtrl
38 MyTextWindow(wxView
*v
, wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, long style
);
41 class DrawingView
: public wxView
43 DECLARE_DYNAMIC_CLASS(DrawingView
)
49 DrawingView(void) { canvas
= (MyCanvas
*) NULL
; frame
= (wxFrame
*) NULL
; };
50 ~DrawingView(void) {};
52 bool OnCreate(wxDocument
*doc
, long flags
);
53 void OnDraw(wxDC
*dc
);
54 void OnUpdate(wxView
*sender
, wxObject
*hint
= (wxObject
*) NULL
);
55 bool OnClose(bool deleteWindow
= TRUE
);
57 void OnCut(wxCommandEvent
& event
);
62 class TextEditView
: public wxView
64 DECLARE_DYNAMIC_CLASS(TextEditView
)
70 TextEditView(wxDocument
*doc
= (wxDocument
*) NULL
): wxView(doc
) { frame
= (wxFrame
*) NULL
; textsw
= (MyTextWindow
*) NULL
; }
71 ~TextEditView(void) {}
73 bool OnCreate(wxDocument
*doc
, long flags
);
74 void OnDraw(wxDC
*dc
);
75 void OnUpdate(wxView
*sender
, wxObject
*hint
= (wxObject
*) NULL
);
76 bool OnClose(bool deleteWindow
= TRUE
);