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
This commit is contained in:
Václav Slavík
2010-01-24 11:51:00 +00:00
parent 0c550516dd
commit 8cb03510a1

View File

@@ -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 )