+ if (m_windowStyle & wxSL_LEFT)
+ lMsStyle |= SLS_PRIMARYSCALE2; // if SLS_VERTICAL then SCALE2 is to the left
+ else if (m_windowStyle & wxSL_RIGHT)
+ lMsStyle |= SLS_PRIMARYSCALE1; // if SLS_VERTICAL then SCALE2 is to the right
+ else if (m_windowStyle & wxSL_TOP)
+ lMsStyle |= SLS_PRIMARYSCALE1; // if SLS_HORIZONTAL then SCALE1 is to the top
+ else if (m_windowStyle & wxSL_BOTTOM )
+ lMsStyle |= SLS_PRIMARYSCALE2; // if SLS_HORIZONTAL then SCALE1 is to the bottom
+ else if ( m_windowStyle & wxSL_BOTH )
+ lMsStyle |= SLS_PRIMARYSCALE1 | SLS_PRIMARYSCALE2;
+ else
+ lMsStyle |= SLS_PRIMARYSCALE2;
+
+ m_nPageSize = ((nMaxValue - nMinValue)/10);
+ vSlData.usScale1Increments = m_nPageSize;
+ vSlData.usScale2Increments = m_nPageSize;
+
+ HWND hScrollBar = ::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
+ ,WC_SLIDER // Window class
+ ,(PSZ)wxBuffer // Initial Text
+ ,(ULONG)lMsStyle // Style flags
+ ,0L, 0L, 0L, 0L // Origin -- 0 size
+ ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
+ ,HWND_TOP // initial z position
+ ,(HMENU)m_windowId // Window identifier
+ ,&vSlData // Slider control data
+ ,NULL // no Presentation parameters
+ );
+ m_nRangeMax = nMaxValue;
+ m_nRangeMin = nMinValue;
+
+ //
+ // Set the size of the ticks ... default to 6 pixels
+ //
+ ::WinSendMsg( hScrollBar
+ ,SLM_SETTICKSIZE
+ ,MPFROM2SHORT(SMA_SETALLTICKS, 6)
+ ,NULL
+ );
+ //
+ // Set the position to the initial value
+ //
+ ::WinSendMsg( hScrollBar
+ ,SLM_SETSLIDERINFO
+ ,MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_RANGEVALUE)
+ ,(MPARAM)nValue
+ );
+
+ m_hWnd = (WXHWND)hScrollBar;
+ SubclassWin(GetHWND());
+ ::WinSetWindowText((HWND)m_hWnd, "");
+ SetFont(pParent->GetFont());
+ if (m_windowStyle & wxSL_LABELS)