Fix wxListCtrl::GetSubItemRect(wxLIST_RECT_ICON/LABEL) in wxMSW for column 0.

Wrong width was returned for the icon or label rectangle when querying the
first column. Fix this and add a test to the sample allowing to check this.

GetSubItemRect() still returns wrong results for second and subsequent
columns, see #11355.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-11-24 00:01:38 +00:00
parent f3c74c8df9
commit 92a2a0ef91
2 changed files with 11 additions and 4 deletions

View File

@@ -1183,7 +1183,7 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int code)
// there is no way to retrieve the first sub item bounding rectangle using
// wxGetListCtrlSubItemRect() as 0 means the whole item, so we need to
// truncate it at first column ourselves
if ( subItem == 0 )
if ( subItem == 0 && code == wxLIST_RECT_BOUNDS )
rect.width = GetColumnWidth(0);
return true;