Field Scroll Problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Field Scroll Problem
Maybe you could handle the textChanged message in the field script to set the vScroll whenever the content changes.
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
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.
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.
"Do the right thing and everything else will take care of it's self."
Re: Field Scroll Problem
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 -Ralph Forehand wrote: ↑Sat Feb 10, 2018 11:58 pmI 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.
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
-
- VIP Livecode Opensource Backer
- Posts: 7210
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Field Scroll Problem
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:Ralph Forehand wrote: ↑Sat Feb 10, 2018 11:58 pmset 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 .
Code: Select all
set the HCAddressing of this stack to false
(I'd go with the textchanged handler in the field, too.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Field Scroll Problem
Yes, but the default can be changed very easily in this case.
-
- Livecode Opensource Backer
- Posts: 42
- Joined: Thu Jan 04, 2007 8:05 pm
- Location: Maryland, USA
Re: Field Scroll Problem
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
Have returned to ising back-up Stack for a while.
THANK YOU ALL for your support and input.
TAKE CARE,
Ralph
"Do the right thing and everything else will take care of it's self."
Re: Field Scroll Problem
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.