Adjust point coordinates in wxDataViewCtrl::HitTest

Point coordinates passed from wxDataViewCtrl::HitTest() to wxDataViewMainWindow::HitTest()
should be converted from wxDataViewCtrl client coordinates to wxDataViewMainWindow client coordinates because they can different due to the presence of the header in wxDataViewCtrl client area.
This commit is contained in:
Artur Wieczorek
2016-10-04 23:20:06 +02:00
parent fb5f6c4720
commit 2ec1bad4d6
3 changed files with 9 additions and 4 deletions

View File

@@ -5340,7 +5340,10 @@ void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item, const wxDataVie
void wxDataViewCtrl::HitTest( const wxPoint & point, wxDataViewItem & item,
wxDataViewColumn* &column ) const
{
m_clientArea->HitTest(point, item, column);
// Convert from wxDataViewCtrl coordinates to wxDataViewMainWindow coordinates.
// (They can be different due to the presence of the header.).
const wxPoint clientPt = m_clientArea->ScreenToClient(ClientToScreen(point));
m_clientArea->HitTest(clientPt, item, column);
}
wxRect wxDataViewCtrl::GetItemRect( const wxDataViewItem & item,