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
This commit is contained in:
@@ -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?
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user