use ListView_RedrawItems() to implement wxListCtrl::RefreshItems(); added tests for it to the sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-16 10:24:45 +00:00
parent 6dd25d20be
commit ebc9b89d52
3 changed files with 46 additions and 28 deletions

View File

@@ -2847,30 +2847,12 @@ void wxListCtrl::SetItemCount(long count)
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
RefreshItems(item, item);
}
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);
ListView_RedrawItems(GetHwnd(), itemFrom, itemTo);
}
// ----------------------------------------------------------------------------