diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index b0b1bca7a7..6c517ba940 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -136,8 +136,7 @@ public: bool ScrollList( int dx, int dy ); bool SortItems( wxListCtrlCompare fn, long data ); bool Update( long item ); - // Must provide overload to avoid hiding it (and warnings about it) - virtual void Update() { wxControl::Update(); } + virtual void Update(); // are we in report mode? bool InReportView() const { return HasFlag(wxLC_REPORT); } diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 4c2c4b3aad..466cff60e8 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2732,7 +2732,10 @@ void wxListMainWindow::Thaw() wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen list control?") ); if ( --m_freezeCount == 0 ) - Refresh(); + if (m_dirty) + RecalculatePositions(); + else + Refresh(); } void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) @@ -5945,6 +5948,14 @@ void wxGenericListCtrl::Refresh(bool eraseBackground, const wxRect *rect) } } +void wxGenericListCtrl::Update() +{ + if (m_mainWin && m_mainWin->m_dirty) + m_mainWin->RecalculatePositions(); + + wxControl::Update(); +} + void wxGenericListCtrl::Freeze() { m_mainWin->Freeze();