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

  1. on setUpSprites range, trueORfalse, theImm
  2.   if string(trueORfalse) = EMPTY then
  3.     set trueORfalse to 0
  4.   end if
  5.   set range to convertToList(range)
  6.   if range = EMPTY then
  7.     exit
  8.   end if
  9.   set x to the number of items in range
  10.   repeat with n = 1 to x
  11.     puppetSprite(value(item n of range), trueORfalse)
  12.     if trueORfalse = 1 then
  13.       set the immediate of sprite value(item n of range) to theImm
  14.     end if
  15.   end repeat
  16. end
  17.  
  18. on errMsg theString
  19. end
  20.  
  21. on removeComments textCast
  22.   set x to the number of lines in textCast
  23.   repeat with n = 1 to x
  24.     if line x - n + 1 of textCast contains "--" then
  25.       delete line x - n + 1 of textCast
  26.     end if
  27.   end repeat
  28.   return textCast
  29. end
  30.  
  31. on manageHiliter refSprite, offset, txtSprite, fieldNum
  32.   global linePtr, theMenu
  33.   set LT to the left of sprite txtSprite
  34.   if theMenu = "index" then
  35.     set wd to the width of sprite txtSprite
  36.   else
  37.     set wd to the width of sprite refSprite - offset
  38.   end if
  39.   set TP to the top of sprite txtSprite
  40.   set theLines to the number of lines in field fieldNum
  41.   set txtHt to the textHeight of field fieldNum
  42.   puppetSprite(48, 1)
  43.   set the castNum of sprite 48 to 414
  44.   set the locH of sprite 48 to LT
  45.   set the width of sprite 48 to wd
  46.   set the height of sprite 48 to txtHt + 1
  47.   set oldLine to EMPTY
  48.   set the visible of sprite 48 to 0
  49.   repeat while the mouseDown
  50.     set vPos to the mouseV
  51.     if (the mouseH < LT) or (the mouseH > (LT + wd)) then
  52.       next repeat
  53.     end if
  54.     if (vPos < TP) or (vPos > (TP + (txtHt * theLines))) then
  55.       next repeat
  56.     end if
  57.     set linePtr to integer((vPos - TP) / txtHt)
  58.     if linePtr < 0 then
  59.       set linePtr to 0
  60.     end if
  61.     if linePtr > theLines then
  62.       set linePtr to theLines
  63.     end if
  64.     set the visible of sprite 48 to 0
  65.     set the locV of sprite 48 to TP + (linePtr * txtHt)
  66.     set the visible of sprite 48 to 1
  67.     updateStage()
  68.   end repeat
  69. end
  70.  
  71. on manageHiliter2 txtSprite, fieldNum, adjustWd
  72.   global linePtr, theMenu, displayLines, theClickLine
  73.   set LT to the left of sprite txtSprite
  74.   set TP to the top of sprite txtSprite
  75.   set wd to the width of sprite txtSprite + adjustWd
  76.   set theLines to the number of lines in field fieldNum
  77.   set txtHt to the textHeight of field fieldNum
  78.   puppetSprite(48, 1)
  79.   set the castNum of sprite 48 to 414
  80.   set the width of sprite 48 to wd
  81.   set the height of sprite 48 to txtHt + 1
  82.   set the visible of sprite 48 to 0
  83.   set oldLine to EMPTY
  84.   repeat while the mouseDown
  85.     set vPos to the mouseV
  86.     if (the mouseH < LT) or (the mouseH > (LT + wd)) then
  87.       next repeat
  88.     end if
  89.     if (vPos < TP) or (vPos > (TP + (txtHt * theLines))) then
  90.       next repeat
  91.     end if
  92.     set linePtr to integer((vPos - TP) / txtHt)
  93.     if linePtr < 0 then
  94.       set linePtr to 0
  95.     end if
  96.     if linePtr > theLines then
  97.       set linePtr to theLines
  98.     end if
  99.     set the locH of sprite 48 to LT + 1000
  100.     set the visible of sprite 48 to 0
  101.     set the locV of sprite 48 to TP + (linePtr * txtHt)
  102.     set the locH of sprite 48 to LT
  103.     set the visible of sprite 48 to 1
  104.     updateStage()
  105.   end repeat
  106.   if (the mouseH >= LT) or (the mouseH <= (LT + wd)) then
  107.     if (vPos >= TP) or (vPos <= (TP + (txtHt * theLines))) then
  108.       set the visible of sprite 48 to 1
  109.     else
  110.       set the locH of sprite 48 to LT + 1000
  111.       set the visible of sprite 48 to 0
  112.     end if
  113.   else
  114.     set the locH of sprite 48 to LT + 1000
  115.     set the visible of sprite 48 to 0
  116.   end if
  117. end
  118.