X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32cd189dfcfe96c41e32c3b9827bf67484c60b13..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/msw/tglbtn.cpp diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index a0b22727df..7a0e49c862 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -83,11 +83,6 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, return true; } -wxBorder wxToggleButton::GetDefaultBorder() const -{ - return wxBORDER_NONE; -} - WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const { WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle); @@ -126,14 +121,18 @@ wxSize wxToggleButton::DoGetBestSize() const int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); #if wxUSE_BUTTON - wxSize sz = wxButton::GetDefaultSize(); - if (wBtn > sz.x) - sz.x = wBtn; - if (hBtn > sz.y) - sz.y = hBtn; -#else + // make all buttons of at least standard size unless wxBU_EXACTFIT is given + if ( !HasFlag(wxBU_EXACTFIT) ) + { + const wxSize szMin = wxButton::GetDefaultSize(); + if ( wBtn < szMin.x ) + wBtn = szMin.x; + if ( hBtn < szMin.y ) + hBtn = szMin.y; + } +#endif // wxUSE_BUTTON + wxSize sz(wBtn, hBtn); -#endif CacheBestSize(sz); return sz;