Why... is the selected text deselected?

Jan Schenkel janschenkel at yahoo.com
Tue Feb 18 15:53:01 EST 2003


--- Alex Rice <alrice at ARCplanning.com> wrote:
> In the docs troubleshooting item "Why... is the
> selected text 
> deselected?", I was looking for an explanation of
> why a field's 
> selection is deselected just by moving from one card
> to the next. How 
> can I prevent this from happening? It makes my print
> screens routine 
> more complicated because the user's selections are
> missing, unless I 
> message each of my cards to do  my updateUI handler.
> 
> I've verified this with a stack containing only 2
> cards and 2 list 
> fields.
> 
> I tried setting autoHilite of the field to false,
> and putting this 
> handler, but then I can't select text at all.
> 
> on mouseDown
>      set the hilitedLines of me \
>        to (word 2 of the clickLine)
> end mouseDown
> 
> Alex Rice

Hi Alex,

Why don't you try something like this in your field
script:

local sHilitedLines

on selectionChanged
  put the hilitedLines of me into sHilitedLines
  pass selectionChanged
end selectionChanged

on revertSelection
  set the hilitedLines of me to sHilitedLines
end revertSelection

This way you can send a "revertSelection" to the field
when you return from your other stack.

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



More information about the use-livecode mailing list