X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bf45c9ecafa14b167ef0c911a83cd5cc8fba4d2..143318ddbb005602b600216cca621439b771f889:/src/msw/control.cpp diff --git a/src/msw/control.cpp b/src/msw/control.cpp index efe188ffba..cb662e9ad9 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -212,18 +212,29 @@ wxSize wxControl::DoGetBestSize() const // wxChoice and others. wxSize wxControl::GetBestSpinerSize(const bool is_vertical) const { + // take size according to layout + wxSize bestSize( +#ifdef __SMARTPHONE__ + 0,GetCharHeight() +#else // !__SMARTPHONE__ + GetSystemMetrics(is_vertical ? SM_CXVSCROLL : SM_CXHSCROLL), + GetSystemMetrics(is_vertical ? SM_CYVSCROLL : SM_CYHSCROLL) +#endif // __SMARTPHONE__/!__SMARTPHONE__ + ); + + // correct size as for undocumented MSW variants cases (WinCE and perhaps others) + if (bestSize.x==0) + bestSize.x = bestSize.y; + if (bestSize.y==0) + bestSize.y = bestSize.x; + + // double size according to layout if (is_vertical) - { - // vertical control - return wxSize(GetSystemMetrics(SM_CXVSCROLL), - 2*GetSystemMetrics(SM_CYVSCROLL)); - } + bestSize.y *= 2; else - { - // horizontal control - return wxSize(2*GetSystemMetrics(SM_CXHSCROLL), - GetSystemMetrics(SM_CYHSCROLL)); - } + bestSize.x *= 2; + + return bestSize; } /* static */ wxVisualAttributes