RE: Scrollbar 'Handle' Size
- Posted by "C. K. Lester" <cklester at yahoo.com> Oct 01, 2002
- 399 views
Euman! Good to hear from you! Thought you had dropped off. Glad to know you're still alive and programmin' like a fiend. :) > > http://www.rapideuphoria.com/winapi5.zip > > and this is the code you should be looking at: > > elsif iMsg = WM_HSCROLL then > > scroll_param = LOWORD(wParam) > > if scroll_param = SB_THUMBTRACK or scroll_param = > SB_THUMBPOSITION then > orgX = HIWORD(wParam) > if orgX < 0 then orgX = 0 end if > > elsif scroll_param = SB_LINERIGHT then > > if orgX < vxScreen-peek4s(rect_Right) then > orgX += 1 > end if > > elsif scroll_param = SB_LINELEFT then > > if orgX > 0 then > orgX -= 1 > end if > > elsif scroll_param = SB_PAGERIGHT then > > if orgX + 15 < vxScreen-peek4s(rect_Right) then > orgX += 15 > end if > > elsif scroll_param = SB_PAGELEFT then > > if orgX > 0 then > if orgX - 15 > 0 then > orgX -= 15 > else > orgX -= 1 > end if > end if > > end if > > poke4(sifMask, SIF_POS) > poke4(sifPos, orgX) > ok = c_func(xSetScrollInfo,{hwnd, SB_HORZ, si, 1}) > > return c_func(xInvalidateRect, {hwnd, NULL, 0}) > > > elsif iMsg = WM_VSCROLL then > > scroll_param = LOWORD(wParam) > > if scroll_param = SB_THUMBTRACK or scroll_param = > SB_THUMBPOSITION then > orgY = HIWORD(wParam) > > if orgX < 0 then orgX = 0 end if > > elsif scroll_param = SB_LINEDOWN then > if orgY < vyScreen-peek4s(rect_Bottom) then > orgY += 1 > end if > > elsif scroll_param = SB_LINEUP then > if orgY > 0 then > orgY -= 1 > end if > > elsif scroll_param = SB_PAGEDOWN then > if orgY + 15 < vyScreen-peek4s(rect_Bottom) then > orgY += 15 > end if > > elsif scroll_param = SB_PAGEUP then > > if orgY > 0 then > if orgY - 15 > 0 then > orgY -= 15 > else > orgY -= 1 > end if > end if > > elsif scroll_param = SB_TOP then > orgY = 0 > > elsif scroll_param = SB_BOTTOM then > orgY = (vyScreen/2) + peek4s(rect_Bottom) - 65 > > end if > > poke4(sifMask, SIF_POS) > poke4(sifPos, orgY) > ok = c_func(xSetScrollInfo,{hwnd, SB_VERT, si, 1}) > > return c_func(xInvalidateRect, {hwnd, NULL, 0}) > <snip> > >