- if ( !m_bmpBg.Ok() )
- {
- // don't even skip the event, if we don't have a bg bitmap we're going
- // to overwrite background in OnPaint() below anyhow, so letting the
- // default handling take place would only result in flicker, just set a
- // flag to erase the background below
- m_eraseBgInOnPaint = true;
- return;
- }
-
- wxDC& dc = *event.GetDC();
-
- // if the image is not fully opaque, we have to erase the background before
- // drawing it, however avoid doing it for opaque images as this would just
- // result in extra flicker without any other effect as background is
- // completely covered anyhow
- if ( m_bmpBg.GetMask() )
+ // if we don't have any background bitmap we just fill it with background
+ // colour and we also must do it if the background bitmap is not fully
+ // opaque as otherwise junk could be left there
+ if ( !m_bmpBg.IsOk() || m_bmpBg.GetMask() )