]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Add missing samples to samples.dsw.
[wxWidgets.git] / src / common / docview.cpp
index 64315afb6086bbeae868c9b5741ebd4f453e8eb0..03d455b528294f84b127986d1f948c1ca753aab0 100644 (file)
@@ -135,8 +135,6 @@ bool wxDocument::DeleteContents()
 
 wxDocument::~wxDocument()
 {
-    DeleteContents();
-
     delete m_commandProcessor;
 
     if (GetDocumentManager())
@@ -689,7 +687,7 @@ void wxView::SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame)
 bool wxView::TryBefore(wxEvent& event)
 {
     wxDocument * const doc = GetDocument();
-    return doc && doc->ProcessEventHere(event);
+    return doc && doc->ProcessEventLocally(event);
 }
 
 void wxView::OnActivateView(bool WXUNUSED(activate),
@@ -1252,7 +1250,7 @@ wxView *wxDocManager::GetActiveView() const
 bool wxDocManager::TryBefore(wxEvent& event)
 {
     wxView * const view = GetActiveView();
-    return view && view->ProcessEventHere(event);
+    return view && view->ProcessEventLocally(event);
 }
 
 namespace
@@ -1889,54 +1887,11 @@ bool wxDocChildFrameAnyBase::CloseView(wxCloseEvent& event)
 }
 
 // ----------------------------------------------------------------------------
-// Default parent frame
+// wxDocParentFrameAnyBase
 // ----------------------------------------------------------------------------
 
-BEGIN_EVENT_TABLE(wxDocParentFrame, wxFrame)
-    EVT_MENU(wxID_EXIT, wxDocParentFrame::OnExit)
-    EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, wxDocParentFrame::OnMRUFile)
-    EVT_CLOSE(wxDocParentFrame::OnCloseWindow)
-END_EVENT_TABLE()
-
-wxDocParentFrame::wxDocParentFrame()
-{
-    m_docManager = NULL;
-}
-
-wxDocParentFrame::wxDocParentFrame(wxDocManager *manager,
-                                   wxFrame *frame,
-                                   wxWindowID id,
-                                   const wxString& title,
-                                   const wxPoint& pos,
-                                   const wxSize& size,
-                                   long style,
-                                   const wxString& name)
-                : wxFrame(frame, id, title, pos, size, style, name)
+void wxDocParentFrameAnyBase::DoOpenMRUFile(unsigned n)
 {
-    m_docManager = manager;
-}
-
-bool wxDocParentFrame::Create(wxDocManager *manager,
-                              wxFrame *frame,
-                              wxWindowID id,
-                              const wxString& title,
-                              const wxPoint& pos,
-                              const wxSize& size,
-                              long style,
-                              const wxString& name)
-{
-    m_docManager = manager;
-    return base_type::Create(frame, id, title, pos, size, style, name);
-}
-
-void wxDocParentFrame::OnExit(wxCommandEvent& WXUNUSED(event))
-{
-    Close();
-}
-
-void wxDocParentFrame::OnMRUFile(wxCommandEvent& event)
-{
-    int n = event.GetId() - wxID_FILE1;  // the index in MRU list
     wxString filename(m_docManager->GetHistoryFile(n));
     if ( filename.empty() )
         return;
@@ -1967,27 +1922,6 @@ void wxDocParentFrame::OnMRUFile(wxCommandEvent& event)
                filename);
 }
 
-// Extend event processing to search the view's event table
-bool wxDocParentFrame::TryBefore(wxEvent& event)
-{
-    if ( m_docManager && m_docManager->ProcessEventHere(event) )
-        return true;
-
-    return wxFrame::TryBefore(event);
-}
-
-// Define the behaviour for the frame closing
-// - must delete all frames except for the main one.
-void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
-{
-    if (m_docManager->Clear(!event.CanVeto()))
-    {
-        Destroy();
-    }
-    else
-        event.Veto();
-}
-
 #if wxUSE_PRINTING_ARCHITECTURE
 
 wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title)