From 8cb03510a15d9b9d2c93ea7411c84a426884aab3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 24 Jan 2010 11:51:00 +0000 Subject: [PATCH] Determine wxButton size correctly in wxMSW. Instead of using default size for default GUI font, use the default font for this dialog's current font. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/button.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 67494356d6..ad3f9a452f 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -457,7 +457,10 @@ wxSize wxMSWButton::ComputeBestSize(wxControl *btn) // creating the button if ( !btn->HasFlag(wxBU_EXACTFIT) ) { - wxSize sizeDef = wxButton::GetDefaultSize(); + // The size of a standard button in the dialog units is 50x14, use it. + // Note that we intentionally don't use GetDefaultSize() here, because + // it's inexact -- dialog units depend on this dialog's font. + wxSize sizeDef = btn->ConvertDialogToPixels(wxSize(50, 14)); if ( sizeBtn.x < sizeDef.x ) sizeBtn.x = sizeDef.x; if ( sizeBtn.y < sizeDef.y ) -- 2.45.2