2. refresh the window after deleting all items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11108
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
public:
wxListItemData(wxListMainWindow *owner);
{
public:
wxListItemData(wxListMainWindow *owner);
- ~wxListItemData() { delete m_attr; delete m_rect; }
void SetItem( const wxListItem &info );
void SetImage( int image ) { m_image = image; }
void SetItem( const wxListItem &info );
void SetImage( int image ) { m_image = image; }
// wxListItemData
//-----------------------------------------------------------------------------
// wxListItemData
//-----------------------------------------------------------------------------
+wxListItemData::~wxListItemData()
+{
+ // in the virtual list control the attributes are managed by the main
+ // program, so don't delete them
+ if ( !m_owner->IsVirtual() )
+ {
+ delete m_attr;
+ }
+
+ delete m_rect;
+}
+
void wxListItemData::Init()
{
m_image = -1;
void wxListItemData::Init()
{
m_image = -1;
- if ( owner->HasFlag(wxLC_REPORT) )
+ if ( owner->InReportView() )
m_selStore.SetItemCount(count);
m_countVirt = count;
m_selStore.SetItemCount(count);
m_countVirt = count;
+ ResetVisibleLinesRange();
+
ResetCurrent();
// to make the deletion of all items faster, we don't send the
ResetCurrent();
// to make the deletion of all items faster, we don't send the
- ResetVisibleLinesRange();
+ // NB: don't just set m_dirty to TRUE here as RecalculatePositions()
+ // doesn't do anything if the control is empty and so we won't be
+ // refreshed
+ Refresh();
}
void wxListMainWindow::DeleteEverything()
}
void wxListMainWindow::DeleteEverything()