+void wxSlider::AdjustSubControls(
+ int nX
+, int nY
+, int nWidth
+, int nHeight
+, int nSizeFlags
+)
+{
+ SWP vSwp;
+ int nXOffset = nX;
+ int nYOffset = nY;
+ int nCx; // slider,min,max sizes
+ int nCy;
+ int nCyf;
+ char zBuf[300];
+
+ wxGetCharSize( GetHWND()
+ ,&nCx
+ ,&nCy
+ ,&this->GetFont()
+ );
+
+ if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
+ {
+ if (m_windowStyle & wxSL_LABELS )
+ {
+ int nMinLen = 0;
+ int nMaxLen = 0;
+
+ ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
+ GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont());
+
+ ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
+ GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont());
+
+ if (m_hStaticValue)
+ {
+ int nNewWidth = wxMax(nMinLen, nMaxLen);
+ int nValueHeight = nCyf;
+
+ ::WinSetWindowPos( (HWND)m_hStaticValue
+ ,HWND_TOP
+ ,(LONG)nXOffset - (nNewWidth + nCx + nMinLen + nCx)
+ ,(LONG)nYOffset
+ ,(LONG)nNewWidth
+ ,(LONG)nValueHeight
+ ,SWP_SIZE | SWP_MOVE
+ );
+ }
+ ::WinSetWindowPos( (HWND)m_hStaticMin
+ ,HWND_TOP
+ ,(LONG)nXOffset - (nMinLen + nCx)
+ ,(LONG)nYOffset
+ ,(LONG)nMinLen
+ ,(LONG)nCyf
+ ,SWP_SIZE | SWP_MOVE
+ );
+ nXOffset += nWidth + nCx;
+
+ ::WinSetWindowPos( (HWND)m_hStaticMax
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset
+ ,(LONG)nMaxLen
+ ,(LONG)nCyf
+ ,SWP_ZORDER | SWP_SHOW
+ );
+ }
+ }
+ else
+ {
+ //
+ // Now deal with a vertical slider
+ //
+
+ if (m_windowStyle & wxSL_LABELS )
+ {
+ int nMinLen = 0;
+ int nMaxLen = 0;
+
+ ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
+ GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont());
+
+ ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
+ GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont());
+
+ if (m_hStaticValue)
+ {
+ int nNewWidth = (wxMax(nMinLen, nMaxLen));
+
+ ::WinSetWindowPos( (HWND)m_hStaticValue
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset + nHeight + nCyf
+ ,(LONG)nNewWidth
+ ,(LONG)nCyf
+ ,SWP_SIZE | SWP_MOVE
+ );
+ }
+ ::WinSetWindowPos( (HWND)m_hStaticMax
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset + nHeight
+ ,(LONG)nMaxLen
+ ,(LONG)nCyf
+ ,SWP_SIZE | SWP_MOVE
+ );
+ ::WinSetWindowPos( (HWND)m_hStaticMin
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset - nCyf
+ ,(LONG)nMinLen
+ ,(LONG)nCyf
+ ,SWP_SIZE | SWP_MOVE
+ );
+ }
+ }
+} // end of wxSlider::AdjustSubControls
+