Find the scroll location in wrapped field

dunbarx at aol.com dunbarx at aol.com
Mon Nov 17 12:53:18 EST 2014


Hi.


This is an ongoing thread on the forums. Your query is a bit more straightforward, but still bears discussion. Think about a field 2 with lots of lines in it, one of which is "ccc". In a button script:



on mouseUp
   set the textheight of fld 2 to 14
   set the scroll of fld 2 to 10000
   find "ccc" in fld 2
 set the scroll of fld 2 to word 2 of the foundLine * the textheight of fld 2 - the textheight of fld 2
end mouseUp


The issues revolve around why setting the scroll to the bottom is needed, and in the other case, complications arise when each line has a different textHeight. You should monitor that thread. Anyway, this works.


Craig Newman



-----Original Message-----
From: Michael Doub <mikedoub at gmail.com>
To: How To use LiveCode use LiveCode <use-livecode at lists.runrev.com>
Sent: Mon, Nov 17, 2014 10:27 am
Subject: Find the scroll location in wrapped field


If I have a single line that is within a non fixed line height field 
that is word wrapped.   How does one find the amount to set the vScroll 
if the word has been wrapped?

I am trying to set the scroll so the word is positioned as the first 
visible line.

Thanks
   Mike


_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list