X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f90d461a37856fab62b89fe7c3f7e7d5f2dab4c2..ccdcde00d9ae27ca20ff6c3c9495918a0ec725aa:/src/univ/button.cpp diff --git a/src/univ/button.cpp b/src/univ/button.cpp index 23a4d96eea..b06789a25d 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -39,6 +39,7 @@ #include "wx/univ/renderer.h" #include "wx/univ/inphand.h" #include "wx/univ/theme.h" +#include "wx/univ/colschem.h" // ---------------------------------------------------------------------------- // constants @@ -162,6 +163,30 @@ void wxButton::DoDraw(wxControlRenderer *renderer) renderer->DrawLabel(m_bitmap, m_marginBmpX, m_marginBmpY); } +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; +} + // ---------------------------------------------------------------------------- // input processing // ----------------------------------------------------------------------------