Visible lines in a scrolling field.

Ken Ray kray at sonsothunder.com
Fri Oct 14 21:51:50 EDT 2011


On Oct 14, 2011, at 10:49 AM, Bob Sneidar wrote:

> There is a property called the formattedHeight. There is also a property for the current scroll, not sure what it is called. Once you know the number of lines you have all the variables sorted. Between them you should get pretty close if not dead on. 

Right - if the point is to reduce the textSize of the lines until it fits the height of the field, you can do this:

put the formattedHeight of fld 1 into tFormattedHt
put the number of lines of fld 1 * the textHeight of fld 1 into tCurrHt

repeat until tCurrHt <= tFormattedHt
  if the textSize of fld 1 = 6 then exit repeat  -- don't want to get TOO small
  set the textSize of fld 1 to ((the textSize of fld 1)-1)
  put the number of lines of fld 1 * the textHeight of fld 1 into tCurrHt
end repeat


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	




More information about the use-livecode mailing list