From ec47a147749e6465992dd1d3fb2c214a54868eaf Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 17 Mar 2002 20:07:17 +0000 Subject: [PATCH] A draft for a possible fix to the redraw problems when using control with borders and the wxNO_FULL_REPAINT_ON_RESIZE flag under wxUniv. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14666 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/control.cpp | 2 +- src/univ/winuniv.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/univ/control.cpp b/src/univ/control.cpp index 315a4dd0f6..6cb253344b 100644 --- a/src/univ/control.cpp +++ b/src/univ/control.cpp @@ -74,7 +74,7 @@ bool wxControl::Create(wxWindow *parent, // less flicker and none of the standard controls needs to be entirely // repainted after resize anyhow. if ( !wxControlBase::Create(parent, id, pos, size, - style | wxNO_FULL_REPAINT_ON_RESIZE, + style | wxNO_FULL_REPAINT_ON_RESIZE , validator, name) ) { // underlying window creation failed? diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index bb8c8d9b4c..ba8e127164 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -450,6 +450,61 @@ void wxWindow::OnSize(wxSizeEvent& event) { PositionScrollbars(); } + +#if 0 + // Refresh the area (strip) previously occupied by the border + + if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE )) + { + wxSize newSize = event.GetSize(); + + if (HasFlag( wxSIMPLE_BORDER )) + { + if (newSize.y > m_oldSize.y) + { + wxRect rect; + rect.x = 0; + rect.width = m_oldSize.x; + rect.y = m_oldSize.y; + rect.height = 1; + Refresh( TRUE, &rect ); + } + if (newSize.x > m_oldSize.x) + { + wxRect rect; + rect.y = 0; + rect.height = m_oldSize.y; + rect.x = m_oldSize.x; + rect.width = 1; + Refresh( TRUE, &rect ); + } + } + else + if (HasFlag( wxSUNKEN_BORDER ) || HasFlag( wxRAISED_BORDER )) + { + if (newSize.y > m_oldSize.y) + { + wxRect rect; + rect.x = 0; + rect.width = m_oldSize.x; + rect.y = m_oldSize.y-1; + rect.height = 2; + Refresh( TRUE, &rect ); + } + if (newSize.x > m_oldSize.x) + { + wxRect rect; + rect.y = 0; + rect.height = m_oldSize.y; + rect.x = m_oldSize.x-1; + rect.width = 2; + Refresh( TRUE, &rect ); + } + } + + m_oldSize = newSize; + } +#endif event.Skip(); } -- 2.45.2