home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1996 August / WPCAUG96.ISO / multi / singing / shared.dxr / 01961_CURSORS.ls < prev    next >
Encoding:
Text File  |  1996-06-12  |  4.6 KB  |  285 lines

  1. on left
  2.   return -1
  3. end
  4.  
  5. on right
  6.   return -2
  7. end
  8.  
  9. on Up
  10.   return -3
  11. end
  12.  
  13. on down
  14.   return -4
  15. end
  16.  
  17. on l
  18.   return left()
  19. end
  20.  
  21. on R
  22.   return right()
  23. end
  24.  
  25. on U
  26.   return Up()
  27. end
  28.  
  29. on D
  30.   return down()
  31. end
  32.  
  33. on LHSpageEdge
  34.   return -99
  35. end
  36.  
  37. on RHSpageEdge
  38.   return -98
  39. end
  40.  
  41. on LHStext
  42.   return -199
  43. end
  44.  
  45. on RHStext
  46.   return -198
  47. end
  48.  
  49. on PreLoadCursors
  50.   preLoadCast("Left", "LastCursor")
  51. end
  52.  
  53. on InitCursorNumbers
  54.   global LeftCursorNum, RightCursorNum, UpCursorNum, DownCursorNum, ObjectCursorNum, OpenHandCursorNum, ClosedHandCursorNum, DocumentCursorNum, HoldPageCursornum, StopCursorNum, EarCursorNum
  55.   set LeftCursorNum to the number of cast "Left"
  56.   set RightCursorNum to the number of cast "Right"
  57.   set UpCursorNum to the number of cast "Up"
  58.   set DownCursorNum to the number of cast "Down"
  59.   set ObjectCursorNum to the number of cast "hand"
  60.   set OpenHandCursorNum to the number of cast "OpenHand"
  61.   set ClosedHandCursorNum to the number of cast "ClosedHand"
  62.   set DocumentCursorNum to the number of cast "document"
  63.   set HoldPageCursornum to the number of cast "HoldPage"
  64.   set StopCursorNum to the number of cast "Stop"
  65.   set EarCursorNum to the number of cast "Ear"
  66. end
  67.  
  68. on leftcursor
  69.   global LeftCursorNum
  70.   return LeftCursorNum
  71. end
  72.  
  73. on rightcursor
  74.   global RightCursorNum
  75.   return RightCursorNum
  76. end
  77.  
  78. on UpCursor
  79.   global UpCursorNum
  80.   return UpCursorNum
  81. end
  82.  
  83. on DownCursor
  84.   global DownCursorNum
  85.   return DownCursorNum
  86. end
  87.  
  88. on ObjectCursor
  89.   global ObjectCursorNum
  90.   return ObjectCursorNum
  91. end
  92.  
  93. on OpenHandCursor
  94.   global OpenHandCursorNum
  95.   return OpenHandCursorNum
  96. end
  97.  
  98. on ClosedHandCursor
  99.   global ClosedHandCursorNum
  100.   return ClosedHandCursorNum
  101. end
  102.  
  103. on DocumentCursor
  104.   global DocumentCursorNum
  105.   return DocumentCursorNum
  106. end
  107.  
  108. on HoldPageCursor
  109.   global HoldPageCursornum
  110.   return HoldPageCursornum
  111. end
  112.  
  113. on StopCursor
  114.   global StopCursorNum
  115.   return StopCursorNum
  116. end
  117.  
  118. on EarCursor
  119.   global EarCursorNum
  120.   return EarCursorNum
  121. end
  122.  
  123. on LC
  124.   return leftcursor()
  125. end
  126.  
  127. on RC
  128.   return rightcursor()
  129. end
  130.  
  131. on UC
  132.   return UpCursor()
  133. end
  134.  
  135. on DC
  136.   return DownCursor()
  137. end
  138.  
  139. on OC
  140.   return ObjectCursor()
  141. end
  142.  
  143. on OH
  144.   return OpenHandCursor()
  145. end
  146.  
  147. on WatchCursor
  148.   cursor(4)
  149. end
  150.  
  151. on NoCursor
  152.   cursor(200)
  153. end
  154.  
  155. on SelectCursor cursCast
  156.   cursor([cursCast, cursCast + 1])
  157. end
  158.  
  159. on CheckLeft c
  160.   global pointedAt
  161.   set doit to the mouseH < 50
  162.   if doit then
  163.     SelectCursor(c)
  164.     set pointedAt to left()
  165.   end if
  166.   return doit
  167. end
  168.  
  169. on CheckRight c
  170.   global pointedAt
  171.   set doit to the mouseH > 590
  172.   if doit then
  173.     SelectCursor(c)
  174.     set pointedAt to right()
  175.   end if
  176.   return doit
  177. end
  178.  
  179. on CheckUp c
  180.   global pointedAt
  181.   set doit to the mouseV < 110
  182.   if doit then
  183.     SelectCursor(c)
  184.     set pointedAt to Up()
  185.   end if
  186.   return doit
  187. end
  188.  
  189. on CheckDown c
  190.   global pointedAt
  191.   set doit to the mouseV > 370
  192.   if doit then
  193.     SelectCursor(c)
  194.     set pointedAt to down()
  195.   end if
  196.   return doit
  197. end
  198.  
  199. on CheckSprite s, c
  200.   global pointedAt
  201.   set maybe to rollOver(s)
  202.   set theCast to the castNum of sprite s
  203.   if maybe then
  204.     set doit to the mouseCast = theCast
  205.     if doit then
  206.       set pointedAt to s
  207.       SelectCursor(c)
  208.     end if
  209.   end if
  210.   return doit
  211. end
  212.  
  213. on PointingAt n
  214.   global pointedAt
  215.   return pointedAt = n
  216. end
  217.  
  218. on p n
  219.   return PointingAt(n)
  220. end
  221.  
  222. on PointAt n
  223.   global pointedAt
  224.   set pointedAt to n
  225. end
  226.  
  227. on UpdateCursor patchList
  228.   global pointedAt
  229.   set doneCursor to 0
  230.   repeat with patchPair in patchList
  231.     set thePatch to getAt(patchPair, 1)
  232.     set theCursor to getAt(patchPair, 2)
  233.     if thePatch > 0 then
  234.       set doneCursor to CheckSprite(thePatch, theCursor)
  235.       if doneCursor then
  236.         exit repeat
  237.       end if
  238.     end if
  239.     if thePatch = left() then
  240.       set doneCursor to CheckLeft(theCursor)
  241.       if doneCursor then
  242.         exit repeat
  243.       end if
  244.     end if
  245.     if thePatch = right() then
  246.       set doneCursor to CheckRight(theCursor)
  247.       if doneCursor then
  248.         exit repeat
  249.       end if
  250.     end if
  251.     if thePatch = Up() then
  252.       set doneCursor to CheckUp(theCursor)
  253.       if doneCursor then
  254.         exit repeat
  255.       end if
  256.     end if
  257.     if thePatch = down() then
  258.       set doneCursor to CheckDown(theCursor)
  259.       if doneCursor then
  260.         exit repeat
  261.       end if
  262.     end if
  263.     if thePatch = LHSpageEdge() then
  264.       set doneCursor to CheckLHSpageEdge(theCursor)
  265.       if doneCursor then
  266.         exit repeat
  267.       end if
  268.     end if
  269.     if thePatch = RHSpageEdge() then
  270.       set doneCursor to CheckRHSpageEdge(theCursor)
  271.       if doneCursor then
  272.         exit repeat
  273.       end if
  274.     end if
  275.   end repeat
  276.   if not doneCursor then
  277.     cursor(0)
  278.     set pointedAt to 0
  279.   end if
  280. end
  281.  
  282. on c l
  283.   UpdateCursor(l)
  284. end
  285.