- // for the toplevel window this really is the entire area
- // for all the others only their client area, otherwise they
- // might be drawing with full alpha and eg put blue into
- // the grow-box area of a scrolled window (scroll sample)
- wxDC* dc = new wxWindowDC(this);
- if ( IsTopLevel() )
- dc->SetDeviceClippingRegion(formerUpdateRgn);
- else
- dc->SetDeviceClippingRegion(clientUpdateRgn);
+ case wxBG_STYLE_ERASE:
+ case wxBG_STYLE_SYSTEM:
+ {
+ // for the toplevel window this really is the entire area for
+ // all the others only their client area, otherwise they might
+ // be drawing with full alpha and eg put blue into the grow-box
+ // area of a scrolled window (scroll sample)
+ wxWindowDC dc(this);
+ if ( IsTopLevel() )
+ dc.SetDeviceClippingRegion(formerUpdateRgn);
+ else
+ dc.SetDeviceClippingRegion(clientUpdateRgn);
+
+ if ( bgStyle == wxBG_STYLE_ERASE )
+ {
+ wxEraseEvent eevent( GetId(), &dc );
+ eevent.SetEventObject( this );
+ if ( ProcessWindowEvent( eevent ) )
+ break;
+ }