X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/757cc9def70e4685054f4a24238e2df111f6c9fd..09990d5a4f70a87b81bfb8e23f94357e7d171c9f:/src/os2/slider.cpp?ds=sidebyside diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index 574aa25b43..db9beff768 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -58,7 +58,6 @@ void wxSlider::AdjustSubControls( , int nSizeFlags ) { - SWP vSwp; int nXOffset = nX; int nYOffset = nY; int nCx; // slider,min,max sizes @@ -204,9 +203,7 @@ bool wxSlider::Create( , const wxPoint& rPos , const wxSize& rSize , long lStyle -#if wxUSE_VALIDATORS , const wxValidator& rValidator -#endif , const wxString& rsName ) { @@ -286,7 +283,7 @@ bool wxSlider::Create( if (m_windowStyle & wxSL_VERTICAL) lMsStyle = SLS_VERTICAL | SLS_HOMEBOTTOM | WS_VISIBLE | WS_TABSTOP; else - lMsStyle = SLS_HORIZONTAL | SLS_HOMELEFT| WS_VISIBLE | WS_TABSTOP; + lMsStyle = SLS_HORIZONTAL | SLS_HOMELEFT | WS_VISIBLE | WS_TABSTOP; if (m_windowStyle & wxCLIP_SIBLINGS) lMsStyle |= WS_CLIPSIBLINGS; @@ -554,7 +551,7 @@ void wxSlider::DoSetSize( ::WinSetWindowPos( (HWND)m_hStaticValue ,HWND_TOP ,(LONG)nXOffset - ,(LONG)nYOffset - (nCyf * 1.2) + ,(LONG)nYOffset - (LONG)(nCyf * 1.2) ,(LONG)nNewWidth ,(LONG)nValueHeight ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW @@ -564,7 +561,7 @@ void wxSlider::DoSetSize( ::WinSetWindowPos( (HWND)m_hStaticMin ,HWND_TOP ,(LONG)nXOffset - ,(LONG)nYOffset - (nCyf * 1.2) + ,(LONG)nYOffset - (LONG)(nCyf * 1.2) ,(LONG)nMinLen ,(LONG)nCy ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW @@ -604,7 +601,7 @@ void wxSlider::DoSetSize( ::WinSetWindowPos( (HWND)m_hStaticMax ,HWND_TOP ,(LONG)nXOffset - ,(LONG)nYOffset - (nCyf * 1.2) + ,(LONG)nYOffset - (LONG)(nCyf * 1.2) ,(LONG)nMaxLen ,(LONG)nCy ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW @@ -657,10 +654,6 @@ void wxSlider::DoSetSize( int nNewWidth = wxMax(nMinLen, nMaxLen); int nValueHeight = nCyf; - // - // The height needs to be a bit bigger under Win95 if using native - // 3D effects. - // ::WinSetWindowPos( (HWND)m_hStaticValue ,HWND_TOP ,(LONG)nXOffset @@ -869,8 +862,10 @@ void wxSlider::GetSize( wxFindMaxSize( m_hStaticValue ,&vRect ); - *pnWidth = vRect.xRight - vRect.xLeft; - *pnHeight = vRect.yBottom - vRect.yTop; + if (pnWidth) + *pnWidth = vRect.xRight - vRect.xLeft; + if (pnHeight) + *pnHeight = vRect.yTop - vRect.yBottom; } // end of wxSlider::GetSize int wxSlider::GetThumbLength() const @@ -967,7 +962,7 @@ bool wxSlider::OS2OnScroll( ,(MPARAM)0 ) ); - nNewPos = (nPixelPos/m_dPixelToRange); + nNewPos = (int)(nPixelPos/m_dPixelToRange); if (nNewPos > (m_nRangeMax - m_nRangeMin)/2) nNewPos++; if ((nNewPos < GetMin()) || (nNewPos > GetMax())) @@ -1086,7 +1081,7 @@ void wxSlider::SetTick( int nTickPos ) { - nTickPos *= m_dPixelToRange; + nTickPos = (int)(nTickPos * m_dPixelToRange); ::WinSendMsg( GetHwnd() ,SLM_ADDDETENT ,MPFROMSHORT(nTickPos) @@ -1124,7 +1119,7 @@ void wxSlider::SetTickFreq( ::WinSendMsg(GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vWndParams, (MPARAM)0); for (i = 1; i < (m_nRangeMax - m_nRangeMin)/n; i++) { - nPixelPos = i * n * m_dPixelToRange; + nPixelPos = (int)(i * n * m_dPixelToRange); ::WinSendMsg( GetHwnd() ,SLM_ADDDETENT ,MPFROMSHORT(nPixelPos) @@ -1137,14 +1132,6 @@ void wxSlider::SetValue( int nValue ) { - int nPixelPos = SHORT1FROMMR(::WinSendMsg( GetHwnd() - ,SLM_QUERYSLIDERINFO - ,MPFROM2SHORT( SMA_SLIDERARMPOSITION - ,SMA_RANGEVALUE - ) - ,(MPARAM)0 - ) - ); int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd() ,SLM_QUERYSLIDERINFO ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS