void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect) { if ( GetBackgroundBitmap().IsOk() ) { // Get the bitmap and the flags int alignment; wxStretch stretch; wxBitmap bmp = GetBackgroundBitmap(&alignment, &stretch); wxControlRenderer::DrawBitmap(dc, bmp, rect, alignment, stretch); } else { // Just fill it with bg colour if no bitmap m_renderer->DrawBackground(dc, wxTHEME_BG_COLOUR(this), rect, GetStateFlags()); } }
bool wxButton::DoDrawBackground(wxDC& dc) { wxRect rect; wxSize size = GetSize(); rect.width = size.x; rect.height = size.y; if ( GetBackgroundBitmap().Ok() ) { // get the bitmap and the flags int alignment; wxStretch stretch; wxBitmap bmp = GetBackgroundBitmap(&alignment, &stretch); wxControlRenderer::DrawBitmap(dc, bmp, rect, alignment, stretch); } else { m_renderer->DrawButtonSurface(dc, wxTHEME_BG_COLOUR(this), rect, GetStateFlags()); } return true; }