- DECLARE_DYNAMIC_CLASS(TextEditView)
- private:
- public:
- wxFrame *frame;
- MyTextWindow *textsw;
-
- TextEditView(wxDocument *doc = (wxDocument *) NULL): wxView(doc) { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
- ~TextEditView(void) {}
-
- bool OnCreate(wxDocument *doc, long flags);
- void OnDraw(wxDC *dc);
- void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
- bool OnClose(bool deleteWindow = TRUE);
+public:
+ wxMDIChildFrame* m_frame;
+ MyTextWindow* m_textsw;
+
+ TextEditView() : wxView() { m_frame = NULL; m_textsw = NULL; }
+ virtual ~TextEditView() {}
+
+ virtual bool OnCreate(wxDocument*, long flags);
+ virtual void OnDraw(wxDC* dc);
+ virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
+ virtual bool OnClose(bool deleteWindow = true);
+ virtual bool ProcessEvent(wxEvent&);
+
+private:
+ void OnCopy(wxCommandEvent& WXUNUSED(event)) { m_textsw->Copy(); }
+ void OnPaste(wxCommandEvent& WXUNUSED(event)) { m_textsw->Paste(); }
+ void OnSelectAll(wxCommandEvent& WXUNUSED(event)) { m_textsw->SelectAll(); }
+
+ DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(TextEditView)