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:
@@ -107,6 +107,7 @@ All (GUI):
|
|||||||
- Add wxEVT_STC_AUTOCOMP_COMPLETED event (NewPagodi).
|
- Add wxEVT_STC_AUTOCOMP_COMPLETED event (NewPagodi).
|
||||||
- Fix retrieving bounding box for wxDC with transformed coordinates.
|
- Fix retrieving bounding box for wxDC with transformed coordinates.
|
||||||
- Fix wxGraphicsMatrixData::Concat() for Direct2D and Cairo renderers.
|
- Fix wxGraphicsMatrixData::Concat() for Direct2D and Cairo renderers.
|
||||||
|
- Fix calculating point position in wxDataViewCtrl::HitTest().
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -1485,7 +1485,9 @@ public:
|
|||||||
bool HasSelection() const;
|
bool HasSelection() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Hittest.
|
Retrieves item and column at the given point.
|
||||||
|
The point coordinates are specified in wxDataViewCtrl client area
|
||||||
|
coordinates.
|
||||||
*/
|
*/
|
||||||
virtual void HitTest(const wxPoint& point, wxDataViewItem& item,
|
virtual void HitTest(const wxPoint& point, wxDataViewItem& item,
|
||||||
wxDataViewColumn*& col) const;
|
wxDataViewColumn*& col) const;
|
||||||
@@ -2398,7 +2400,6 @@ public:
|
|||||||
const wxDataViewItem & item,
|
const wxDataViewItem & item,
|
||||||
unsigned int col);
|
unsigned int col);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Override this to render the cell.
|
Override this to render the cell.
|
||||||
Before this is called, wxDataViewRenderer::SetValue was called
|
Before this is called, wxDataViewRenderer::SetValue was called
|
||||||
|
@@ -5340,7 +5340,10 @@ void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item, const wxDataVie
|
|||||||
void wxDataViewCtrl::HitTest( const wxPoint & point, wxDataViewItem & item,
|
void wxDataViewCtrl::HitTest( const wxPoint & point, wxDataViewItem & item,
|
||||||
wxDataViewColumn* &column ) const
|
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,
|
wxRect wxDataViewCtrl::GetItemRect( const wxDataViewItem & item,
|
||||||
|
Reference in New Issue
Block a user