From: Václav Slavík Date: Mon, 30 Apr 2012 09:33:25 +0000 (+0000) Subject: Invalidate wxDataViewCtrl bests widths on expand/collapse. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b6b171522b1aa2241447e187e422c892ded76053 Invalidate wxDataViewCtrl bests widths on expand/collapse. The best column widths are computed from "realized" items that are available as rows in wxDataViewCtrl. This information changes when a previously collapsed node is expanded and new items become available for column width calculation. Fixes #14167. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 7c58d590b9..8d6490805b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5082,14 +5082,20 @@ void wxDataViewCtrl::Expand( const wxDataViewItem & item ) int row = m_clientArea->GetRowByItem( item ); if (row != -1) + { m_clientArea->Expand(row); + InvalidateColBestWidths(); + } } void wxDataViewCtrl::Collapse( const wxDataViewItem & item ) { int row = m_clientArea->GetRowByItem( item ); if (row != -1) + { m_clientArea->Collapse(row); + InvalidateColBestWidths(); + } } bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const