From 188b9f2e382136c9e9b5371ccce509a3c4387bef Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 3 Jul 2002 21:34:48 +0000 Subject: [PATCH] Made wxBU_EXACTFIT work as documented instead of being ignored. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/button.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/msw/button.cpp b/src/msw/button.cpp index cb5cce446f..172cf7de5b 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -147,11 +147,16 @@ wxSize wxButton::DoGetBestSize() const // the button height is proportional to the height of the font used int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); - wxSize sz = GetDefaultSize(); - if (wBtn > sz.x) sz.x = wBtn; - if (hBtn > sz.y) sz.y = hBtn; + if (!HasFlag(wxBU_EXACTFIT)) + { + wxSize sz = GetDefaultSize(); + if (wBtn > sz.x) sz.x = wBtn; + if (hBtn > sz.y) sz.y = hBtn; + return sz; + } + else + return wxSize(wBtn, hBtn); - return sz; } /* static */ -- 2.50.0