]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
fixed wxFrame::SetClientSize() with toolbar bug
[wxWidgets.git] / src / msw / window.cpp
index 184d7da24b96da2eece9c6c087d35d04126f95c0..02d6431d796c73d5b037861a39fb4c6dda9d7c1f 100644 (file)
@@ -288,6 +288,18 @@ wxWindow::~wxWindow()
     m_isBeingDeleted = TRUE;
 
     MSWDetachWindowMenu();
+    
+    // VS: make sure there's no wxFrame with last focus set to us:
+    for (wxWindow *win = GetParent(); win; win = win->GetParent())
+    {
+        wxFrame *frame = wxDynamicCast(win, wxFrame);
+        if ( frame )
+        {
+            if ( frame->GetLastFocus() == this )
+                frame->SetLastFocus((wxWindow*)NULL);
+            break;
+        }
+    }
 
     if ( m_parent )
         m_parent->RemoveChild(this);