fixed GetItemRect() and GetItemPosition() for scrolled items (patch from Mike Oliver <oliver@math.ucla.edu>)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2664,6 +2664,7 @@ void wxListMainWindow::GetItemRect( long index, wxRect &rect )
|
|||||||
if (index >= 0 && (size_t)index < m_lines.GetCount())
|
if (index >= 0 && (size_t)index < m_lines.GetCount())
|
||||||
{
|
{
|
||||||
m_lines[(size_t)index].GetRect( rect );
|
m_lines[(size_t)index].GetRect( rect );
|
||||||
|
this->CalcScrolledPosition(rect.x,rect.y,&rect.x,&rect.y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2675,19 +2676,10 @@ void wxListMainWindow::GetItemRect( long index, wxRect &rect )
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos)
|
bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos)
|
||||||
{
|
|
||||||
if (item >= 0 && (size_t)item < m_lines.GetCount())
|
|
||||||
{
|
{
|
||||||
wxRect rect;
|
wxRect rect;
|
||||||
m_lines[(size_t)item].GetRect( rect );
|
this->GetItemRect(item,rect);
|
||||||
pos.x = rect.x;
|
pos.x=rect.x; pos.y=rect.y;
|
||||||
pos.y = rect.y;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pos.x = 0;
|
|
||||||
pos.y = 0;
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user