+ m_nSizeFlags = nSizeFlags;
+
+ GetPosition( &nCurrentX
+ ,&nCurrentY
+ );
+ if (nX == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ nX1 = nCurrentX;
+ if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ nY1 = nCurrentY;
+
+ AdjustForParentClientOrigin( nX1
+ ,nY1
+ ,nSizeFlags
+ );
+ 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
+ ,(LONG)nYOffset - (nCyf * 1.2)
+ ,(LONG)nNewWidth
+ ,(LONG)nValueHeight
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+ nXOffset += nNewWidth + nCx;
+ }
+ ::WinSetWindowPos( (HWND)m_hStaticMin
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset - (nCyf * 1.2)
+ ,(LONG)nMinLen
+ ,(LONG)nCy
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+ nXOffset += nMinLen + nCx;
+
+ int nSliderLength = nWidth1 - nXOffset - nMaxLen - nCx;
+ int nSliderHeight = nHeight1;
+
+ if (nSliderHeight < 0)
+ nSliderHeight = 20;
+
+ //
+ // Slider must have a minimum/default length/height
+ //
+ if (nSliderLength < 100)
+ nSliderLength = 100;
+
+ ::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset
+ ,(LONG)nSliderLength
+ ,(LONG)nSliderHeight
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+ ::WinQueryWindowPos(GetHwnd(), GetSwp());
+ ::WinSendMsg( GetHwnd()
+ ,SLM_SETSLIDERINFO
+ ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
+ ,0
+ )
+ ,MPFROMLONG((ULONG)(nSliderHeight/2))
+ );
+ nXOffset += nSliderLength + nCx;
+
+ ::WinSetWindowPos( (HWND)m_hStaticMax
+ ,HWND_TOP
+ ,(LONG)nXOffset
+ ,(LONG)nYOffset - (nCyf * 1.2)
+ ,(LONG)nMaxLen
+ ,(LONG)nCy
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+ }
+ else
+ {
+ //
+ // No labels
+ // If we're prepared to use the existing size, then...
+ //
+ if (nWidth == -1 && nHeight == -1 &&
+ ((nSizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
+ {
+ GetSize( &nWidth1
+ ,&nHeight1
+ );
+ }
+ if (nWidth1 < 0)
+ nWidth1 = 200;
+ if (nHeight1 < 0)
+ nHeight1 = 20;
+ ::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,(LONG)nX1
+ ,(LONG)nY1
+ ,(LONG)nWidth1
+ ,(LONG)nHeight1
+ ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+ );
+ }
+ }
+
+ //
+ // Now deal with a vertical slider
+ //