home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / winprogs / childenc / oecdemo / shared.dir / 00525.ls < prev    next >
Encoding:
Text File  |  1996-07-24  |  6.8 KB  |  208 lines

  1. on setUpDlogBox n
  2.   global castData, WdName, browseName, CR, bkMrkList, bkMrkLstName, menuText
  3.   set WdName to item 1 of castData
  4.   if WdName = "bookmark" then
  5.     put bkMrkLstName into field 464
  6.     set menuText to bkMrkList
  7.     if bkMrkList contains browseName then
  8.       nothing()
  9.     else
  10.       put browseName & CR & bkMrkList into field 483
  11.       set bkMrkList to browseName & CR & bkMrkList
  12.       set the locH of sprite 4 to 320
  13.     end if
  14.     set the visible of sprite 23 to 1
  15.     updateStage()
  16.     showWd("16-24")
  17.   else
  18.     if WdName = "search" then
  19.       put EMPTY into field 540
  20.       set the textHeight of field 540 to 19
  21.       set the editableText of sprite 21 to 1
  22.       showWd("16-35")
  23.     else
  24.       if "print,help,notebook,browse,game,oasis" contains WdName then
  25.         showWd("16")
  26.       end if
  27.     end if
  28.   end if
  29. end
  30.  
  31. on setUpMenu n
  32.   global castName, articleList, castData, loValPos, hiValPos, scrRange
  33.   if item 1 of castData = "subheadings" then
  34.     showMenu("38-41")
  35.   else
  36.     if n > 14 then
  37.       set y to char 1 of the movie
  38.       if y <> char 1 of castData then
  39.         if word 2 of item 1 of castData <> "index" then
  40.           exit
  41.         end if
  42.         set x to the number of lines in articleList
  43.         set z to the number of items in line 1 of articleList
  44.         set moviePtr to 0
  45.         repeat with j = 1 to x
  46.           put item 1 of castData && item z of line j of articleList
  47.           if char 1 of castData = char 1 of item z of line j of articleList then
  48.             set moviePtr to j
  49.             exit repeat
  50.           end if
  51.         end repeat
  52.         if moviePtr > 0 then
  53.           set destMovie to item z of line moviePtr of articleList
  54.           goNextLoc(destMovie, 1, marker(0))
  55.         end if
  56.         exit
  57.       else
  58.         if item 1 of castData contains "Index" then
  59.           showMenu("38-42")
  60.           exit
  61.         end if
  62.       end if
  63.     else
  64.       if item 1 of castData = "Index" then
  65.         set loValPos to 140
  66.         set hiValPos to 350
  67.         set scrRange to hiValPos - loValPos
  68.         showMenu("38-47")
  69.       else
  70.         if item 1 of castData = "backtrack" then
  71.           if the locH of sprite 38 > 1000 then
  72.             if the timer < 20 then
  73.               goBack()
  74.             else
  75.               showMenu("38-41")
  76.             end if
  77.           end if
  78.           exit
  79.         else
  80.           if item 1 of castData = "see also" then
  81.             showMenu("38-42")
  82.           end if
  83.         end if
  84.       end if
  85.     end if
  86.   end if
  87. end
  88.  
  89. on showMenu spriteNums
  90.   global castData, browseNames, CR, seeAlsoText, subHeaderText, letrIndexText, theTxtFont, theMenu, offsetPtr, tempText, displayLines, menuText, indexText, scrUpCast, scrDnCast
  91.   set spriteNums to convertToList(spriteNums)
  92.   set castPtr to the number of cast item 1 of castData
  93.   set menuData to the text of cast (castPtr + 1)
  94.   set wdSpriteNum to value(item 1 of spriteNums)
  95.   repeat with n = 1 to the number of items in spriteNums
  96.     puppetSprite(value(item n of spriteNums), 1)
  97.     set the immediate of sprite value(item n of spriteNums) to 1
  98.     set x1 to value(item 1 of line n of menuData)
  99.     set y1 to value(item 2 of line n of menuData)
  100.     set x2 to value(item 3 of line n of menuData)
  101.     set y2 to value(item 4 of line n of menuData)
  102.     set theCastNum to value(item 5 of line n of menuData)
  103.     set the castNum of sprite value(item n of spriteNums) to theCastNum
  104.     if n = 2 then
  105.       set txtSprite to value(item n of spriteNums)
  106.     end if
  107.     if n = 3 then
  108.       set scrUpCast to theCastNum
  109.     end if
  110.     if n = 4 then
  111.       set scrDnCast to theCastNum
  112.     end if
  113.     spriteBox(value(item n of spriteNums), x1, y1, x2, y2)
  114.     set the ink of sprite value(item n of spriteNums) to value(item 6 of line n of menuData)
  115.   end repeat
  116.   if stringp(theFieldNum) = 0 then
  117.     set theFieldNum to 441
  118.   end if
  119.   set theMenu to item 1 of castData
  120.   if theMenu = "backTrack" then
  121.     set the textSize of field theFieldNum to 14
  122.     set displayLines to 5
  123.     set menuText to browseNames
  124.     selectLines(theFieldNum)
  125.   else
  126.     if theMenu = "see Also" then
  127.       set displayLines to 7
  128.       set the textSize of field theFieldNum to 14
  129.       set menuText to seeAlsoText
  130.       selectLines(theFieldNum)
  131.     else
  132.       if theMenu = "subheadings" then
  133.         set displayLines to 7
  134.         set the textSize of field theFieldNum to 14
  135.         set menuText to subHeaderText
  136.         selectLines(theFieldNum)
  137.       else
  138.         if theMenu = "index" then
  139.           set the textSize of field theFieldNum to 14
  140.           set displayLines to 15
  141.           set menuText to indexText
  142.           selectLines(theFieldNum)
  143.           put EMPTY into field 442
  144.           set the textFont of field theFieldNum to theTxtFont
  145.         else
  146.           if theMenu contains "index" then
  147.             set the textSize of field theFieldNum to 14
  148.             set displayLines to 14
  149.             set menuText to letrIndexText
  150.             selectLines(theFieldNum)
  151.             set the textFont of field theFieldNum to theTxtFont
  152.           end if
  153.         end if
  154.       end if
  155.     end if
  156.   end if
  157.   set tempText to field theFieldNum
  158.   set offsetPtr to 0
  159. end
  160.  
  161. on selectLines theFieldNum
  162.   global theMenu, displayLines, menuText
  163.   set nLines to the number of lines in menuText
  164.   if nLines < displayLines then
  165.     set the text of field theFieldNum to line 1 to nLines of menuText
  166.     set displayLines to nLines
  167.   else
  168.     set the text of field theFieldNum to line 1 to displayLines of menuText
  169.   end if
  170. end
  171.  
  172. on setUpSpriteBox theSpriteNum, theCastNum, theData
  173.   set the castNum of sprite theSpriteNum to theCastNum
  174.   set x1 to value(item 2 of theData)
  175.   set y1 to value(item 3 of theData)
  176.   set x2 to value(item 4 of theData)
  177.   set y2 to value(item 5 of theData)
  178.   spriteBox(theSpriteNum, x1, y1, x2, y2)
  179.   set the ink of sprite theSpriteNum to value(item 5 of theData)
  180. end
  181.  
  182. on showWd spriteNums
  183.   global castData
  184.   beep()
  185.   setUpSprites("37-48", 0)
  186.   updateStage()
  187.   set spriteNums to convertToList(spriteNums)
  188.   set castPtr to the number of cast item 1 of castData
  189.   if the number of items in spriteNums > 1 then
  190.     set wdData to the text of cast (castPtr + 1)
  191.   else
  192.     set wdData to castData & "," & the number of cast item 1 of castData & "," & 36
  193.     delete item 1 of wdData
  194.   end if
  195.   set wdSpriteNum to value(item 1 of spriteNums)
  196.   repeat with n = 1 to the number of items in spriteNums
  197.     puppetSprite(value(item n of spriteNums), 1)
  198.     set the immediate of sprite value(item n of spriteNums) to 1
  199.     set x1 to value(item 1 of line n of wdData)
  200.     set y1 to value(item 2 of line n of wdData)
  201.     set x2 to value(item 3 of line n of wdData)
  202.     set y2 to value(item 4 of line n of wdData)
  203.     set the castNum of sprite value(item n of spriteNums) to value(item 5 of line n of wdData)
  204.     spriteBox(value(item n of spriteNums), x1, y1, x2, y2)
  205.     set the ink of sprite value(item n of spriteNums) to value(item 6 of line n of wdData)
  206.   end repeat
  207. end
  208.