Hot Tracking a text line in a field

Terry Judd tsj at unimelb.edu.au
Mon Nov 23 04:20:38 EST 2009


Hi Mark - yes you can do it that way but it really isn't necessary to
'reset' all the lines in the field every time you want to change the
formatting of one. Storing the 'highlighted' line number in a local variable
and just resetting this line before you highlight the new line works just as
well well and is probably more efficient when you have long lists to deal
with.

Regards,

Terry...


On 23/11/09 4:44 PM, "Mark Stuart" <mfstuart at cox.net> wrote:

> Hi Terry,
> After looking at your scripts and searching on the 'net, I came to this
> script conclusion.
> 
> Script to handle TreeView like field in RunRev.
> 
> on mouseDown
>   --when user clicks on the line, this script selects all node/line text
>   --you could use "-1" instead of "the number of words..." in the next line
>   select word 1 to (the number of words in the selectedLine) of the
> selectedLine
> end mouseDown
> 
> on mouseMove
>   --I added a check box button to the form,
>   --using its checked state to run the following script.
>   if the hilite of btn "Hot Tracking" then
>      lock screen  --this must be done, else the text in the field flickers
>   --reset textStyle of each line in the field
>    repeat with x = 1 to the number of lines in me
>       set the textStyle of line x of me to plain
>    end repeat
>    --as the mouse moves over the line, underline it
>    if the mouseLine is not empty then
>       put word 2 of the mouseLine into tLine
>       set the textStyle of word 1 to -1 of line tLine of me to underline
>    end if
>    unlock screen
>   end if
> end mouseMove
> 
> on mouseLeave
>    --clears the underline of the last "mouse over"
>    if the hilite of btn "Hot Tracking" then
>       --reset textStyle of each line in the field
>       repeat with x = 1 to the number of lines in me
>          set the textStyle of line x of me to plain
>       end repeat
>    end if
> end mouseLeave
> 
> This is an example of my field values. The tab character was used for
> indenting.
> ====================
> General Preferences
>   File Types
>   Playlist
>   Titles
>   Playback
>   Video
>   Jump to file
>     Missing Files
>     Shell Options
> ====================
> 
> HTH anyone,
> Mark Stuart
> 
> _______________________________________________
> 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




More information about the use-livecode mailing list