implemented RefreshItem(s) under MSW
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -231,6 +231,10 @@ public:
|
|||||||
// returns true if it is a virtual list control
|
// returns true if it is a virtual list control
|
||||||
bool IsVirtual() const { return (GetWindowStyle() & wxLC_VIRTUAL) != 0; }
|
bool IsVirtual() const { return (GetWindowStyle() & wxLC_VIRTUAL) != 0; }
|
||||||
|
|
||||||
|
// refresh items selectively (only useful for virtual list controls)
|
||||||
|
void RefreshItem(long item);
|
||||||
|
void RefreshItems(long itemFrom, long itemTo);
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@@ -1683,6 +1683,14 @@ WXLPARAM wxListCtrl::OnCustomDraw(WXLPARAM lParam)
|
|||||||
case CDDS_ITEMPREPAINT:
|
case CDDS_ITEMPREPAINT:
|
||||||
{
|
{
|
||||||
size_t item = (size_t)nmcd.dwItemSpec;
|
size_t item = (size_t)nmcd.dwItemSpec;
|
||||||
|
if ( item >= (size_t)GetItemCount() )
|
||||||
|
{
|
||||||
|
// we get this message with item == 0 for an empty control,
|
||||||
|
// we must ignore it as calling OnGetItemAttr() would be
|
||||||
|
// wrong
|
||||||
|
return CDRF_DODEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
wxListItemAttr *attr =
|
wxListItemAttr *attr =
|
||||||
IsVirtual() ? OnGetItemAttr(item)
|
IsVirtual() ? OnGetItemAttr(item)
|
||||||
: (wxListItemAttr *)m_attrs.Get(item);
|
: (wxListItemAttr *)m_attrs.Get(item);
|
||||||
@@ -1850,6 +1858,22 @@ void wxListCtrl::SetItemCount(long count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxListCtrl::RefreshItem(long item)
|
||||||
|
{
|
||||||
|
if ( !ListView_Update(GetHwnd(), item) )
|
||||||
|
{
|
||||||
|
wxLogLastError(_T("ListView_Update"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListCtrl::RefreshItems(long itemFrom, long itemTo)
|
||||||
|
{
|
||||||
|
for ( long item = itemFrom; item <= itemTo; item++ )
|
||||||
|
{
|
||||||
|
RefreshItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxListItem
|
// wxListItem
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user