I'm sure I must be
overlooking something simple - - - - What I'm trying to do is have a
text field that detects when the user presses the character "*", and
when they do, it replaces that "*" with a bitmap graphic. (Using the
imageSource call).
I've got the below code which _almost_ does this, except that it
replaces all the astericks except the one that the user just pressed.
The trick here is that the user can click and put the cursor anywhere
in the text field, so it's not like I can just add an "*" to the last
char of the field and swap it out. I somehow need to find out the
position in the text field where the cursor is, and add the asterick,
and THEN run the "refreshnotes" handler.
on keydown theKey
if theKey = "*" then
refreshnotes
end if
pass keydown
end keydown
on refreshnotes
put the number of lines in field "notes" into temp
repeat with x = 1 to temp
if line x of field "notes" contains "*" then
put the length of line x of field "notes" into linelength
repeat with y = 1 to linelength
if char y of line x of field notes = "*" then
set the imageSource of char y of line x of field "notes" to
"checkbox"
end if
end repeat
end if
end repeat
end refreshnotes
_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution
- Re: Way to insert text where cursor is in field? Rob Gould
- Re: Way to insert text where cursor is in field? Dar Scott
- Re: Way to insert text where cursor is in field? Jeanne A. E. DeVoto
- Re: Way to insert text where cursor is in field? J. Landman Gay
