- 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:
+ TextEditView() : wxView() { m_frame = NULL; 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(); }
+
+ wxFrame *m_frame;
+ wxTextCtrl *m_text;
+
+ DECLARE_EVENT_TABLE()
+ DECLARE_DYNAMIC_CLASS(TextEditView)