From 3d9bff2f13c7fe6a61b99de92c8283dcbb59b147 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 23 Oct 2010 14:00:15 +0000 Subject: [PATCH] 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 --- src/generic/datavgen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.47.2