X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9923c37dccb4e5dbe6387ceb3ab0a8202fadc231..28dfea7754424218398d2a7bd4e6bbbd253d7933:/src/os2/slider.cpp diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index 7662c87bfb..1dec64ffc2 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -23,6 +23,8 @@ #include #endif +#if wxUSE_SLIDER + #include "wx/slider.h" #include "wx/os2/private.h" @@ -64,11 +66,12 @@ void wxSlider::AdjustSubControls( int nCy; int nCyf; char zBuf[300]; + wxFont vFont = this->GetFont(); wxGetCharSize( GetHWND() ,&nCx ,&nCy - ,&this->GetFont() + ,&vFont ); if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL) @@ -79,10 +82,10 @@ void wxSlider::AdjustSubControls( int nMaxLen = 0; ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); - GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); - GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); if (m_hStaticValue) { @@ -130,10 +133,10 @@ void wxSlider::AdjustSubControls( int nMaxLen = 0; ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); - GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); - GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); if (m_hStaticValue) { @@ -460,7 +463,7 @@ bool wxSlider::Create( ,(PVOID)&lColor ); SetValue(nValue); - return TRUE; + return true; } // end of wxSlider::Create void wxSlider::DoSetSize( @@ -483,6 +486,7 @@ void wxSlider::DoSetSize( int nCurrentX; int nCurrentY; char zBuf[300]; + wxFont vFont = this->GetFont(); // // Adjust for OS/2's reverse coordinate system @@ -528,7 +532,7 @@ void wxSlider::DoSetSize( wxGetCharSize( GetHWND() ,&nCx ,&nCy - ,&this->GetFont() + ,&vFont ); if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL) @@ -539,9 +543,9 @@ void wxSlider::DoSetSize( int nMaxLen = 0; ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); - GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); - GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); if (m_hStaticValue) { @@ -646,9 +650,9 @@ void wxSlider::DoSetSize( int nMaxLen; ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf); - GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont); ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf); - GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont()); + GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont); if (m_hStaticValue) { int nNewWidth = wxMax(nMinLen, nMaxLen); @@ -862,8 +866,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 @@ -939,7 +945,7 @@ bool wxSlider::OS2OnScroll( break; default: - return FALSE; + return false; } int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd() @@ -968,7 +974,7 @@ bool wxSlider::OS2OnScroll( // // Out of range - but we did process it // - return TRUE; + return true; } SetValue(nNewPos); @@ -1166,6 +1172,7 @@ bool wxSlider::Show( ::WinShowWindow((HWND)m_hStaticMin, bShow); if(m_hStaticMax) ::WinShowWindow((HWND)m_hStaticMax, bShow); - return TRUE; + return true; } // end of wxSlider::Show +#endif // wxUSE_SLIDER