Scrolling field relative vScroll setting

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
cogpsyc
Posts: 3
Joined: Wed Sep 07, 2016 2:29 pm

Scrolling field relative vScroll setting

Post by cogpsyc » Wed Sep 07, 2016 2:39 pm

I have a scrolling field that users type text into. Currently, if users input more text than can be seen in the size of the field they have to stop typing and manually move the thumbposition of the vScroll down to see what they are typing. I would like for the vScroll/thumbposition of the vScroll to reset itself automatically so that users do not have to manually move the thumb position to see what they are typing. I know this must be possible but I have not found the answer yet. ... using the line number strategy to reset the vScroll does not work because users' input is one continuous (wrapped) line of text. Any hints?

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

Re: Scrolling field relative vScroll setting

Post by Klaus » Wed Sep 07, 2016 2:54 pm

Hi cogpsych,

1. welcome to the forum! :D

2. I used something like this in the fields script in the past and looks like this still works:

Code: Select all

on keyup tk
   ## Instead of calculating the neccessary scroll from the fields content & its line height
   ## I set the scroll to some laughable number and LC does not complain :-D
   set the scroll of me to 100000000
   pass keyup
end keyup
Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Scrolling field relative vScroll setting

Post by FourthWorld » Wed Sep 07, 2016 3:44 pm

The behavior described in the OP should be automatic. It has been on the platforms I've deployed to for many years.

cogpsych, what OS are you seeing this on, and in which version of LC?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Scrolling field relative vScroll setting

Post by Klaus » Wed Sep 07, 2016 4:41 pm

Hi Richard,
The behavior described in the OP should be automatic.
it does, but not completely, see attached screenshot from LC 8.02 on OS X 10.11.6.


Best

Klaus
autoscrolling.jpg
autoscrolling.jpg (29.26 KiB) Viewed 3432 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Scrolling field relative vScroll setting

Post by FourthWorld » Wed Sep 07, 2016 5:37 pm

Bug. I'd report it so it can be fixed before 8.1 goes final.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

cogpsyc
Posts: 3
Joined: Wed Sep 07, 2016 2:29 pm

Re: Scrolling field relative vScroll setting

Post by cogpsyc » Thu Sep 08, 2016 12:58 pm

I am using an older version Livecode 5.5.5

cogpsyc
Posts: 3
Joined: Wed Sep 07, 2016 2:29 pm

Re: Scrolling field relative vScroll setting

Post by cogpsyc » Thu Sep 08, 2016 1:02 pm

Thanks Klaus the clip of code you shared worked perfectly!

Post Reply