]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't set focus to generic wxDataViewCtrl on any button press.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Oct 2012 22:39:43 +0000 (22:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Oct 2012 22:39:43 +0000 (22:39 +0000)
Only set focus if the left button was pressed for consistency with just about
everything else. Also, just skip the event instead of setting the focus
explicitly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datavgen.cpp

index 0317ea81445be9fb200a4b470cb46b81d48c4a22..c4a11e828cae52e13710e243f5f6a87162d3e4e5 100644 (file)
@@ -3939,9 +3939,12 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
         return;
     }
 
-    // set the focus to ourself if any of the mouse buttons are pressed
-    if(event.ButtonDown() && !HasFocus())
-        SetFocus();
+    if(event.LeftDown())
+    {
+        // Not skipping this event would prevent the system from setting focus
+        // to this window.
+        event.Skip();
+    }
 
     int x = event.GetX();
     int y = event.GetY();