- m_viewSize = pageSize;
- m_pageSize = thumbSize;
- m_objectSize = range;
-
- // The range (number of scroll steps) is the
- // object length minus the page size.
- int range1 = wxMax((m_objectSize - m_pageSize), 0) ;
-
-#if defined(__WIN95__)
- // Try to adjust the range to cope with page size > 1
- // (see comment for SetPageLength)
- if ( m_pageSize > 1 )
- {
- range1 += (m_pageSize - 1);
- }
-
- SCROLLINFO info;
- info.cbSize = sizeof(SCROLLINFO);
- info.nPage = m_pageSize;
- info.nMin = 0;
- info.nMax = range1;
- info.nPos = position;
-
- info.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
-
- ::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, refresh);
-#else
- ::SetScrollPos((HWND)m_hWnd, SB_CTL, position, TRUE);
- ::SetScrollRange((HWND)m_hWnd, SB_CTL, 0, range1, TRUE);
-#endif
-}