+ event.Enable( TRUE );
+}
+
+void wxDocManager::OnUpdateFileClose(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ event.Enable( (doc != (wxDocument*) NULL) );
+}
+
+void wxDocManager::OnUpdateFileRevert(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ event.Enable( (doc != (wxDocument*) NULL) );
+}
+
+void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
+{
+ event.Enable( TRUE );
+}
+
+void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ event.Enable( doc && doc->IsModified() );
+}
+
+void wxDocManager::OnUpdateFileSaveAs(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ event.Enable( (doc != (wxDocument*) NULL) );
+}
+
+void wxDocManager::OnUpdateUndo(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ if (!doc)
+ event.Enable(FALSE);
+ else if (!doc->GetCommandProcessor())
+ event.Skip();
+ else
+ {
+ event.Enable( doc->GetCommandProcessor()->CanUndo() );
+ doc->GetCommandProcessor()->SetMenuStrings();
+ }
+}
+
+void wxDocManager::OnUpdateRedo(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ if (!doc)
+ event.Enable(FALSE);
+ else if (!doc->GetCommandProcessor())
+ event.Skip();
+ else
+ {
+ event.Enable( doc->GetCommandProcessor()->CanRedo() );
+ doc->GetCommandProcessor()->SetMenuStrings();
+ }
+}
+
+void wxDocManager::OnUpdatePrint(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ event.Enable( (doc != (wxDocument*) NULL) );
+}
+
+void wxDocManager::OnUpdatePrintSetup(wxUpdateUIEvent& event)
+{
+ event.Enable( TRUE );
+}
+
+void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event)
+{
+ wxDocument *doc = GetCurrentDocument();
+ event.Enable( (doc != (wxDocument*) NULL) );
+}
+
+wxView *wxDocManager::GetCurrentView() const
+{
+ if (m_currentView)
+ return m_currentView;
+ if (m_docs.GetCount() == 1)
+ {
+ wxDocument* doc = (wxDocument*) m_docs.GetFirst()->GetData();
+ return doc->GetFirstView();