]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
send destroy events for children before they're fully destroyed; document SendDestroy...
[wxWidgets.git] / src / common / docview.cpp
index b9eac572333fd83a0d4bcc23ab264b13f63db156..ac7af5109a16d62ab28b6fd2570d8d97b75143a9 100644 (file)
@@ -1070,7 +1070,9 @@ void wxDocManager::OnRedo(wxCommandEvent& event)
 
 void wxDocManager::OnUpdateFileOpen(wxUpdateUIEvent& event)
 {
 
 void wxDocManager::OnUpdateFileOpen(wxUpdateUIEvent& event)
 {
-    event.Enable( true );
+    // CreateDocument() (which is called from OnFileOpen) may succeed
+    // only when there is at least a template:
+    event.Enable( GetTemplates().GetCount()>0 );
 }
 
 void wxDocManager::OnUpdateDisableIfNoDoc(wxUpdateUIEvent& event)
 }
 
 void wxDocManager::OnUpdateDisableIfNoDoc(wxUpdateUIEvent& event)
@@ -1080,7 +1082,9 @@ void wxDocManager::OnUpdateDisableIfNoDoc(wxUpdateUIEvent& event)
 
 void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
 {
 
 void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
 {
-    event.Enable( true );
+    // CreateDocument() (which is called from OnFileNew) may succeed
+    // only when there is at least a template:
+    event.Enable( GetTemplates().GetCount()>0 );
 }
 
 void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
 }
 
 void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)