]> git.saurik.com Git - wxWidgets.git/commitdiff
Made wxBU_EXACTFIT work as documented instead of being ignored.
authorRobin Dunn <robin@alldunn.com>
Wed, 3 Jul 2002 21:34:48 +0000 (21:34 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 3 Jul 2002 21:34:48 +0000 (21:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/button.cpp

index cb5cce446f0bd5aa0747f64bbec70536426c8efc..172cf7de5b5e0e0249db6a8abffeeabbe3d8606e 100644 (file)
@@ -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 */