Is there a way to calculate the total number of rows a body of text takes up in a field? Or perhaps the total "height," in pixels, of all of the text in a scrolling field?
I'm trying to mimic the typewriter-scrolling effect used in some writing apps (such as Scrivener) that keeps the cursor in the middle row of the field as you type.
Thanks.
Tony
Calculate the number of rows in a scrolling field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Calculate the number of rows in a scrolling field
Yes.
Do any of these help: the "textHeightSum". the "textHieght". the number of lines of fld "yourField", the "formattedText"
Also. the "effective" keyword.
Also watch out for fields with dontWrap set to "true". This is where the formattedText is invaluable
With these and other tools, you can set the selection to a chunk expression as needed.
Check the dictionary for all of these terms, and practice a bit.
Craig Newman
Do any of these help: the "textHeightSum". the "textHieght". the number of lines of fld "yourField", the "formattedText"
Also. the "effective" keyword.
Also watch out for fields with dontWrap set to "true". This is where the formattedText is invaluable
With these and other tools, you can set the selection to a chunk expression as needed.
Check the dictionary for all of these terms, and practice a bit.
Craig Newman
Re: Calculate the number of rows in a scrolling field
Yes, that's a great starting point for me. (Well, after a few hours of going nowhere, fast...) Thanks!dunbarx wrote:Do any of these help: the "textHeightSum". the "textHieght". the number of lines of fld "yourField", the "formattedText"
Also. the "effective" keyword.
Also watch out for fields with dontWrap set to "true". This is where the formattedText is invaluable
With these and other tools, you can set the selection to a chunk expression as needed.
Check the dictionary for all of these terms, and practice a bit.
Tony
Re: Calculate the number of rows in a scrolling field
Good.
Also check out the "selectedLine", and, for that matter, all dictionary entries that begin with "selected".
Craig
Also check out the "selectedLine", and, for that matter, all dictionary entries that begin with "selected".
Craig