From: Robert Roebling Date: Sat, 23 Oct 2010 14:00:15 +0000 (+0000) Subject: Set focus to generic wxDataViewCtrl when clicking with any mouse button, not just... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3d9bff2f13c7fe6a61b99de92c8283dcbb59b147 Set focus to generic wxDataViewCtrl when clicking with any mouse button, not just left, closes #12586: wxDataviewCtrl only gets focused on left mouse git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 63a7ed68cf..874a32f2d1 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3442,6 +3442,10 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) return; } + // set the focus to ourself if any of the mouse buttons are pressed + if(event.ButtonDown() && !HasFocus()) + SetFocus(); + int x = event.GetX(); int y = event.GetY(); m_owner->CalcUnscrolledPosition( x, y, &x, &y ); @@ -3711,8 +3715,6 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) } else if ((event.LeftDown() || simulateClick) && !hoverOverExpander) { - SetFocus(); - m_lineBeforeLastClicked = m_lineLastClicked; m_lineLastClicked = current;