]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
mention wx[Flex]GridSizer too
[wxWidgets.git] / src / mgl / window.cpp
index 51610f63915d11a71090a32acb9d3d0357e9e07e..a76020c4ecbfc67f4392d0d5c1065e8ddad088d1 100644 (file)
@@ -532,10 +532,21 @@ wxWindowMGL::~wxWindowMGL()
 
     if ( gs_mouseCapture == this )
         ReleaseMouse();
+
     if (gs_activeFrame == this)
-        gs_activeFrame = NULL;
+    {
+       gs_activeFrame = NULL;
+       // activate next frame in Z-order:
+       if ( m_wnd->prev )
+       {
+           wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
+           win->SetFocus();
+        }
+    }
+    
     if ( gs_focusedWindow == this )
         KillFocus();
+
     if ( gs_windowUnderMouse == this )
         gs_windowUnderMouse = NULL;
 
@@ -692,6 +703,17 @@ bool wxWindowMGL::Show(bool show)
         return FALSE;
 
     MGL_wmShowWindow(m_wnd, show);
+    
+    if (!show && gs_activeFrame == this)
+    {
+       // activate next frame in Z-order:
+       if ( m_wnd->prev )
+       {
+           wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
+           win->SetFocus();
+        }
+    }
+
     return TRUE;
 }