]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/statbox.cpp
put some asserts to check that inconsistent slider styles are not used
[wxWidgets.git] / src / msw / statbox.cpp
index beb279730064a0e963a67885039bc9cbd57b8331..9a0837707478d38fed19afa54487c1f9eccd3516 100644 (file)
@@ -142,8 +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.
+        for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
+        {
+            if ( win->HasFlag(wxVSCROLL) || win->HasFlag(wxHSCROLL) )
+            {
+                *exstyle = WS_EX_TRANSPARENT;
+                break;
+            }
+
+            if ( win->IsTopLevel() )
+                break;
+        }
+    }
+
     return styleWin | BS_GROUPBOX;
 }