// recolour the entire list void wxAdvancedListCtrl::ColourList() { for (long i = 0; i < GetItemCount(); ++i) { ColourListItem(i); } }
void wxAdvancedListCtrl::ColourListItem(long item) { wxListItem ListItem; ListItem.SetId(item); ColourListItem(ListItem); SetItem(ListItem); }
// Our variation of InsertItem, so we can do magical things! long wxAdvancedListCtrl::ALCInsertItem(const wxString &Text) { wxListItem ListItem; ListItem.m_itemId = InsertItem(GetItemCount(), Text, -1); ColourListItem(ListItem.m_itemId); SetItem(ListItem); // wxWidgets bug: Required for sorting colours correctly SetItemTextColour(ListItem.m_itemId, GetTextColour()); return ListItem.m_itemId; }
// Our variation of InsertItem, so we can do magical things! long wxAdvancedListCtrl::ALCInsertItem(wxListItem &info) { //Sort(); // TODO: We need to remember this item id, because the last item on the list // does not get sorted, we can't move sort either, because then the return // index would be stale. info.SetId(InsertItem(info)); ColourListItem(info); SetItem(info); return info.GetId(); }