X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9467bdb7f5bfde9f99331097daacb93564ca122e..50e08f9d2ffe18437dce14a5b8cc5385f5e51e80:/src/univ/button.cpp?ds=inline diff --git a/src/univ/button.cpp b/src/univ/button.cpp index 39ac1eb1b8..7bda74e449 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -126,8 +126,11 @@ bool wxButton::Create(wxWindow *parent, return false; SetLabel(label); - SetImageLabel(bitmap); - // SetBestSize(size); -- called by SetImageLabel() + + if (bitmap.Ok()) + SetImageLabel(bitmap); // SetInitialSize called by SetImageLabel() + else + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_BUTTON); @@ -324,12 +327,14 @@ void wxButton::SetImageMargins(wxCoord x, wxCoord y) m_marginBmpX = x + 2; m_marginBmpY = y + 2; - SetBestSize(wxDefaultSize); + SetInitialSize(wxDefaultSize); } -void wxButton::SetDefault() +wxWindow *wxButton::SetDefault() { m_isDefault = true; + + return wxButtonBase::SetDefault(); } // ============================================================================