X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34d26f42b16d6fb233988fec2a7fa6c8f397972d..7ee31b00ed1aff56aa22f43f65a8604f6937ca37:/src/univ/button.cpp diff --git a/src/univ/button.cpp b/src/univ/button.cpp index f98b725e51..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 @@ -136,12 +137,14 @@ wxSize wxButton::DoGetBestClientSize() const // for compatibility with other ports, the buttons default size is never // less than the standard one +#ifndef __WXX11__ if ( !(GetWindowStyle() & wxBU_EXACTFIT) ) { wxSize szDef = GetDefaultSize(); if ( width < szDef.x ) width = szDef.x; } +#endif return wxSize(width, height); } @@ -160,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 // ----------------------------------------------------------------------------