Move check for mouse button down events in wxDataViewMainWindow

No real changes, just prepare for the next commit.
This commit is contained in:
Vadim Zeitlin
2018-12-06 20:48:32 +01:00
parent e1a702a205
commit 2d18aaf58a

View File

@@ -4525,14 +4525,6 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
return;
}
if(event.ButtonDown())
{
// Not skipping button down events would prevent the system from
// setting focus to this window as most (all?) of them do by default,
// so skip it to enable default handling.
event.Skip();
}
int x = event.GetX();
int y = event.GetY();
m_owner->CalcUnscrolledPosition( x, y, &x, &y );
@@ -4560,6 +4552,14 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
const unsigned int current = GetLineAt( y );
const wxDataViewItem item = GetItemByRow(current);
if(event.ButtonDown())
{
// Not skipping button down events would prevent the system from
// setting focus to this window as most (all?) of them do by default,
// so skip it to enable default handling.
event.Skip();
}
// Handle right clicking here, before everything else as context menu
// events should be sent even when we click outside of any item, unlike all
// the other ones.