]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mdi.cpp
don't just drop click events resulting from triple clicks
[wxWidgets.git] / src / msw / mdi.cpp
index 2a7c8f717a4864a17019a3dc0c4de14df390404c..edb246d7500aaf3e647d0d2f0362cd17d9a84fdb 100644 (file)
@@ -233,12 +233,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
 
 wxMDIParentFrame::~wxMDIParentFrame()
 {
-    DestroyChildren();
-
-    // already delete by DestroyChildren()
+    // see comment in ~wxMDIChildFrame
     m_frameToolBar = NULL;
     m_frameStatusBar = NULL;
 
+    DestroyChildren();
+
     if (m_windowMenu)
     {
         delete m_windowMenu;
@@ -671,9 +671,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
   MDICREATESTRUCT mcs;
 
-  mcs.szClass = style & wxNO_FULL_REPAINT_ON_RESIZE
-                    ? wxMDIChildFrameClassNameNoRedraw
-                    : wxMDIChildFrameClassName;
+  mcs.szClass = style & wxFULL_REPAINT_ON_RESIZE
+                    ? wxMDIChildFrameClassName
+                    : wxMDIChildFrameClassNameNoRedraw;
   mcs.szTitle = title;
   mcs.hOwner = wxGetInstance();
   if (x > -1)
@@ -696,7 +696,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
   else
       mcs.cy = CW_USEDEFAULT;
 
-  DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_THICKFRAME | WS_VISIBLE ;
+  DWORD msflags = WS_OVERLAPPED | WS_CLIPCHILDREN | WS_VISIBLE ;
   if (style & wxMINIMIZE_BOX)
     msflags |= WS_MINIMIZEBOX;
   if (style & wxMAXIMIZE_BOX)
@@ -730,12 +730,13 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
 wxMDIChildFrame::~wxMDIChildFrame()
 {
-    DestroyChildren();
-
-    // already deleted by DestroyChildren()
+    // will be destroyed by DestroyChildren() but reset them before calling it
+    // to avoid using dangling pointers if a callback comes in the meanwhile
     m_frameToolBar = NULL;
     m_frameStatusBar = NULL;
 
+    DestroyChildren();
+
     RemoveWindowMenu(NULL, m_hMenu);
 
     MSWDestroyWindow();
@@ -1064,7 +1065,7 @@ bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo)
         processed = true;
     }
 
-    return true;
+    return processed;
 }
 
 // ---------------------------------------------------------------------------