home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Webster's Millennium Amer…Sign Language Dictionary
/
ASL.ISO
/
mac
/
SHARED.cst
/
00010_Script_10
< prev
next >
Wrap
Text File
|
2001-09-17
|
5KB
|
149 lines
--∂ï
on setBtn1 pos
global TEMPLATE1, KNOB1, minPos1, maxPos1
global maxScroll,minScroll,gCat,scrollList
put max(float(maxscroll-minScroll),1) into scrollRange
put float(scrollRange/(maxPos1-minPos1)) into scrollRatio
put max(float((maxPos1-minPos1)/scrollRange),1.0) into sliderRatio
set the locH of sprite KNOB1 = minPos1 + integer(float(sliderRatio*(pos-1.0)))
---------------
-- f...
if scrollRange > the width of sprite TEMPLATE1 then
setSliderPos2 pos,scrollRange,minScroll
set theOffsetPos = (minscroll-1)+pos
--if not (line pos of scrollList="") then EntryByName (line pos of scrollList)
if not (line pos of scrollList="") then EntryByName (line theOffsetPos of scrollList)
--
else
set refname = setWord(the locH of sprite KNOB1,scrollRange,scrollRatio,minPos1)
if not (refname="") then EntryByName refname
end if
-- ...this!!
---------------
updatestage
end setBtn1
on buttonDown1
global TEMPLATE1, KNOB1, minPos1, maxPos1
global maxScroll,minScroll,gCat,scrollList
put max(float(maxscroll-minScroll),1) into scrollRange
put scrollRange/(maxPos1-minPos1) into scrollRatio
if the number of lines in scrollList = 2 then set scrollRatio = 0.005
set oldMouseH = the mouseH
hideEntry
repeat while the stillDown
if oldMouseH <> the mouseH then
set the locH of sprite KNOB1 = max( minPos1, min( ( the mouseH ) , maxPos1 ) )
set refname = setWord(the locH of sprite KNOB1,scrollRange,scrollRatio,minPos1)
updateStage
set oldMouseH = the mouseH
end if
end repeat
cursor 4
EntryByName refname
showEntry
cursor 0
end buttonDown1
on setWord locRef,scrollRange,scrollRatio,TheLeft
global scrollList,gWordList--ïïï
global maxScroll,minScroll
if the number of lines in scrollList = 1 then set scrollRatio = 0
put float((locRef)-TheLeft)*scrollRatio into scrollLoc
put integer(minScroll+scrollLoc) into refVal
put line refVal of scrollList into theWord
set the text of cast "word name" to theWord
set the text of cast "word" to theWord
set tempStr = string(integer(scrollLoc)+1)&"/"&string(integer(maxScroll-minScroll)+1)
set the text of cast "word #" to tempStr
--put refVal
return line refVal of scrollList--ïïï
end
on setSliderPos aWord
global gWordList,scrollList
global TEMPLATE1, KNOB1, minPos1,maxPos1
if the number of lines of scrollList > 2100 then -- we're in a-z browse mode
set wordLoc = getPos(gWordList,aWord)
set posRatio = count(gWordList)/the width of sprite TEMPLATE1
set sliderPos = minPos1+integer(wordLoc/posRatio)
set the locH of sprite KNOB1 = max(minPos1, min((sliderPos) , maxPos1))
set the text of cast "word name" to aWord
set the text of cast "word" to aWord
set the text of cast "word #" to string(wordLoc)&"/"&string(count(gWordList))
else
set the text of cast "word name" to aWord
set the text of cast "word" to aWord
set the text of cast "word #" to "???/???"
end if
updatestage
end
on setSliderPos2 pos,scrollRange,minScroll
global gWordList,scrollList
global TEMPLATE1, KNOB1, minPos1,maxPos1
global maxScroll,minScroll
-- put "setSliderPos2"
-- put "minScroll = " & minscroll
-- put "maxScroll = " & maxscroll
-- put "scrollRange = " & scrollRange
-- put "minPos1 = " & minPos1
-- put "maxPos1 = " & maxPos1
set posRatio = float(scrollRange)/float(the width of sprite TEMPLATE1)
if posRatio = 0 then set posRatio = 1
--set posRatio = max(1,float(scrollRange)/float(the width of sprite TEMPLATE1))
set sliderPos = minPos1+integer(float(pos)/posRatio) -- choose "xerox" in find-crash!
set the locH of sprite KNOB1 = max(minPos1, min((sliderPos) , maxPos1))
set theWord = line (minscroll-1+pos) of scrollList
set the text of cast "word name" to theWord
set the text of cast "word" to theWord
if scrollRange < 2000 then
set tempStr = string(pos)&"/"&string(integer(maxScroll-minScroll)+1)
else set tempStr = string(pos)&"/"&string(count(gWordList))
set the text of cast "word #" to tempStr
updatestage
end
on buttonDown2
global TEMPLATE2, KNOB2, minPos2, maxPos2,gVideoSpeed
set oldMouseH = the mouseH
repeat while the stillDown
if oldMouseH <> the mouseH then
set the locH of sprite KNOB2 = max( minPos2, min( ( the mouseH ) , maxPos2 ) )
set l = the left of sprite TEMPLATE2
set userLoc = the locH of sprite KNOB2-l
set slRatio = the width of sprite TEMPLATE2/9
set gVideoSpeed = max(userLoc/slRatio,1)
setVideoSpeed 0
--put tempoRef
updateStage
set oldMouseH = the mouseH
end if
end repeat
end buttonDown2
on moveOneEntry dir
global gWordlist,maxscroll,minScroll
set the itemDelimiter to "/"
set aPos = integer(item 1 of field "word #")+dir
set the itemDelimiter to ","
if aPos < 1 or aPos > (maxscroll-minScroll)+1 then exit
hideEntry
setBtn1 aPos
showEntry
end