Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8ffaf7b

Browse files
committed
[[ PERF ]] Colorize single line msg box in time
1 parent 416f312 commit 8ffaf7b

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

Toolset/palettes/message box/behaviors/revmessageboxsinglelinemessagebehavior.livecodescript

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ on enterInField
2222
returnInField
2323
end enterInField
2424

25+
local sColorizeMsg
26+
2527
on textChanged
26-
dispatch "revSEColorizeField" to stack "revSEUtilities" with the long id of me
28+
cancel sColorizeMsg
29+
get the long id of me
30+
send "revSEColorizeField it" to stack "revSEUtilities" in 100 milliseconds
31+
put the result into sColorizeMsg
2732
revDisplayAutoComplete(the text of me)
2833
end textChanged
2934

@@ -78,6 +83,8 @@ command revInitialise
7883
end if
7984
end revInitialise
8085

86+
local sColorizeAutocompleteMsg
87+
8188
command revDisplayAutoComplete pString
8289
lock screen
8390
local tString
@@ -87,13 +94,20 @@ command revDisplayAutoComplete pString
8794
put tString into lMatchingHistory
8895
put the number of lines in lMatchingHistory into lNumMatching
8996
put 1 into lMatchingIndex
90-
put field "message" & char (the number of chars of field "message" +1) to (the number of chars of line 1 of lMatchingHistory) of line 1 of lMatchingHistory into field "auto complete"
97+
get field "message" & char (the number of chars of field "message" +1) to (the number of chars of line 1 of lMatchingHistory) of line 1 of lMatchingHistory
98+
if it is the text of field "auto complete" then
99+
unlock screen
100+
return empty
101+
end if
102+
put it into field "auto complete"
91103
set the hscroll of field "auto complete" to the hscroll of field "message"
92104
else
93105
put empty into field "auto complete"
94106
end if
95-
96-
dispatch "revSEColorizeField" to stack "revSEUtilities" with the long id of field "auto complete"
107+
cancel sColorizeAutocompleteMsg
108+
get the long id of field "auto complete"
109+
send "revSEColorizeField it" to stack "revSEUtilities" in 100 milliseconds
110+
put the result into sColorizeAutocompleteMsg
97111
set the textColor of char 1 to -1 of field "auto complete" to "gray70"
98112
unlock screen
99113
end revDisplayAutoComplete

0 commit comments

Comments
 (0)