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
This commit is contained in:
Vadim Zeitlin
2009-05-30 22:25:42 +00:00
parent 68fe70ea1f
commit e1983cad7c
2 changed files with 24 additions and 3 deletions

View File

@@ -139,9 +139,6 @@ public:
int format = wxLIST_FORMAT_LEFT, int width = -1 ); int format = wxLIST_FORMAT_LEFT, int width = -1 );
bool ScrollList( int dx, int dy ); bool ScrollList( int dx, int dy );
bool SortItems( wxListCtrlCompare fn, wxIntPtr data ); 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? // are we in report mode?
bool InReportView() const { return HasFlag(wxLC_REPORT); } bool InReportView() const { return HasFlag(wxLC_REPORT); }
@@ -162,6 +159,10 @@ public:
wxDEPRECATED( int GetItemSpacing( bool isSmall ) const ); wxDEPRECATED( int GetItemSpacing( bool isSmall ) const );
#endif // WXWIN_COMPATIBILITY_2_6 #endif // WXWIN_COMPATIBILITY_2_6
// overridden base class virtuals
// ------------------------------
virtual wxVisualAttributes GetDefaultAttributes() const virtual wxVisualAttributes GetDefaultAttributes() const
{ {
return GetClassDefaultAttributes(GetWindowVariant()); return GetClassDefaultAttributes(GetWindowVariant());
@@ -170,9 +171,15 @@ public:
static wxVisualAttributes static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
virtual void Update();
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------
// generic version extension, don't use in portable code
bool Update( long item );
void OnInternalIdle( ); void OnInternalIdle( );
// We have to hand down a few functions // We have to hand down a few functions

View File

@@ -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 #endif // wxUSE_LISTCTRL