Fix DnD in generic wxDataViewCtrl when scrolled.

wxDataViewMainWindow drag and drop code incorrectly used Y coordinate
where X axis should be used to check whether the mouse is inside columns
area. This manifested itself as refusing to accept drops once the
control was sufficiently scrolled down.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-08-06 16:28:46 +00:00
parent 926649a996
commit aecf930c5e

View File

@@ -1378,7 +1378,7 @@ wxDragResult wxDataViewMainWindow::OnDragOver( wxDataFormat format, wxCoord x,
m_owner->CalcUnscrolledPosition( xx, yy, &xx, &yy );
unsigned int row = GetLineAt( yy );
if ((row >= GetRowCount()) || (yy > GetEndOfLastCol()))
if ((row >= GetRowCount()) || (xx > GetEndOfLastCol()))
{
RemoveDropHint();
return wxDragNone;
@@ -1424,7 +1424,7 @@ bool wxDataViewMainWindow::OnDrop( wxDataFormat format, wxCoord x, wxCoord y )
m_owner->CalcUnscrolledPosition( xx, yy, &xx, &yy );
unsigned int row = GetLineAt( yy );
if ((row >= GetRowCount()) || (yy > GetEndOfLastCol()))
if ((row >= GetRowCount()) || (xx > GetEndOfLastCol()))
return false;
wxDataViewItem item = GetItemByRow( row );
@@ -1453,7 +1453,7 @@ wxDragResult wxDataViewMainWindow::OnData( wxDataFormat format, wxCoord x, wxCoo
m_owner->CalcUnscrolledPosition( xx, yy, &xx, &yy );
unsigned int row = GetLineAt( yy );
if ((row >= GetRowCount()) || (yy > GetEndOfLastCol()))
if ((row >= GetRowCount()) || (xx > GetEndOfLastCol()))
return wxDragNone;
wxDataViewItem item = GetItemByRow( row );