From e1983cad7c586f130d2a028101b3211d78535271 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 May 2009 22:25:42 +0000 Subject: [PATCH] implement Update() properly for the generic wxListCtrl (see #10857) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/listctrl.h | 13 ++++++++++--- src/generic/listctrl.cpp | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/include/wx/generic/listctrl.h b/include/wx/generic/listctrl.h index 9fdc58788d..e33dfcf8d1 100644 --- a/include/wx/generic/listctrl.h +++ b/include/wx/generic/listctrl.h @@ -139,9 +139,6 @@ public: int format = wxLIST_FORMAT_LEFT, int width = -1 ); bool ScrollList( int dx, int dy ); bool SortItems( wxListCtrlCompare fn, wxIntPtr data ); - bool Update( long item ); - // Must provide overload to avoid hiding it (and warnings about it) - virtual void Update() { wxControl::Update(); } // are we in report mode? bool InReportView() const { return HasFlag(wxLC_REPORT); } @@ -162,6 +159,10 @@ public: wxDEPRECATED( int GetItemSpacing( bool isSmall ) const ); #endif // WXWIN_COMPATIBILITY_2_6 + + // overridden base class virtuals + // ------------------------------ + virtual wxVisualAttributes GetDefaultAttributes() const { return GetClassDefaultAttributes(GetWindowVariant()); @@ -170,9 +171,15 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + virtual void Update(); + + // implementation only from now on // ------------------------------- + // generic version extension, don't use in portable code + bool Update( long item ); + void OnInternalIdle( ); // We have to hand down a few functions diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 5f7adb2fd1..b62c9cf1f8 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -5198,4 +5198,18 @@ void wxGenericListCtrl::Refresh(bool eraseBackground, const wxRect *rect) } } +void wxGenericListCtrl::Update() +{ + if ( m_mainWin ) + { + if ( m_mainWin->m_dirty ) + m_mainWin->RecalculatePositions(); + + m_mainWin->Update(); + } + + if ( m_headerWin ) + m_headerWin->Update(); +} + #endif // wxUSE_LISTCTRL -- 2.45.2