git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53062
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView)
IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView)
+BEGIN_EVENT_TABLE(TextEditView, wxView)
+ EVT_MENU(wxID_COPY, TextEditView::OnCopy)
+ EVT_MENU(wxID_PASTE, TextEditView::OnPaste)
+ EVT_MENU(wxID_SELECTALL, TextEditView::OnSelectAll)
+END_EVENT_TABLE()
+
bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
m_frame = wxGetApp().CreateChildFrame(doc, this, false);
bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
m_frame = wxGetApp().CreateChildFrame(doc, this, false);
-bool TextEditView::ProcessEvent(wxEvent& event)
-{
- bool processed = false;
- if (!processed) switch (event.GetId())
- {
- case wxID_COPY:
- case wxID_PASTE:
- case wxID_SELECTALL:
- processed = m_textsw->ProcessEvent(event);
- break;
- }
- if (!processed) processed = wxView::ProcessEvent(event);
- return processed;
-}
-
/*
* Window implementations
*/
/*
* Window implementations
*/
virtual void OnDraw(wxDC *dc);
virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
virtual bool OnClose(bool deleteWindow = true);
virtual void OnDraw(wxDC *dc);
virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
virtual bool OnClose(bool deleteWindow = true);
- virtual bool ProcessEvent(wxEvent&);
+ 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)
};
DECLARE_DYNAMIC_CLASS(TextEditView)
};
IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView)
IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView)
+BEGIN_EVENT_TABLE(TextEditView, wxView)
+ EVT_MENU(wxID_COPY, TextEditView::OnCopy)
+ EVT_MENU(wxID_PASTE, TextEditView::OnPaste)
+ EVT_MENU(wxID_SELECTALL, TextEditView::OnSelectAll)
+END_EVENT_TABLE()
+
bool TextEditView::OnCreate(wxDocument* doc, long WXUNUSED(flags) )
{
m_frame = wxGetApp().CreateChildFrame(doc, this, false);
bool TextEditView::OnCreate(wxDocument* doc, long WXUNUSED(flags) )
{
m_frame = wxGetApp().CreateChildFrame(doc, this, false);
class TextEditView: public wxView
{
class TextEditView: public wxView
{
- DECLARE_DYNAMIC_CLASS(TextEditView)
public:
wxMDIChildFrame* m_frame;
MyTextWindow* m_textsw;
public:
wxMDIChildFrame* m_frame;
MyTextWindow* m_textsw;
virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
virtual bool OnClose(bool deleteWindow = true);
virtual bool ProcessEvent(wxEvent&);
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)