script of "transcript dictionary" stadk
yves COPPE
yvescoppe at skynet.be
Sun Feb 10 08:11:00 EST 2002
>You should be able to get to this script using the contextual menu shortcut
>(command-control-shift-click the field). You might first need to turn on
>the option "Contextual menus work in Revolution windows" in the Preferences.
>
>Also you can always type "edit script of the mousecontrol" into the message
>box, move the pointer over the object, then press Return.
>
>In case you still cannot get to it, here is the script:
>
>
>local lTimerID -- variable holding the message ID of the delayed
>revDocsFilterTerms message
>
>on rawKeyUp
> if the label of button "Filter Type" is "Scroll to:" then
> lock screen
> if me is empty then -- scroll back to top
> set the hilitedLines of field "List" to 1
> else -- scroll to first term matching what's typed at its start
> put lineOffset(return & me, field "List") + 1 into currentLine
> if currentLine > 1 then -- typed field matches a line
> set the hilitedLines of field "List" to currentLine
> set the scroll of field "List" to \
> (currentLine - 1) * the effective textHeight of field "List"
> end if
> end if
> unlock screen
> else -- "Filter with:"
> if me is empty then -- show all terms
> if "revDocsFilterTerms" is in the pendingMessages then cancel lTimerID
> set the htmlText of field "List" to the completeHtmlContents of field
>"List"
> else
> if "revDocsFilterTerms" is not in the pendingMessages then
> send "revDocsFilterTerms" to me in 200 milliseconds
> put the result into lTimerID
> else
> cancel lTimerID
> send "revDocsFilterTerms" to me in 200 milliseconds
> put the result into lTimerID
> end if
> end if
> set the hilitedLines of field "List" to 1
> end if
>end rawKeyUp
>
>on returnInField
> if the hilitedLines of field "List" is empty then set the hilitedLines of
>field "List" to 1
> send "mouseDown" to field "List"
>end returnInField
>
>on enterInField
> returnInField
>end enterInField
>
>on revDocsFilterTerms
> lock screen
> lock messages
> set the htmlText of field "List" to the completeHtmlContents of field "List"
> put the text of field "List" into tPlainLines
> put the text of me into textToFilterOn
> filter field "List" with "*" & the text of me & "*"
> set the wholeMatches to true
> repeat for each line thisLine in field "List"
> if textToFilterOn is not in word 1 to -2 of thisLine then next repeat
> put line lineOffset(thisLine,tPlainLines) of the completeHtmlContents
>of field "List" \
> & return after filteredListOfTerms
> end repeat
> replace (return & return) with return in filteredListOfTerms
> set the htmlText of field "list" to filteredListOfTerms
> if line 1 of field "List" is empty then delete line 1 of field "List"
> set the hilitedLines of field "List" to 1
> unlock screen
> unlock messages
>end revDocsFilterTerms
>
>--
Thank you very much, it fills just my needs
--
More information about the use-livecode
mailing list