+void wxSlider::AdjustSubControls( int nX,
+ int nY,
+ int nWidth,
+ int nHeight,
+ int WXUNUSED(nSizeFlags) )
+{
+ int nXOffset = nX;
+ int nYOffset = nY;
+ int nCx; // slider,min,max sizes
+ int nCy;
+ int nCyf;
+ wxChar zBuf[300];
+ wxFont vFont = this->GetFont();
+
+ wxGetCharSize( GetHWND()
+ ,&nCx
+ ,&nCy
+ ,&vFont
+ );
+
+ if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
+ {
+ if (m_windowStyle & wxSL_LABELS )
+ {
+ int nMinLen = 0;
+ int nMaxLen = 0;
+
+ ::WinQueryWindowText((HWND)m_hStaticMin, 300, (PSZ)zBuf);
+ GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
+
+ ::WinQueryWindowText((HWND)m_hStaticMax, 300, (PSZ)zBuf);
+ GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
+
+ 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, (PSZ)zBuf);
+ GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
+
+ ::WinQueryWindowText((HWND)m_hStaticMax, 300, (PSZ)zBuf);
+ GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
+
+ 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
+