]> git.saurik.com Git - wxWidgets.git/commitdiff
HitTest() now works when the ctrl is scrolled too
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Apr 1999 14:58:17 +0000 (14:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Apr 1999 14:58:17 +0000 (14:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectrl.cpp

index 4602d32e8300527033b11c418814adb40db4305e..804148c710fcd255cbfcdfa035135520431ec485 100644 (file)
@@ -1444,8 +1444,13 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event )
 
 wxTreeItemId wxTreeCtrl::HitTest(const wxPoint& point, int& WXUNUSED(flags))
 {
+    wxClientDC dc(this);
+    PrepareDC(dc);
+    long x = dc.DeviceToLogicalX( (long)point.x );
+    long y = dc.DeviceToLogicalY( (long)point.y );
+
     bool onButton = FALSE;
-    return m_anchor->HitTest( point, onButton );
+    return m_anchor->HitTest( wxPoint(x, y), onButton );
 }
 
 void wxTreeCtrl::OnMouse( wxMouseEvent &event )