- DECLARE_DYNAMIC_CLASS(DrawingView)
- private:
- public:
- wxFrame *frame;
- MyCanvas *canvas;
-
- DrawingView(void) { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; };
- ~DrawingView(void) {};
-
- bool OnCreate(wxDocument *doc, long flags);
- void OnDraw(wxDC *dc);
- void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
- bool OnClose(bool deleteWindow = TRUE);
-
- void OnCut(wxCommandEvent& event);
-
-DECLARE_EVENT_TABLE()
+public:
+ TextEditView() : wxView(), m_text(NULL) {}
+
+ virtual bool OnCreate(wxDocument *doc, long flags);
+ virtual void OnDraw(wxDC *dc);
+ virtual bool OnClose(bool deleteWindow = true);
+
+ wxTextCtrl *GetText() const { return m_text; }
+
+private:
+ void OnCopy(wxCommandEvent& WXUNUSED(event)) { m_text->Copy(); }
+ void OnPaste(wxCommandEvent& WXUNUSED(event)) { m_text->Paste(); }
+ void OnSelectAll(wxCommandEvent& WXUNUSED(event)) { m_text->SelectAll(); }
+
+ wxTextCtrl *m_text;
+
+ DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(TextEditView)
+};
+
+// ----------------------------------------------------------------------------
+// ImageCanvas
+// ----------------------------------------------------------------------------
+
+class ImageCanvas : public wxScrolledWindow
+{
+public:
+ ImageCanvas(wxView*);
+
+ virtual void OnDraw(wxDC& dc);
+private:
+ wxView *m_view;
+};
+
+// ----------------------------------------------------------------------------
+// ImageView
+// ----------------------------------------------------------------------------
+
+class ImageView : public wxView
+{
+public:
+ ImageView() : wxView() {}
+
+ virtual bool OnCreate(wxDocument*, long flags);
+ virtual void OnDraw(wxDC*);
+ virtual bool OnClose(bool deleteWindow = true);
+ virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
+
+ ImageDocument* GetDocument();
+
+private:
+ ImageCanvas* m_canvas;
+
+ DECLARE_DYNAMIC_CLASS(ImageView)