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