home *** CD-ROM | disk | FTP | other *** search
- on ReturnValue
- global RetHandler
- set x to Replace(the text of field "Enter", QUOTE, QUOTE & ""E&" & QUOTE)
- do("tell the stage to" && RetHandler && QUOTE & x & QUOTE)
- if the result then
- tell the stage
- doSound("0Giusto" & random(2))
- ClearBlue()
- set the cursor of sprite 29 to -1
- end tell
- close(window "InputBox")
- forget(window "InputBox")
- forget(window "Symbols")
- else
- tell the stage
- doSound("0Errore" & random(2))
- end tell
- end if
- end
-
- on startMovie
- set the cursor of sprite 5 to [50, 51]
- set the cursor of sprite 6 to [50, 51]
- tell the stage
- set the cursor of sprite 29 to [50, 51]
- end tell
- set the foreColor of field "Symbols" to GetColor("Black")
- end
-
- on stopMovie
- tell the stage
- set the cursor of sprite 29 to -1
- end tell
- end
-
- on insert ch
- set x to the selStart
- if x > 0 then
- put ch after char x of field "Enter"
- else
- put ch before field "Enter"
- end if
- set the selEnd to x + 1
- set the selStart to x + 1
- end
-
- on openWindow
- symbolsoff()
- end
-
- on closeWindow
- set the visible of sprite 2 to 0
- end
-
- on doSymbols
- if the visible of sprite 9 then
- symbolsoff()
- else
- symbolsOn()
- end if
- end
-
- on symbolsOn
- set R to the rect of window "InputBox"
- set x to getAt(R, 4) + 35
- set x1 to getAt(R, 2)
- set xMax to getAt(getAt(the deskTopRectList, 1), 4)
- if x > xMax then
- setAt(R, 2, x1 - x + xMax)
- setAt(R, 4, xMax)
- else
- setAt(R, 4, x)
- end if
- set the visible of sprite 10 to 1
- set the visible of sprite 9 to 1
- set the rect of window "InputBox" to R
- end
-
- on symbolsoff
- set R to the rect of window "InputBox"
- setAt(R, 4, getAt(R, 4) - 35)
- set the rect of window "InputBox" to R
- set the visible of sprite 9 to 0
- set the visible of sprite 10 to 0
- end
-
- on Replace Src, Fnd, rep
- set ret to EMPTY
- set n to the number of chars in Fnd - 1
- repeat while 1
- set x to offset(Fnd, Src)
- if x = 0 then
- exit repeat
- next repeat
- end if
- if x > 1 then
- put char 1 to x - 1 of Src after ret
- end if
- delete char 1 to x + n of Src
- put rep after ret
- end repeat
- return ret & Src
- end
-
- on AdjustSize
- end
-