Lock the thumbPosition of scrollbar

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
shalu
Posts: 72
Joined: Fri Mar 20, 2015 1:05 pm

Lock the thumbPosition of scrollbar

Post by shalu » Fri Nov 13, 2015 6:59 am

Hi All,

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

Thanks
Shalu
--
Thanks
Shalu S

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Lock the thumbPosition of scrollbar

Post by Klaus » Fri Nov 13, 2015 2:13 pm

Hi Shalu,

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


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Lock the thumbPosition of scrollbar

Post by dunbarx » Fri Nov 13, 2015 3:22 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Lock the thumbPosition of scrollbar

Post by Klaus » Fri Nov 13, 2015 3:44 pm

Code: Select all

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Lock the thumbPosition of scrollbar

Post by dunbarx » Fri Nov 13, 2015 3:53 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Lock the thumbPosition of scrollbar

Post by Klaus » Fri Nov 13, 2015 4:07 pm

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

Post Reply