X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/936f635341e9b92b37db93cc7781d564babbe25f..465642da29f90bee7865319214a276c64620e077:/src/msw/gauge.cpp diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index 9a26e9b592..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)); } // ---------------------------------------------------------------------------- @@ -206,6 +208,10 @@ void wxGauge::SetRange(int r) void wxGauge::SetValue(int pos) { + // Setting the (same) position produces flicker on Vista, + // especially noticable if ownerdrawn + if (GetValue() == pos) return; + // switch to determinate mode if required SetDeterminateMode();