]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
Allow translated 'Space' in menu accelerators (perhaps more entries should allow...
[wxWidgets.git] / src / mgl / window.cpp
index 0b3e3eaf3b91660a8cdcb5a1190179801f545659..3d526a5c9976f7fcd7912db8b48470924205e0f9 100644 (file)
 // headers
 // ---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "window.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -37,7 +33,6 @@
     #include "wx/utils.h"
     #include "wx/app.h"
     #include "wx/panel.h"
-    #include "wx/caret.h"
 #endif
 
 #if wxUSE_DRAG_AND_DROP
@@ -49,6 +44,7 @@
 #include "wx/mgl/private.h"
 #include "wx/intl.h"
 #include "wx/dcscreen.h"
+#include "wx/caret.h"
 
 #include <mgraph.hpp>
 
@@ -534,7 +530,7 @@ END_EVENT_TABLE()
 // constructors and such
 // ----------------------------------------------------------------------------
 
-extern wxDisplayModeInfo wxGetDefaultDisplayMode();
+extern wxVideoMode wxGetDefaultDisplayMode();
 
 void wxWindowMGL::Init()
 {
@@ -742,7 +738,7 @@ void wxWindowMGL::KillFocus()
 // this wxWindowBase function is implemented here (in platform-specific file)
 // because it is static and so couldn't be made virtual
 // ----------------------------------------------------------------------------
-wxWindow *wxWindowBase::FindFocus()
+wxWindow *wxWindowBase::DoFindFocus()
 {
     return (wxWindow*)gs_focusedWindow;
 }
@@ -939,7 +935,33 @@ void wxWindowMGL::DoGetClientSize(int *x, int *y) const
 
 void wxWindowMGL::DoMoveWindow(int x, int y, int width, int height)
 {
-    MGL_wmSetWindowPosition(GetHandle(), x, y, width, height);
+    wxRect rcClient(GetClientRect());
+
+    MGL_wmSetWindowPosition(m_wnd, x, y, width, height);
+
+    // When the origin or a window stays fixed but the height or width
+    // changes, invalidate the old and new non-client areas
+    if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) &&
+         m_wnd->x == x && m_wnd->y == y &&
+         rcClient.Intersect(GetClientRect()) != wxRect(0, 0, width, height) )
+    {
+        wxRegion rgn(0, 0, width, height);
+        rgn.Subtract(rcClient);
+
+        // This should work I think, but doesn't seem to:
+        //MGL_wmInvalidateWindowRegion(m_wnd, rgn.GetMGLRegion().rgnPointer());
+
+        // Use MGL_wmInvalidateWindowRect instead:
+        for (wxRegionIterator it(rgn); it; it++)
+        {
+            rect_t rc;
+            rc.left = it.GetX();
+            rc.top = it.GetY();
+            rc.right = rc.left + it.GetW();
+            rc.bottom = rc.top + it.GetH();
+            MGL_wmInvalidateWindowRect(m_wnd, &rc);
+        }
+    }
 }
 
 // set the size of the window: if the dimensions are positive, just use them,