implement wxListCtrl::GetSubItemRect() for generic version and fix bug in it in wxMSW one; also added a test for it in the sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-30 18:21:33 +00:00
parent a2fd8a45ec
commit e974c5d258
5 changed files with 86 additions and 26 deletions

View File

@@ -970,6 +970,27 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event)
}
break;
case '1': // show sub item bounding rectangle
case '2':
case '3':
case '4': // this column is invalid but we want to test it too
if ( InReportView() )
{
int subItem = event.GetKeyCode() - '1';
item = event.GetIndex();
wxRect r;
if ( !GetSubItemRect(item, subItem, r) )
{
wxLogError(_T("Failed to retrieve rect of item %ld column %d"), item, subItem + 1);
break;
}
wxLogMessage(_T("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"),
item, subItem + 1,
r.x, r.y, r.x + r.width, r.y + r.height);
}
break;
case 'U': // update
if ( !IsVirtual() )
break;