From aecf930c5e84287e55ec4234afbe8c97ca41e261 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 6 Aug 2010 16:28:46 +0000 Subject: [PATCH] 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 --- src/generic/datavgen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 8f53d7663d..c43f842d5f 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -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 ); -- 2.50.0