Hot Tracking a text line in a field

Mark Stuart mfstuart at cox.net
Mon Nov 23 00:44:03 EST 2009


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




More information about the use-livecode mailing list