X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c3732409acc7a1e0b3cdb1f0a5dec7cc49a4b28b..10f80f9bd76916411e38d9c2f928e91272364c8c:/src/msw/statbox.cpp diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index beb2797300..9a08377074 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -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; }