Page 1 of 1

Lock the thumbPosition of scrollbar

Posted: Fri Nov 13, 2015 6:59 am
by shalu
Hi All,

How I Lock the thumbPosition of scrollbar, Is it possible. :( :oops:

Thanks
Shalu

Re: Lock the thumbPosition of scrollbar

Posted: Fri Nov 13, 2015 2:13 pm
by Klaus
Hi Shalu,

you could DISABLE the scrollbar, but that is the only way
to prevent users from dragging the thumb!


Best

Klaus

Re: Lock the thumbPosition of scrollbar

Posted: Fri Nov 13, 2015 3:22 pm
by dunbarx
Hi.

Would you like a simply terrible way to do it? I am expert in that sort of crap. Put this into the script of the scrollbar:

Code: Select all

on scrollbarDrag
   wait until the mouse is up
end scrollbarDrag
Now can you exploit this horror into a controllable method of "locking out" the control?

Craig Newman

Re: Lock the thumbPosition of scrollbar

Posted: Fri Nov 13, 2015 3:44 pm
by Klaus

Code: Select all

on scrollbarDrag
   wait until the mouse is up
end scrollbarDrag
:shock: :shock: :shock:
Are you sure?

Re: Lock the thumbPosition of scrollbar

Posted: Fri Nov 13, 2015 3:53 pm
by dunbarx
Klaus,

When I say I am an expert at coding a load of crap, you cannot expect me to give all my secrets at once, eh? :roll:

Or to actually test it? :wink:

Shalu. Put this in the scrollBar script:

Code: Select all

local thumbVal

on mouseDown
   put the thumbPos of me into thumbVal
end mouseDown

on scrollbarDrag
   wait until the mouse is up
   set the thumbPos of me to thumbVal
end scrollbarDrag
Still a little "shake", though.

Craig

Re: Lock the thumbPosition of scrollbar

Posted: Fri Nov 13, 2015 4:07 pm
by Klaus
dunbarx wrote:Klaus,

When I say I am an expert at coding a load of crap, you cannot expect me to give all my secrets at once, eh? :roll:
Or to actually test it? :wink:
oops, sorry, I was not really aware of this... 8)

dunbarx wrote:

Code: Select all

local thumbVal
on mouseDown
   put the thumbPos of me into thumbVal
end mouseDown

on scrollbarDrag
   wait until the mouse is up
   set the thumbPos of me to thumbVal
end scrollbarDrag
OK, still ugly, but better :D