Field editing question
J. Landman Gay
jacque at hyperactivesw.com
Wed Jan 14 14:25:56 EST 2004
On 1/14/04 12:32 PM, Mark Wieder wrote:
> hi-
>
> I've got what is probably a simple question, but I'm too dense this
> morning to figure it out on my own.
Don't think so; I had to do this once and the method I used before
doesn't work now. I think there is a bug in "selectedchunk". Instead of
returning the location of the blinking insertion point, it is returning
the clicktext of the locked field. It didn't used to.
> I've got two fields on a card, one of which has some text I'm editing,
> and the other is a locked field with a set of phrases to choose from.
> What I'd like to do is click (or double-click or whatever) on the
> locked field to select a phrase and have it inserted into my text in
> the editing field *at the place I was editing*.
>
> I can get the phrase with a mouseUp handler, and I don't have a
> problem placing it before the editing text or after the editing text,
> but figuring out how to set a bookmark and use it as an insertion
> point is escaping me right now. Anyone have a recipe for this?
This workaround seems to do it, but it is a hack:
In the editable field:
on keydown
global gSel
put the selectedchunk into gSel
pass keydown
end keydown
In the list field:
on mouseUp
global gSel
do "put the value of the clickline into" && gSel
end mouseUp
It's ugly.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list