]> git.saurik.com Git - wxWidgets.git/commitdiff
A draft for a possible fix to the redraw
authorRobert Roebling <robert@roebling.de>
Sun, 17 Mar 2002 20:07:17 +0000 (20:07 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 17 Mar 2002 20:07:17 +0000 (20:07 +0000)
     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
src/univ/winuniv.cpp

index 315a4dd0f6ffe50307f9abf8e5a10ada5e7fb7c7..6cb253344b7f6d834956ea94e9aba2bfa89bdd79 100644 (file)
@@ -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?
index bb8c8d9b4c6731eac3b960cf57f634f425084259..ba8e12716460d25a5d002486e36bdfc2e0d5a118 100644 (file)
@@ -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();
 }