]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
fixed more printf() warnings
[wxWidgets.git] / src / mgl / window.cpp
index f7423ea103a0e24a89e73abf83e7e8442ae58414..8044f63ced81bf0e32b82d29644e17718df6594f 100644 (file)
@@ -569,12 +569,17 @@ wxWindowMGL::~wxWindowMGL()
 
     if (gs_activeFrame == this)
     {
-       gs_activeFrame = NULL;
-       // activate next frame in Z-order:
-       if ( m_wnd->prev )
-       {
-           wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
-           win->SetFocus();
+        gs_activeFrame = NULL;
+        // activate next frame in Z-order:
+        if ( m_wnd->prev )
+        {
+            wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
+            win->SetFocus();
+        }
+        else if ( m_wnd->next )
+        {
+            wxWindowMGL *win = (wxWindowMGL*)m_wnd->next->userData;
+            win->SetFocus();
         }
     }
     
@@ -760,11 +765,20 @@ bool wxWindowMGL::Show(bool 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();
+        // activate next frame in Z-order:
+        if ( m_wnd->prev )
+        {
+            wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
+            win->SetFocus();
+        }
+        else if ( m_wnd->next )
+        {
+            wxWindowMGL *win = (wxWindowMGL*)m_wnd->next->userData;
+            win->SetFocus();
+        }
+        else
+        {
+            gs_activeFrame = NULL;
         }
     }
 
@@ -794,7 +808,7 @@ void wxWindowMGL::DoCaptureMouse()
 
 void wxWindowMGL::DoReleaseMouse()
 {
-    wxASSERT_MSG( gs_mouseCapture == this, wxT("attempt to release mouse, but this window hasn't captured it") )
+    wxASSERT_MSG( gs_mouseCapture == this, wxT("attempt to release mouse, but this window hasn't captured it") );
     
     MGL_wmUncaptureEvents(m_wnd, wxMGL_CAPTURE_MOUSE);
     gs_mouseCapture = NULL;