Brad
In order to hilite the entire line include the actual
carriage return
character as part of your line selection. Do this by
adding 1 to your
selection length.
I tend to create a list of start and length positions
on beginSprite for
each line in my field as a means of quick reference
(caching hilites if you
will) during run time.
Drop this code into your script...
property fieldMember
property hiliteCache
on beginSprite me
fieldMember = member("Menu") -- obviously this
depends on what field you
are using
hiliteCache = BuildHiliteCache
end
on BuildHiliteCache
positions = [1]
repeat with theLine = 2 to (fieldMember.lineCount +
1)
prevStart = getAt(positions, theLine - 1)
prevLength = fieldMember.line[theLine -
1].char.count
startPos = (prevLength + prevStart) + 1
addAt(positions, theLine, startPos)
end repeat
return positions
end
I then call the hilite position using the following
handler usually from a
prepareFrame script...
on HiliteItem
if the mouseLine <> -1 then -- i.e. the mouse is
over the field
theLine = the mouseLine
firstChar = getAt(hilitePositions, theLine)
theLength = fieldMember.line[theLine].char.count
lastChar = firstChar + theLength
fieldMember.char[firstChar..lastChar].hilite()
else
fieldMember.char[the maxInteger].hilite()
end if
end
The script is obviously coded for field members. As it
uses hilite() to
hilite the line it won't work with text members, but
you can use the same
principles for caching the hilite positions.
Hope this helps!!
P.S. Calling all posters: As I'm so rushed off my feet
with uni work (of
which this is a part of) I haven't got time to fully
optimise the code. If
you have any suggestion on how to shrink this down,
give me a shout.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]