home *** CD-ROM | disk | FTP | other *** search
- property regionList, buttonSprite, textSprite, textName, testFieldSprite, testFieldName, sliderSprite, barRect, pageScrollDist, fullScrollDist, currentLine, upArrowSprite, downArrowSprite, goArrowSprites, goTextSprites, goObject, titleNum, termFontSize
-
- on new me, fullRegionList, buttonSp, textSp, textFieldName, testFldSprite, testFldName, sliderSp, barRc, upArrow, downArrow, goArrSprites, goTxSprites
- set regionList to duplicate(fullRegionList)
- set buttonSprite to buttonSp
- set textSprite to textSp
- set textName to textFieldName
- set testFieldSprite to testFldSprite
- set testFieldName to testFldName
- set sliderSprite to sliderSp
- set barRect to barRc
- set upArrowSprite to upArrow
- set downArrowSprite to downArrow
- repeat with k in [sliderSprite, upArrowSprite, downArrowSprite, textSprite]
- set the visible of sprite k to 1
- end repeat
- updateStage()
- set currentLine to 0
- set goArrowSprites to duplicate(goArrSprites)
- set goTextSprites to duplicate(goTxSprites)
- set goObject to 0
- set titleNum to 0
- set termFontSize to 18
- set the textSize of member "currentTerm" to termFontSize
- return me
- end
-
- on death me
- set regionList to 0
- end
-
- on setupLinkButtons me, newLine
- global gLinkList
- if newLine = currentLine then
- return
- end if
- set currentLine to newLine
- set termSprite to 13
- set defSprite to 14
- set whichTerm to line currentLine of field textName
- set notFoundFlag to getPos(["Boyle's Law", "cytokine", "Einthoven's triangle", "rib", "tibia"], whichTerm) >= 1
- if not notFoundFlag then
- set dbResult to DBQuery("UPPER(TERM) = '" & toUpper(whichTerm) & "'")
- else
- set dbResult to 0
- end if
- if dbResult = 0 then
- set the visible of sprite termSprite to 0
- updateStage()
- put whichTerm into field "currentTerm"
- set the textSize of member "currentTerm" to termFontSize
- repeat while the height of member "currentTerm" > the textHeight of member "currentTerm"
- set the textSize of member "currentTerm" to the textSize of member "currentTerm" - 1
- end repeat
- set the visible of sprite termSprite to 1
- updateStage()
- if not notFoundFlag then
- put DBGetMemo("DEF") into field "currentDefinition"
- else
- put line getPos(["Boyle's Law", "cytokine", "Einthoven's triangle", "rib", "tibia"], whichTerm) of field "extraDefs" into field "currentDefinition"
- end if
- repeat with k in goArrowSprites
- puppetSprite(k, 1)
- end repeat
- repeat with k = 1 to count(goTextSprites)
- set nextSprite to getAt(goTextSprites, k)
- puppetSprite(nextSprite, 1)
- set the visible of sprite nextSprite to 0
- set the castNum of sprite nextSprite to the number of member ("title" & string(k))
- end repeat
- updateStage()
- if not notFoundFlag then
- set linkList to value(DBGetFieldByName("LINKS"))
- else
- set linkList to value(line getPos(["Boyle's Law", "cytokine", "Einthoven's triangle", "rib", "tibia"], whichTerm) of field "extraLinks")
- end if
- set titleList to []
- if voidp(linkList) or not listp(linkList) then
- set linkList to []
- end if
- sort(linkList)
- if count(linkList) >= 2 then
- repeat with m = 1 to count(linkList) - 1
- repeat with n = m + 1 to count(linkList)
- if getAt(linkList, m) = getAt(linkList, n) then
- deleteAt(linkList, n)
- exit repeat
- end if
- end repeat
- end repeat
- end if
- if count(linkList) >= 1 then
- repeat with m = 1 to count(linkList) - 1
- set nextTerm to getAt(linkList, m)
- set nextOffset to offset(" ", nextTerm)
- if nextOffset >= 1 then
- delete char nextOffset of nextTerm
- end if
- setAt(linkList, m, nextTerm)
- end repeat
- end if
- set gLinkList to duplicate(linkList)
- repeat with k = 1 to count(linkList)
- set nextTitle to getScreenTitle(getAt(linkList, k))
- if length(nextTitle) >= 1 then
- append(titleList, nextTitle)
- end if
- end repeat
- set numTitles to count(titleList)
- if numTitles > count(goTextSprites) then
- set numTitles to count(goTextSprites)
- end if
- repeat with k = 1 to numTitles
- set the text of field ("title" & string(k)) to getAt(titleList, k)
- end repeat
- set firstSprite to getAt(goTextSprites, 1)
- set firstMember to the castNum of sprite firstSprite
- set firstHeight to the height of sprite firstSprite
- set the locH of sprite firstSprite to 343
- if the bottom of sprite defSprite > 215 then
- set the locV of sprite firstSprite to the bottom of sprite defSprite + 50
- else
- set the locV of sprite firstSprite to 243
- end if
- set prevSprite to firstSprite
- repeat with k = 2 to count(titleList)
- if k > count(goTextSprites) then
- exit repeat
- end if
- set nextSprite to getAt(goTextSprites, k)
- set the locH of sprite nextSprite to the locH of sprite prevSprite
- set the locV of sprite nextSprite to the locV of sprite prevSprite + 28
- set prevSprite to nextSprite
- end repeat
- updateStage()
- repeat with k = 1 to numTitles
- set nextSprite to getAt(goArrowSprites, k)
- set textSprite to getAt(goTextSprites, k)
- set the castNum of sprite nextSprite to the number of member "arrowup"
- set nextH to the left of sprite textSprite - (the width of cast "arrowUp" / 2)
- set nextV to (the top of sprite textSprite + the bottom of sprite textSprite) / 2
- set the locH of sprite nextSprite to nextH
- set the locV of sprite nextSprite to nextV
- set the visible of sprite nextSprite to 1
- end repeat
- repeat with k = numTitles + 1 to count(goArrowSprites)
- puppetSprite(getAt(goArrowSprites, k), 0)
- puppetSprite(getAt(goTextSprites, k), 0)
- set the castNum of sprite getAt(goArrowSprites, k) to the number of member "null"
- set the castNum of sprite getAt(goTextSprites, k) to the number of member "null"
- end repeat
- repeat with k = 1 to numTitles
- set the visible of sprite getAt(goTextSprites, k) to 1
- end repeat
- set titleNum to numTitles
- updateStage()
- set goRegionList to []
- repeat with k = 1 to numTitles
- set arrSprite to getAt(goArrowSprites, k)
- set nextH to the locH of sprite arrSprite - 320
- set nextV to the locV of sprite arrSprite - 240
- append(goRegionList, getButtonData("arrowDn", "indexGoAction(" & string(k) & ")", [nextH, nextV]))
- end repeat
- set goObject to 0
- set goObject to new(script "buttonObject", 40, goRegionList)
- else
- set the text of field "currentTerm" to " "
- set the text of field "currentDefinition" to " "
- repeat with k = 1 to count(goArrowSprites)
- set arrSprite to getAt(goArrowSprites, k)
- set textSprite to getAt(goTextSprites, k)
- set the castNum of sprite arrSprite to the number of member "null"
- set the castNum of sprite textSprite to the number of member "null"
- set the puppet of sprite arrSprite to 0
- set the castNum of sprite textSprite to 0
- end repeat
- updateStage()
- set goObject to 0
- end if
- end
-
- on indGoAction me, whichOne
- global indexWindowObject, gLinkList
- put getAt(gLinkList, whichOne)
- if whichOne <= count(gLinkList) then
- gomovie(getAt(gLinkList, whichOne))
- else
- end if
- end
-