]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
added wxEXEC_NOHIDE flag, modified wxExecute() to take a combination of bit flags...
[wxWidgets.git] / src / mgl / window.cpp
index 28e827dcc43226465889e87cac2d5201483cc435..36baf4f2cba6114eddedaeeabd38926c94e45880 100644 (file)
@@ -440,14 +440,7 @@ static bool wxHandleSpecialKeys(wxKeyEvent& event)
         wxCaptureScreenshot(event.m_altDown/*only active wnd?*/);
         return TRUE;
     }
         wxCaptureScreenshot(event.m_altDown/*only active wnd?*/);
         return TRUE;
     }
-
-    if ( event.m_keyCode == WXK_F4 && event.m_altDown &&
-         gs_activeFrame != NULL )
-    {
-        gs_activeFrame->Close();
-        return TRUE;
-    }
-    
+   
     return FALSE;
 }
 
     return FALSE;
 }
 
@@ -576,12 +569,17 @@ wxWindowMGL::~wxWindowMGL()
 
     if (gs_activeFrame == this)
     {
 
     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();
         }
     }
     
         }
     }
     
@@ -767,11 +765,20 @@ bool wxWindowMGL::Show(bool show)
     
     if (!show && gs_activeFrame == this)
     {
     
     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;
         }
     }
 
         }
     }
 
@@ -830,7 +837,19 @@ bool wxWindowMGL::SetCursor(const wxCursor& cursor)
 
 void wxWindowMGL::WarpPointer(int x, int y)
 {
 
 void wxWindowMGL::WarpPointer(int x, int y)
 {
+    int w, h;
+    wxDisplaySize(&w, &h);
+
     ClientToScreen(&x, &y);
     ClientToScreen(&x, &y);
+    if ( x < 0 )
+        x = 0;
+    if ( y < 0 )
+        y = 0;
+    if ( x >= w )
+        x = w-1;
+    if ( y >= h )
+        y = h-1;
+    
     EVT_setMousePos(x, y);
 }
 
     EVT_setMousePos(x, y);
 }