// handler for child pages erase background event
void DoEraseBackground(wxEraseEvent& event);
+ // real implementation of the above method
+ void DoEraseBackground(wxWindow *win, WXHDC hDC);
+
// get the brush to be used for painting the background for the controls
// which need it in their MSWControlColor()
//
}
void wxNotebook::DoEraseBackground(wxEraseEvent& event)
+{
+ DoEraseBackground((wxWindow *)event.GetEventObject(),
+ (WXHDC)GetHdcOf(*event.GetDC()));
+}
+
+void wxNotebook::DoEraseBackground(wxWindow *win, WXHDC hDC)
{
// we can either draw the background ourselves or let DrawThemeBackground()
// do it, but as we already have the correct brush, let's do it ourselves
// (note that we use the same code in wxControl::MSWControlColor(), so if
// it breaks, it should at least break in consistent way)
- wxWindow *win = (wxWindow *)event.GetEventObject();
- HDC hdc = GetHdcOf(*event.GetDC());
- WXHBRUSH hbr = GetThemeBackgroundBrush((WXHDC)hdc, win);
+ WXHBRUSH hbr = GetThemeBackgroundBrush(hDC, win);
if ( hbr )
{
RECT rectClient;
::GetClientRect(GetHwndOf(win), &rectClient);
- ::FillRect(hdc, &rectClient, (HBRUSH)hbr);
+ ::FillRect((HDC)hDC, &rectClient, (HBRUSH)hbr);
}
}