-// TODO:
-/*
- *viewStart = ::GetScrollPos((HWND)m_hWnd, SB_CTL);
- *viewLength = m_viewSize;
- *objectLength = m_objectSize;
- *pageLength = m_pageSize;
-*/
-}
-#endif
-
-WXHBRUSH wxScrollBar::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
-{
- return 0;
-}
-
-void wxScrollBar::Command(wxCommandEvent& event)
+ SBCDATA vInfo;
+ //
+ // The lRange (number of scroll steps) is the
+ // object length minus the page size.
+ //
+ int nRange1 = wxMax((m_nObjectSize - m_nPageSize), 0);
+
+ m_nViewSize = nPageSize;
+ m_nPageSize = nThumbSize;
+ m_nObjectSize = nRange;
+
+
+ //
+ // Try to adjust the lRange to cope with page size > 1
+ // (see comment for SetPageLength)
+ //
+ if (m_nPageSize > 1 )
+ {
+ nRange1 += (m_nPageSize - 1);
+ }
+ vInfo.cb = sizeof(SBCDATA);
+ vInfo.cVisible = (SHORT)m_nPageSize;
+ vInfo.posFirst = 0;
+ vInfo.posLast = (SHORT)nRange1;
+ vInfo.posThumb = (SHORT)nPosition;
+
+ ::WinSendMsg((HWND)GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vInfo, (MPARAM)NULL);
+} // end of wxScrollBar::SetScrollbar
+
+WXHBRUSH wxScrollBar::OnCtlColor ( WXHDC WXUNUSED(hDC),
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(uCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam) )