]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
Minor header cleaning.
[wxWidgets.git] / src / mgl / window.cpp
index d4fc3b24e520c362101ecfc4cf49a9256533a88c..70a9ffaf6431198e81ef573bff178f34d7e1e866 100644 (file)
@@ -73,6 +73,8 @@ static wxWindowMGL *gs_mouseCapture = NULL;
 // the frame that is currently active (i.e. its child has focus). It is
 // used to generate wxActivateEvents
 static wxWindowMGL *gs_activeFrame = NULL;
+// track the mouse button state for wxGetMouseState()
+unsigned long g_buttonState = 0;
 
 // ---------------------------------------------------------------------------
 // constants
@@ -151,6 +153,8 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
     wxPoint orig(win->GetClientAreaOrigin());
     wxPoint where;
 
+    g_buttonState = e->modifiers;
+
     MGL_wmCoordGlobalToLocal(win->GetHandle(),
                              e->where_x, e->where_y, &where.x, &where.y);
 
@@ -700,6 +704,11 @@ void wxWindowMGL::SetFocus()
         gs_activeFrame->GetEventHandler()->ProcessEvent(event);
     }
 
+    // notify the parent keeping track of focus for the kbd navigation
+    // purposes that we got it
+    wxChildFocusEvent eventFocus((wxWindow*)this);
+    GetEventHandler()->ProcessEvent(eventFocus);
+
     wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
     event.SetEventObject(this);
     event.SetWindow((wxWindow*)oldFocusedWindow);
@@ -1153,7 +1162,7 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
     {
         dc->setColorRGB(255,0,255);
         dc->fillRect(-1000,-1000,2000,2000);
-        wxUsleep(50);
+        wxMilliSleep(50);
     }
 #endif