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

  1. on mouseDown
  2.   global loValPos, hiValPos, scrRange, displayLines, menuText, offsetPtr, tempText
  3.   set me to the clickOn
  4.   if the castType of cast the castNum of sprite me = #text then
  5.     set the editableText of me to 1
  6.   end if
  7.   set totLines to the number of lines in menuText
  8.   set the immediate of sprite me to 1
  9.   if the locH of sprite me < 1000 then
  10.     set offset to the locV of sprite me - the mouseV
  11.     set oldOffsetPtr to offsetPtr
  12.     repeat while the mouseDown
  13.       set x to the mouseV + offset
  14.       set the visible of sprite me to 0
  15.       if x < loValPos then
  16.         set the locV of sprite me to loValPos
  17.         set offsetPtr to 0
  18.       else
  19.         if x > hiValPos then
  20.           set the locV of sprite me to hiValPos
  21.           set offsetPtr to totLines - displayLines - 1.0
  22.         else
  23.           set the locV of sprite me to x
  24.           set offsetPtr to integer((totLines - displayLines - 0.5) * (x - loValPos) / scrRange)
  25.         end if
  26.       end if
  27.       set the visible of sprite me to 1
  28.       set tempText to line offsetPtr + 1 to offsetPtr + displayLines of menuText
  29.       put tempText into field 441
  30.       if the locH of sprite 48 < 1000 then
  31.         set theLocV to the locV of sprite 48
  32.         set the visible of sprite 48 to 0
  33.         set theLocV to theLocV + ((offsetPtr - oldOffsetPtr) * the textHeight of field 441)
  34.         set the locV of sprite 48 to theLocV
  35.         if (theLocV < the bottom of sprite 39) and (theLocV >= the top of sprite 39) then
  36.           set the visible of sprite 48 to 1
  37.         end if
  38.       end if
  39.       updateStage()
  40.       set oldOffsetPtr to offsetPtr
  41.     end repeat
  42.   end if
  43. end
  44.