]> git.saurik.com Git - wxWidgets.git/commitdiff
Hack to make wxStaticBox be repainted when inside a scrolling window
authorJulian Smart <julian@anthemion.co.uk>
Sun, 10 Apr 2005 17:14:58 +0000 (17:14 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 10 Apr 2005 17:14:58 +0000 (17:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/statbox.cpp

index beb279730064a0e963a67885039bc9cbd57b8331..da28e527ff2173c6eb97d331753b14bb79e72cac 100644 (file)
@@ -142,7 +142,26 @@ WXDWORD wxStaticBox::MSWGetStyle(long style, WXDWORD *exstyle) const
     styleWin &= ~WS_CLIPCHILDREN;
 
     if ( exstyle )
-        *exstyle = 0;
+    {
+        // If any of the ancestors are scrolling windows, style has to be WS_EX_TRANSPARENT
+        // or the static box won't be painted when the window is scrolled. We try
+        // not to do this normally, because we get a lot of flicker.
+        wxWindow* p = GetParent();
+        bool ancestorScrolls = false;
+        while (p && !p->IsTopLevel())
+        {
+            if (p->HasFlag(wxVSCROLL) || GetParent()->HasFlag(wxHSCROLL))
+            {
+                ancestorScrolls = true;
+                break;
+            }
+            p = p->GetParent();
+        }
+        if (ancestorScrolls)
+            *exstyle = WS_EX_TRANSPARENT;
+        else
+            *exstyle = 0;
+    }
 
     return styleWin | BS_GROUPBOX;
 }