From bcb16e440298ddeef546e7248a47ac6f31112faa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 Oct 2000 16:34:23 +0000 Subject: [PATCH] fixed GetItemRect() and GetItemPosition() for scrolled items (patch from Mike Oliver ) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 859435e022..02b7221f74 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2620,6 +2620,7 @@ void wxListMainWindow::GetItemRect( long index, wxRect &rect ) if (index >= 0 && (size_t)index < m_lines.GetCount()) { m_lines[(size_t)index].GetRect( rect ); + this->CalcScrolledPosition(rect.x,rect.y,&rect.x,&rect.y); } else { @@ -2632,18 +2633,9 @@ void wxListMainWindow::GetItemRect( long index, wxRect &rect ) bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos) { - if (item >= 0 && (size_t)item < m_lines.GetCount()) - { - wxRect rect; - m_lines[(size_t)item].GetRect( rect ); - pos.x = rect.x; - pos.y = rect.y; - } - else - { - pos.x = 0; - pos.y = 0; - } + wxRect rect; + this->GetItemRect(item,rect); + pos.x=rect.x; pos.y=rect.y; return TRUE; }