]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
generate key events for Space/Enter in addition to the activate events, as wxMSW...
[wxWidgets.git] / src / common / docview.cpp
index c368a8ee522ce5b1a8c6f9226d818122ab010a97..78f6ea18ef1eafd77d21e567566098c5d57f0627 100644 (file)
@@ -40,6 +40,7 @@
     #include "wx/list.h"
     #include "wx/filedlg.h"
     #include "wx/intl.h"
     #include "wx/list.h"
     #include "wx/filedlg.h"
     #include "wx/intl.h"
+    #include "wx/log.h"
 #endif
 
 
 #endif
 
 
@@ -164,6 +165,8 @@ bool wxDocument::Close()
 
 bool wxDocument::OnCloseDocument()
 {
 
 bool wxDocument::OnCloseDocument()
 {
+    // Tell all views that we're about to close
+    NotifyClosing();    
     DeleteContents();
     Modify(FALSE);
     return TRUE;
     DeleteContents();
     Modify(FALSE);
     return TRUE;
@@ -508,6 +511,17 @@ void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
     }
 }
 
     }
 }
 
+void wxDocument::NotifyClosing()
+{
+    wxNode *node = m_documentViews.First();
+    while (node)
+    {
+        wxView *view = (wxView *)node->Data();
+        view->OnClosingDocument();
+        node = node->Next();
+    }
+}
+
 void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
 {
     m_documentFile = filename;
 void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
 {
     m_documentFile = filename;