Don't set focus to generic wxDataViewCtrl on any button press.

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
This commit is contained in:
Vadim Zeitlin
2012-10-07 22:39:43 +00:00
parent 3ee9771b36
commit 6ceda4f536

View 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();