Re: Scrollbar 'Handle' Size

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello,

Been a while since Ive posted anything due to physical disabilities.
Here is a bit of code I used in my WinAPI5 demo that can be D/Led
from RDS contrib page:

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})

Maybe helpfull to a non-Win32liber out there...
maybe someone could wrap this up in the lib?

Euman
euman at bellsouth.net

==================================================================
The information contained in this message may be confidential
and is intended to be exclusively for the addressee. Should you
receive this message unintentionally, please do not use the contents
herein and notify the sender immediately by return e-mail.
==================================================================
----- Original Message -----
From: "Don Phillips" <EuNexus at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, September 30, 2002 11:35 PM
Subject: Re: Scrollbar 'Handle' Size


>
>
> Yes, it is possible, but its a pain.  I might still have some old code to do
> this laying around in one of my folders.  I
will see if I can dig it up somewhere.  It involves a bit of math, but nothing
too fancy.
> And that doo-hickey's technical term is 'Scroll Box' (or sometimes called a
> 'thumb').
> Don Phillips
>
> Hi all,
>
> Is there a way to change the size of the 'handle' (I don't know what
> it's called in MS Windows parlance) in a window's scrollbar so that
> it doesn't have to be dragged the full height of the window just
> to move down a few pixels?
>
> Just what is that hicky-doo called anyway?
>
> -Ron T.
>
>
> <P>Yes, it is possible, but its a pain.&nbsp; I might still have some old code
> to do this laying around in one of my
folders.&nbsp; I will see if I can dig it up somewhere.&nbsp; It involves a bit
of math, but nothing too fancy.
> <P>And that doo-hickey's technical term is 'Scroll Box' (or sometimes called a
> 'thumb').
> <P>Don Phillips
> <P>&nbsp;<B><I>Ron Tarrant <RTARRANT at SYMPATICO.CA></I></B>wrote:
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu