]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix DnD in generic wxDataViewCtrl when scrolled.
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 6 Aug 2010 16:28:46 +0000 (16:28 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 6 Aug 2010 16:28:46 +0000 (16:28 +0000)
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

index 8f53d7663dde172426493f3dfed933f6b92b1c83..c43f842d5fb0f9b41107bc95247ee310d75c1c49 100644 (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 );