findInfo.flags = LVFI_STRING;
if ( partial )
findInfo.flags |= LVFI_PARTIAL;
- findInfo.psz = str.wx_str();
+ findInfo.psz = str.t_str();
// ListView_FindItem() excludes the first item from search and to look
// through all the items you need to start from -1 which is unnatural and
SelectInHDC selFont(hdc, hfont);
// get the rectangle to paint
- int subitem = colCount ? col + 1 : col;
RECT rc;
- wxGetListCtrlSubItemRect(hwndList, item, subitem, LVIR_BOUNDS, rc);
- rc.left += 6;
+ wxGetListCtrlSubItemRect(hwndList, item, col, LVIR_BOUNDS, rc);
+ if ( !col && colCount > 1 )
+ {
+ // ListView_GetSubItemRect() returns the entire item rect for 0th
+ // subitem while we really need just the part for this column
+ RECT rc2;
+ wxGetListCtrlSubItemRect(hwndList, item, 1, LVIR_BOUNDS, rc2);
+ rc.right = rc2.left;
+ rc.left += 4;
+ }
+ else // not first subitem
+ {
+ rc.left += 6;
+ }
// get the image and text to draw
wxChar text[512];
return -1;
}
-wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
-{
- wxASSERT_MSG( item >= 0 && item < GetItemCount(),
- wxT("invalid item index in OnGetItemAttr()") );
-
- // no attributes by default
- return NULL;
-}
-
wxListItemAttr *wxListCtrl::DoGetItemColumnAttr(long item, long column) const
{
if ( IsVirtual() )
else
{
// pszText is not const, hence the cast
- lvItem.pszText = (wxChar *)info.m_text.wx_str();
+ lvItem.pszText = wxMSW_CONV_LPTSTR(info.m_text);
if ( lvItem.pszText )
lvItem.cchTextMax = info.m_text.length();
else
if ( item.m_mask & wxLIST_MASK_TEXT )
{
lvCol.mask |= LVCF_TEXT;
- lvCol.pszText = (wxChar *)item.m_text.wx_str(); // cast is safe
+ lvCol.pszText = wxMSW_CONV_LPTSTR(item.m_text);
}
if ( item.m_mask & wxLIST_MASK_FORMAT )