Passing Click from Image to Field?

Trevor DeVore lists at mangomultimedia.com
Tue Dec 28 17:13:42 EST 2004


On Dec 28, 2004, at 2:12 PM, Scott Rossi wrote:
>
> Thanks to you and Jonathan Lynch for this idea.  I need to account for 
> the
> scroll of the field as well since it's a scrolling list.  I guess I 
> have to
> add the scroll of the field multiplied by the textHeight of the field 
> to
> figure out the equivalent clicked line.  Hmmm...
>
> This is getting complicated but I guess it's my lot in life to develop
> overly complex solutions. :-)

I sent an example that does this but it hasn't gone through yet 
apparently.  Anyhow, this one is a little prettier then the first one I 
sent:

on mouseMove pX, pY
	subtract top of fld "MyField" + borderWidth of fld "MyField" from pY
	put max(0, \
			min(number of lines of text of fld "MyField", \
				trunc((pY + vScroll of fld "MyField") / effective textHeight of fld 
"MyField") + 1) \
		) into tLine
	put "Line:" && tLine
end mouseMove


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com



More information about the use-livecode mailing list