]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/docview/view.cpp
compilation fix for wxUniv/GTK (closes #9849)
[wxWidgets.git] / samples / docview / view.cpp
index d2a02dccdb24319ef7770dedb9f3cf6fcffc919d..6fbd4103b4554ff3aadd2130b333a59554098938 100644 (file)
@@ -156,6 +156,12 @@ void DrawingView::OnCut(wxCommandEvent& WXUNUSED(event) )
 
 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);
@@ -167,8 +173,8 @@ bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
 #ifdef __X__
     // X seems to require a forced resize
     int x, y;
-    frame->GetSize(&x, &y);
-    frame->SetSize(wxDefaultCoord, wxDefaultCoord, x, y);
+    m_frame->GetSize(&x, &y);
+    m_frame->SetSize(wxDefaultCoord, wxDefaultCoord, x, y);
 #endif
 
     m_frame->Show(true);
@@ -195,27 +201,11 @@ bool TextEditView::OnClose(bool deleteWindow)
 
     if (deleteWindow)
     {
-        wxDELETE(m_frame)
-        return true;
+        wxDELETE(m_frame);
     }
     return true;
 }
 
-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
 */