X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57f4f9255e3d70e219e6eabd68c3990c0f471f81..46697f31a56e92d865bb7a90a6093de14d4e8e5f:/src/msw/spinbutt.cpp diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 81857170d4..6e1ae0e4e5 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -220,16 +220,22 @@ wxSize wxSpinButton::DoGetBestSize() const int wxSpinButton::GetValue() const { + int n; #ifdef UDM_GETPOS32 if ( wxTheApp->GetComCtl32Version() >= 580 ) { // use the full 32 bit range if available - return ::SendMessage(GetHwnd(), UDM_GETPOS32, 0, 0); + n = ::SendMessage(GetHwnd(), UDM_GETPOS32, 0, 0); } #endif // UDM_GETPOS32 // we're limited to 16 bit - return (short)LOWORD(::SendMessage(GetHwnd(), UDM_GETPOS, 0, 0)); + n = (short)LOWORD(::SendMessage(GetHwnd(), UDM_GETPOS, 0, 0)); + + if (n < m_min) n = m_min; + if (n > m_max) n = m_max; + + return n; } void wxSpinButton::SetValue(int val)