1. Scrollbar 'Handle' Size

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.

new topic     » topic index » view message » categorize

2. Re: Scrollbar 'Handle' Size

--0-582014887-1033446950=:57312


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:
--0-582014887-1033446950=:57312--

new topic     » goto parent     » topic index » view message » categorize

3. Re: Scrollbar 'Handle' Size

Hi Ron,

see setWindowScrollRange() in the 0.57.x win32lib tree.
It has paramter pageSize to set this. For example, if your
window has scroll range 0..99, and pageSize=50, the thumb
size is half the scrollbar.

    Martin


> 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.
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: Scrollbar 'Handle' Size

--0-1378202356-1033502219=:89139


Bah!  Dont have the code anymore.  So much for posting a complete example.  If
your boned up on the Windows API then I can point you in the right direction
though.
Setting the Scroll Box's size revolves around two APIs.  GetScrollInfo and
SetScrollInfo.  In each of these, the LPSCROLLINFO structure contains a field
called nPage which needs to be changed.  Pages size refers to how many visible
lines (verticle) or characters (horizontal) will fit in a window given a certain
size.  The math is simple enough.  If an edit control has 50 lines in it and can
display 10 given its current size; its Min should be 1, its Max should be 50 and
nPage 10.  Which would make the Scroll box 1/5th the total size of the Scoll bar.
 Hope this helps.
Don

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>Bah!&nbsp; Dont have the code anymore.&nbsp; So much for posting a complete
example.&nbsp; If your boned up on the Windows API then I can point you in the
right direction though.
<P>Setting the Scroll Box's size revolves around two APIs.&nbsp; GetScrollInfo
and SetScrollInfo.&nbsp; In each of these, the LPSCROLLINFO structure contains a
field called nPage which needs to be changed.&nbsp; Pages size refers to how many
visible lines (verticle) or characters (horizontal) will fit in a window given a
certain size.&nbsp; The math is simple enough.&nbsp; If an edit control has 50
lines in it and can display 10 given its current size; its Min should be 1, its
Max should be 50 and nPage 10.&nbsp; Which would make the Scroll box 1/5th the
total size of the Scoll bar.&nbsp; Hope this helps.
<P>Don
<P>&nbsp;<B><I>Ron Tarrant <RTARRANT at SYMPATICO.CA></I></B>wrote:
--0-1378202356-1033502219=:89139--

new topic     » goto parent     » topic index » view message » categorize

5. Re: Scrollbar 'Handle' Size

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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu