From cd9b34ef833ca8e79821de19ce25f7c3287a8506 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jul 2011 23:36:55 +0000 Subject: [PATCH] Refresh the generic wxDataViewCtrl header if it was made too small. Although normally the control header is not supposed to be resized below its minimal vertical size, sometimes this can still happen and in this case ugly artefacts were displayed because it wasn't refreshed properly. Do refresh it to avoid them. Closes #13313. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 44b0bd4ef8..5c773a9f7a 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4025,6 +4025,16 @@ void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) Layout(); AdjustScrollbars(); + + // We must redraw the headers if their height changed. Normally this + // shouldn't happen as the control shouldn't let itself be resized beneath + // its minimal height but avoid the display artefacts that appear if it + // does happen, e.g. because there is really not enough vertical space. + if ( !HasFlag(wxDV_NO_HEADER) && m_headerArea && + m_headerArea->GetSize().y <= m_headerArea->GetBestSize(). y ) + { + m_headerArea->Refresh(); + } } void wxDataViewCtrl::SetFocus() -- 2.50.0