#include "wx/dcmemory.h"
#include "wx/msw/private.h"
+#include "wx/msw/missing.h"
// ----------------------------------------------------------------------------
// wxWin macros
if ( exstyle )
{
- // 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())
+ *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 (p->HasFlag(wxVSCROLL) || GetParent()->HasFlag(wxHSCROLL))
+ if ( win->HasFlag(wxVSCROLL) || win->HasFlag(wxHSCROLL) )
{
- ancestorScrolls = true;
+ *exstyle = WS_EX_TRANSPARENT;
break;
}
- p = p->GetParent();
+
+ if ( win->IsTopLevel() )
+ break;
}
- if (ancestorScrolls)
- *exstyle = WS_EX_TRANSPARENT;
- else
- *exstyle = 0;
}
return styleWin | BS_GROUPBOX;
// 3. this is backwards compatible behaviour and some people rely on it,
// see http://groups.google.com/groups?selm=4252E932.3080801%40able.es
wxWindow *parent = GetParent();
- HBRUSH hbr = (HBRUSH)parent->MSWGetBgBrush(dc.GetHDC(), this);
+ HBRUSH hbr = (HBRUSH)parent->MSWGetBgBrush(dc.GetHDC(), GetHWND());
// if there is no special brush for painting this control, just use the
// solid background colour