Page 2 of 2
Re: Field Scroll Problem
Posted: Sat Feb 10, 2018 9:33 pm
by SparkOut
Maybe you could handle the textChanged message in the field script to set the vScroll whenever the content changes.
Re: Field Scroll Problem
Posted: Sat Feb 10, 2018 11:58 pm
by Ralph Forehand
set the vscroll of cd field "Play Result" to (the effective textheight of cd field "Play Result") * (the number of lines in cd field "Play Result")
Yes, the above works BUT requires “cd” with field ID - perhaps because this is a HyperCard stack I converted to Revolution/LiveCode years ago and have been using successfulliy . Before I changed the field and text size the field worked as I want - text added to end of field and scroll to stay there .
I enter text from other buttons/fields/message box/keyboard (all on same card)and add to end of field. So adding the above code every time is not practical. What I need is a one time vScroll setting of the field.

Re: Field Scroll Problem
Posted: Sun Feb 11, 2018 2:57 am
by bogs
Ralph Forehand wrote: Sat Feb 10, 2018 11:58 pm
I enter text from other buttons/fields/message box/keyboard (all on same card)and add to end of field. So adding the above code every time is not practical. What I need is a one time vScroll setting of the field.
You should be able to put that code in any handler and have it work, since it is a field i'd probably roll with sticking it in textChanged of the field itself -
Code: Select all
on textchanged
set the vscroll of field "Field" to (the effective textheight of field "Field") * (the number of lines in field "Field")
end textchanged
That should work no matter where the text gets changed from.
Re: Field Scroll Problem
Posted: Sun Feb 11, 2018 7:45 pm
by jacque
Ralph Forehand wrote: Sat Feb 10, 2018 11:58 pm
set the vscroll of cd field "Play Result" to (the effective textheight of cd field "Play Result") * (the number of lines in cd field "Play Result")
Yes, the above works BUT requires “cd” with field ID - perhaps because this is a HyperCard stack I converted to Revolution/LiveCode years ago and have been using successfulliy .
Yes, that's the reason. For compatibility, imported HC stacks retain original HC references. You can make the stack resolve field and button references like LC does by doing this once from the message box:
Code: Select all
set the HCAddressing of this stack to false
(I'd go with the textchanged handler in the field, too.)
Re: Field Scroll Problem
Posted: Sun Feb 11, 2018 7:54 pm
by bogs
jacque wrote: Sun Feb 11, 2018 7:45 pm
(I'd go with the textchanged handler in the field, too.)
...and if all that fails, you can go with 2 big macs, fries, and a soda for $5.00 like I do! Ah the joys of comfort food

Re: Field Scroll Problem
Posted: Tue Feb 13, 2018 2:42 pm
by bogs
Yes, but the default can be changed very easily in this case.
Re: Field Scroll Problem
Posted: Sat Feb 17, 2018 4:35 pm
by Ralph Forehand
Have tried all the above without success?
Have returned to ising back-up Stack for a while.
THANK YOU ALL for your support and input.
TAKE CARE,
Ralph
Re: Field Scroll Problem
Posted: Sat Feb 17, 2018 5:02 pm
by bogs
Hm. I was diddling around with fields this morning in the quest for more knowledge, there is another place the code I put might be universally targeting a field, and that is in the 'on closeField' handler. Note though, if used, be specific on the field you want it to target, and pass it if you have other fields that change text.

- closeField
- Selection_005.png (6.14 KiB) Viewed 7657 times