]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Fix for GetValue
[wxWidgets.git] / src / common / docview.cpp
index c368a8ee522ce5b1a8c6f9226d818122ab010a97..c0b5b82c9da9ff119f2cd449effb5ea31f31ef3b 100644 (file)
@@ -164,6 +164,8 @@ bool wxDocument::Close()
 
 bool wxDocument::OnCloseDocument()
 {
+    // Tell all views that we're about to close
+    NotifyClosing();    
     DeleteContents();
     Modify(FALSE);
     return TRUE;
@@ -508,6 +510,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;