X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4438caf41af49f00f3c8137ac801871f59cce386..b908d2244a4975ceda4e050744280bf07e9ff350:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 1a34a34d0e..03e9351758 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -30,6 +30,7 @@ #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/brush.h" + #include "wx/panel.h" #endif #include "wx/msw/private.h" @@ -131,6 +132,20 @@ wxSize wxButton::DoGetBestSize() return wxSize(wBtn, hBtn); } +/* static */ +wxSize wxButton::GetDefaultSize() +{ + // the base unit is the height of the system GUI font + int wChar, hChar; + wxGetCharSize(0, &wChar, &hChar, NULL); + + // the button height is proportional to the height of the font used + int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); + + // and the width/height ration is 75/23 + return wxSize((75 * hBtn) / 23, hBtn); +} + // ---------------------------------------------------------------------------- // set this button as the default one in its panel // ----------------------------------------------------------------------------