+// ----------------------------------------------------------------------------
+// virtual list controls
+// ----------------------------------------------------------------------------
+
+wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) const
+{
+ // this is a pure virtual function, in fact - which is not really pure
+ // because the controls which are not virtual don't need to implement it
+ wxFAIL_MSG( _T("not supposed to be called") );
+
+ return wxEmptyString;
+}
+
+int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const
+{
+ // same as above
+ wxFAIL_MSG( _T("not supposed to be called") );
+
+ return -1;
+}
+
+wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
+{
+ wxASSERT_MSG( item >= 0 && item < GetItemCount(),
+ _T("invalid item index in OnGetItemAttr()") );
+
+ // no attributes by default
+ return NULL;
+}
+
+void wxListCtrl::SetItemCount(long count)
+{
+ wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") );
+
+ if ( !::SendMessage(GetHwnd(), LVM_SETITEMCOUNT, (WPARAM)count, 0) )
+ {
+ wxLogLastError(_T("ListView_SetItemCount"));
+ }
+}
+
+void wxListCtrl::RefreshItem(long item)
+{
+ // strangely enough, ListView_Update() results in much more flicker here
+ // than a dumb Refresh() -- why?
+#if 0
+ if ( !ListView_Update(GetHwnd(), item) )
+ {
+ wxLogLastError(_T("ListView_Update"));
+ }
+#else // 1
+ wxRect rect;
+ GetItemRect(item, rect);
+ RefreshRect(rect);
+#endif // 0/1
+}
+
+void wxListCtrl::RefreshItems(long itemFrom, long itemTo)
+{
+ wxRect rect1, rect2;
+ GetItemRect(itemFrom, rect1);
+ GetItemRect(itemTo, rect2);
+
+ wxRect rect = rect1;
+ rect.height = rect2.GetBottom() - rect1.GetTop();
+
+ RefreshRect(rect);
+}
+