Fix HitTest offset, and some other little things that had been changed

in our old copy of treelistctrl


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-06-28 21:30:52 +00:00
parent ba87052fcf
commit 79e55c661b

View File

@ -1629,7 +1629,7 @@ wxTreeListItem *wxTreeListItem::HitTest(const wxPoint& point,
{ {
// evaluate the item // evaluate the item
int h = theCtrl->GetLineHeight(this); int h = theCtrl->GetLineHeight(this);
if ((point.y > m_y) && (point.y < m_y + h)) if ((point.y > m_y) && (point.y <= m_y + h))
{ {
// check for above/below middle // check for above/below middle
int y_mid = m_y + h/2; int y_mid = m_y + h/2;
@ -4024,12 +4024,8 @@ wxTreeItemId wxTreeListMainWindow::HitTest(const wxPoint& point, int& flags,
return wxTreeItemId(); return wxTreeItemId();
} }
wxClientDC dc(this); wxTreeListItem *hit = m_anchor->HitTest(CalcUnscrolledPosition(point),
PrepareDC(dc); this, flags, column, 0);
wxCoord x = dc.DeviceToLogicalX( point.x );
wxCoord y = dc.DeviceToLogicalY( point.y );
wxTreeListItem *hit = m_anchor->HitTest(wxPoint(x, y), this, flags,
column, 0);
if (hit == NULL) if (hit == NULL)
{ {
flags = wxTREE_HITTEST_NOWHERE; flags = wxTREE_HITTEST_NOWHERE;
@ -4469,7 +4465,7 @@ void wxTreeListMainWindow::RefreshSubtree(wxTreeListItem *item)
int cw = 0; int cw = 0;
int ch = 0; int ch = 0;
GetClientSize( &cw, &ch ); // GetVirtualSize??? GetVirtualSize( &cw, &ch );
wxRect rect; wxRect rect;
rect.x = dc.LogicalToDeviceX( 0 ); rect.x = dc.LogicalToDeviceX( 0 );
@ -4491,7 +4487,7 @@ void wxTreeListMainWindow::RefreshLine( wxTreeListItem *item )
int cw = 0; int cw = 0;
int ch = 0; int ch = 0;
GetClientSize( &cw, &ch ); // GetVirtualSize ?? GetVirtualSize( &cw, &ch );
wxRect rect; wxRect rect;
rect.x = dc.LogicalToDeviceX( 0 ); rect.x = dc.LogicalToDeviceX( 0 );
@ -4898,8 +4894,7 @@ void wxTreeListCtrl::ScrollTo(const wxTreeItemId& item)
wxTreeItemId wxTreeListCtrl::HitTest(const wxPoint& pos, int& flags, wxTreeItemId wxTreeListCtrl::HitTest(const wxPoint& pos, int& flags,
int& column) int& column)
{ {
return m_main_win->HitTest(m_main_win->ScreenToClient(ClientToScreen(pos)), return m_main_win->HitTest(pos, flags, column);
flags, column);
} }
bool wxTreeListCtrl::GetBoundingRect(const wxTreeItemId& item, wxRect& rect, bool wxTreeListCtrl::GetBoundingRect(const wxTreeItemId& item, wxRect& rect,