- MoveWindow((HWND) m_staticMin, x_offset, y_offset, (int)min_len, cy, TRUE);
- y_offset += cy;
-
- int slider_length = (int)(h1 - y_offset - cy - cy);
-
- int slider_width = w1;
- if (slider_width < 0 )
- slider_width = 20;
-
- // Slider must have a minimum/default length
- if (slider_length < 100)
- slider_length = 100;
-
- MoveWindow(GetHwnd(), x_offset, y_offset, slider_width, slider_length, TRUE);
- y_offset += slider_length;
-
- MoveWindow((HWND) m_staticMax, x_offset, y_offset, (int)max_len, cy, TRUE);
+ ::WinQueryWindowRect(HWND_DESKTOP, &vRect);
+ nYOffset = vRect.yTop - (nYOffset + nOS2Height);
+ if (nY != -1)
+ nY1 = vRect.yTop - (nY1 + nOS2Height);
+ }
+ 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
+ ,&vFont
+ );
+
+ 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, &vFont);
+ ::WinQueryWindowText((HWND)m_hStaticMax, 300, 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
+ ,(LONG)nYOffset - (LONG)(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 - (LONG)(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 - (LONG)(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
+ );
+ }