]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
MSVC 5 does not have BIF_EDITBOX.
[wxWidgets.git] / src / mgl / window.cpp
index 28e827dcc43226465889e87cac2d5201483cc435..562756b248f585c1afd6ded9a8f80e2ade192560 100644 (file)
@@ -129,7 +129,8 @@ static void wxCaptureScreenshot(bool activeWindowOnly)
     g_displayDC->savePNGFromDC(screenshot.mb_str(), 
                                r.x, r. y, r.x+r.width, r.y+r.height);
     
-    wxMessageBox(_("Screenshot captured: ") + wxString(screenshot));
+    wxMessageBox(wxString::Format(_T("Screenshot captured: %s"),
+                                  screenshot.c_str()));
 }
 
 // ---------------------------------------------------------------------------
@@ -434,20 +435,13 @@ static bool wxHandleSpecialKeys(wxKeyEvent& event)
     #ifdef __WXDEBUG__ // FIXME_MGL - remove when KB_sysReq works in MGL!
          || (event.m_keyCode == WXK_F1 && 
             event.m_shiftDown && event.m_controlDown) 
-       )
     #endif
+       )
     {
         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;
 }
 
@@ -550,7 +544,7 @@ void wxWindowMGL::Init()
     if ( !g_winMng )
     {
         if ( !wxTheApp->SetDisplayMode(wxGetDefaultDisplayMode()) )
-            wxFatalError(_("Cannot initialize display."));
+            wxLogFatalError(_("Cannot initialize display."));
     }
 
     // generic:
@@ -576,12 +570,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();
         }
     }
     
@@ -767,11 +766,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;
         }
     }
 
@@ -801,7 +809,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;
@@ -830,7 +838,19 @@ bool wxWindowMGL::SetCursor(const wxCursor& cursor)
 
 void wxWindowMGL::WarpPointer(int x, int y)
 {
+    int w, h;
+    wxDisplaySize(&w, &h);
+
     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);
 }