From e427c04537c9f56f3cc6338a7a5e02965752ae36 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 22 Sep 2011 10:36:01 +0000 Subject: [PATCH] Improve appearance of wxTreeListCtrl during live resizing. When using the generic wxDataViewCtrl version, forcefully refresh it after changing its size to avoid artefacts during resizing of wxTreeListCtrl. Closes #13502. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treelist.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 46ce84c4e5..6063ccf0a6 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -1608,6 +1608,17 @@ void wxTreeListCtrl::OnSize(wxSizeEvent& event) const wxRect rect = GetClientRect(); m_view->SetSize(rect); +#ifdef wxHAS_GENERIC_DATAVIEWCTRL + // The generic implementation doesn't refresh itself immediately which + // is annoying during "live resizing", so do it forcefully here to + // ensure that the items are re-laid out and the focus rectangle is + // redrawn correctly (instead of leaving traces) while our size is + // being changed. + wxWindow* const view = GetView(); + view->Refresh(); + view->Update(); +#endif // wxHAS_GENERIC_DATAVIEWCTRL + // Resize the first column to take the remaining available space. const unsigned numColumns = GetColumnCount(); if ( !numColumns ) -- 2.45.2