]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docmdi.cpp
*** empty log message ***
[wxWidgets.git] / src / common / docmdi.cpp
index 114a3f4df70d2274c4cb3d5d194b8986cf655d69..4aba2cb48820e0f4809f18cae0356fc648a26aa7 100644 (file)
@@ -24,7 +24,7 @@
 #include "wx/defs.h"
 #endif
 
-#if USE_DOC_VIEW_ARCHITECTURE
+#if wxUSE_DOC_VIEW_ARCHITECTURE
 
 #ifndef WX_PRECOMP
 #include "wx/wx.h"
@@ -40,7 +40,7 @@ IMPLEMENT_CLASS(wxDocMDIParentFrame, wxMDIParentFrame)
 
 BEGIN_EVENT_TABLE(wxDocMDIParentFrame, wxMDIParentFrame)
     EVT_MENU(wxID_EXIT, wxDocMDIParentFrame::OnExit)
-    EVT_MENU_RANGE(wxID_FILE1, wxID_FILE2, wxDocMDIParentFrame::OnMRUFile)
+    EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, wxDocMDIParentFrame::OnMRUFile)
 END_EVENT_TABLE()
 
 wxDocMDIParentFrame::wxDocMDIParentFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title,
@@ -102,14 +102,12 @@ wxDocMDIChildFrame::wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParen
 
 wxDocMDIChildFrame::~wxDocMDIChildFrame(void)
 {
+       m_childView = (wxView *) NULL;
 }
 
 // Extend event processing to search the view's event table
 bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event)
 {
-    if (m_childView)
-        m_childView->Activate(TRUE);
-
        if ( !m_childView || ! m_childView->ProcessEvent(event) )
     {
         // Only hand up to the parent if it's a menu command
@@ -126,7 +124,7 @@ void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event)
 {
   wxMDIChildFrame::OnActivate(event);
 
-  if (m_childView)
+  if (event.GetActive() && m_childView)
     m_childView->Activate(event.GetActive());
 }
 
@@ -141,8 +139,8 @@ bool wxDocMDIChildFrame::OnClose(void)
     {
       m_childView->Activate(FALSE);
       delete m_childView;
-      m_childView = NULL;
-      m_childDocument = NULL;
+      m_childView = (wxView *) NULL;
+      m_childDocument = (wxDocument *) NULL;
     }
     
     return ans;
@@ -151,5 +149,5 @@ bool wxDocMDIChildFrame::OnClose(void)
 }
 
 #endif
-    // USE_DOC_VIEW_ARCHITECTURE
+    // wxUSE_DOC_VIEW_ARCHITECTURE