lvCol.mask |= LVCF_IMAGE;
}
- bool success = ListView_GetColumn(GetHwnd(), col, & lvCol) != 0;
+ bool success = ListView_GetColumn(GetHwnd(), col, &lvCol) != 0;
// item.m_subItem = lvCol.iSubItem;
item.m_width = lvCol.cx;
if ( item.m_mask & wxLIST_MASK_FORMAT )
{
- if (lvCol.fmt == LVCFMT_LEFT)
- item.m_format = wxLIST_FORMAT_LEFT;
- else if (lvCol.fmt == LVCFMT_RIGHT)
- item.m_format = wxLIST_FORMAT_RIGHT;
- else if (lvCol.fmt == LVCFMT_CENTER)
- item.m_format = wxLIST_FORMAT_CENTRE;
+ switch (lvCol.fmt & LVCFMT_JUSTIFYMASK) {
+ case LVCFMT_LEFT:
+ item.m_format = wxLIST_FORMAT_LEFT;
+ break;
+ case LVCFMT_RIGHT:
+ item.m_format = wxLIST_FORMAT_RIGHT;
+ break;
+ case LVCFMT_CENTER:
+ item.m_format = wxLIST_FORMAT_CENTRE;
+ break;
+ default:
+ item.m_format = -1; // Unknown?
+ break;
+ }
}
+#if _WIN32_IE >= 0x0300
if ( item.m_mask & wxLIST_MASK_IMAGE )
{
item.m_image = lvCol.iImage;
}
+#endif
return success;
}
// Find an item whose data matches this data, starting from the item after 'start'
// or the beginning if 'start' is -1.
+// NOTE : Lindsay Mathieson - 14-July-2002
+// No longer use ListView_FindItem as the data attribute is now stored
+// in a wxListItemInternalData structure refernced by the actual lParam
long wxListCtrl::FindItem(long start, long data)
{
- LV_FINDINFO findInfo;
+ long idx = start + 1;
+ long count = GetItemCount();
- findInfo.flags = LVFI_PARAM;
- findInfo.lParam = data;
+ while (idx < count)
+ {
+ if (GetItemData(idx) == data)
+ return idx;
+ idx++;
+ };
- return ListView_FindItem(GetHwnd(), (int) start, & findInfo);
+ return -1;
}
// Find an item nearest this position in the specified direction, starting from