From a2837c3c43e63d096c80141e4593a81236ec967c Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 10 Feb 2010 13:31:58 +0000 Subject: [PATCH] Fixed wxGauge's best size to conform to Windows HIG. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/gauge.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index 1045bffc61..1fcc481c80 100644 --- a/src/msw/gauge.cpp +++ b/src/msw/gauge.cpp @@ -177,12 +177,14 @@ WXDWORD wxGauge::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxGauge::DoGetBestSize() const { - // VZ: no idea where does 28 come from, it was there before my changes and - // as nobody ever complained I guess we can leave it... + // Windows HIG (http://msdn.microsoft.com/en-us/library/aa511279.aspx) + // suggest progress bar size of "107 or 237 x 8 dialog units". Let's use + // the smaller one. + if (HasFlag(wxGA_VERTICAL)) - return wxSize(28, 100); + return ConvertDialogToPixels(wxSize(8, 107)); else - return wxSize(100, 28); + return ConvertDialogToPixels(wxSize(107, 8)); } // ---------------------------------------------------------------------------- -- 2.45.2