X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/97786ab70f8ee33532b83af6fadad4129e1570e1..92bdf9f72f6f9aae3de0115b7ac8c6037ef95ca1:/src/msw/bmpbuttn.cpp diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index af0014cf67..4d982db963 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -103,8 +103,6 @@ bitmap "focus" , bitmap "disabled" , */ -#define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1) - bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, @@ -492,26 +490,16 @@ void wxBitmapButton::SetDefault() wxSize wxBitmapButton::DoGetBestSize() const { - wxSize best; - if (m_bmpNormal.Ok()) - { - best.x = m_bmpNormal.GetWidth() + 2*m_marginX; - best.y = m_bmpNormal.GetHeight() + 2*m_marginY; - } - - // all buttons have at least the standard size unless the user explicitly - // wants them to be of smaller size and used wxBU_EXACTFIT style when - // creating the button - if ( !HasFlag(wxBU_EXACTFIT) ) + if ( m_bmpNormal.Ok() ) { - wxSize sz = GetDefaultSize(); - if ( best.x < sz.x ) - best.x = sz.x; - if ( best.y < sz.y ) - best.y = sz.y; + wxSize best(m_bmpNormal.GetWidth() + 2*m_marginX, + m_bmpNormal.GetHeight() + 2*m_marginY); + CacheBestSize(best); + return best; } - return best; + // no idea what our best size should be, defer to the base class + return wxBitmapButtonBase::DoGetBestSize(); } #endif // wxUSE_BMPBUTTON