How can I keep selected text hilited?

Dr. Robert E. Ball reball at redshift.com
Mon Mar 20 19:34:33 EST 2006


Dan and Mark -- thank you so much. The selectionChanged was exactly what I
needed, but with the backgroundColor changed to yellow, not the
foregroundColor (which makes the text yellow, not the background).


On 3/20/06 4:16 PM, "Mark Talluto" <userev at canelasoftware.com> wrote:

> 
> On Mar 20, 2006, at 1:43 PM   Mar 20, 2006, Robert E. Ball wrote:
> 
>> I want the user of my program to be able to hilite portions of a
>> text field on a given card (similar to using a yellow hilite pen on
>> a book page -- I have set hiliteColor to yellow) and then to have
>> the hilited text show up when the user returns to the card.
>> 
>> When I first double click on a word in a field, the selected word's
>> backgroundColor turns yellow, as it should. However, when I double
>> click on another word in the field, the yellow backgroundColor of
>> the previously selected word is removed and the backgroundColor of
>> the second selected word is yellow. I understand why this works --
>> a new word has been selected. However, is it possible to write a
>> script to save the yellow backgroundColor of all selected words. In
>> other words, I would like my cards to look just like the page of a
>> book that has hilited text.
> 
> There probably is a few ways this can be done.  The first thing I
> would try is to store the selectedChunk information everytime there
> is a mouseUp.  You could store this in a variable or a custom property.
> 
> A quick and dirty solution would be the following:
> 
> on selectionChanged
>    put the selectedChunk
>    set the foreGroundColor of the selectedChunk to 255,0,0
> end selectionChanged
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 

-- 
Robert E. Ball, PhD
Distinguished Professor, Emeritus
Department of Aeronautics and Astronautics
Naval Postgraduate School
Monterey, California




More information about the use-livecode mailing list