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

  1. on inCastRegion textCast
  2.   global CR, platForm
  3.   if string(textCast) = EMPTY then
  4.     exit
  5.   end if
  6.   set areaList to EMPTY
  7.   set areaList to the text of cast textCast
  8.   set x to the mouseH
  9.   set y to the mouseV
  10.   if the machineType = 256 then
  11.     set n to PCinRect(x, y, areaList)
  12.   else
  13.     InRect(x, y, areaList)
  14.     set n to the result
  15.   end if
  16.   set n to value(n)
  17.   if n > 0 then
  18.     set m to line n of areaList & CR & n
  19.     return m
  20.   else
  21.     return EMPTY
  22.   end if
  23. end
  24.  
  25. on inRelCastRegion textCast
  26.   global CR, platForm
  27.   if string(textCast) = EMPTY then
  28.     exit
  29.   end if
  30.   set me to clickOn()
  31.   set LT to the left of sprite me
  32.   set TP to the top of sprite me
  33.   set areaList to EMPTY
  34.   set areaList to the text of cast textCast
  35.   set x to the mouseH - LT
  36.   set y to the mouseV - TP
  37.   if the machineType = 256 then
  38.     set n to PCinRect(x, y, areaList)
  39.   else
  40.     InRect(x, y, areaList)
  41.     set n to the result
  42.   end if
  43.   set n to value(n)
  44.   if n > 0 then
  45.     set m to line n of areaList & CR & n
  46.     return m
  47.   else
  48.     return EMPTY
  49.   end if
  50. end
  51.  
  52. on inRelCastRegionR spriteNum, textCast
  53.   global CR, platForm
  54.   if string(textCast) = EMPTY then
  55.     exit
  56.   end if
  57.   set LT to the left of sprite spriteNum
  58.   set TP to the top of sprite spriteNum
  59.   set areaList to EMPTY
  60.   set areaList to the text of cast textCast
  61.   set areaList to removeComments(areaList)
  62.   set x to the mouseH - LT
  63.   set y to the mouseV - TP
  64.   if the machineType = 256 then
  65.     set n to PCinRect(x, y, areaList)
  66.   else
  67.     InRect(x, y, areaList)
  68.     set n to the result
  69.   end if
  70.   set n to value(n)
  71.   if n > 0 then
  72.     set m to line n of areaList & CR & n
  73.     return m
  74.   else
  75.     return EMPTY
  76.   end if
  77. end
  78.  
  79. on PCinRect x, y, areaList
  80.   global CR
  81.   set k to EMPTY
  82.   set m to the number of lines in areaList
  83.   repeat with n = 1 to m
  84.     set theRect to line n of areaList
  85.     if char 1 of theRect = "-" then
  86.       next repeat
  87.     end if
  88.     set x1 to value(item 1 of theRect)
  89.     set y1 to value(item 2 of theRect)
  90.     set x2 to value(item 3 of theRect)
  91.     set y2 to value(item 4 of theRect)
  92.     if (x >= x1) and (x <= x2) then
  93.       if (y >= y1) and (y <= y2) then
  94.         set k to n
  95.       end if
  96.     end if
  97.   end repeat
  98.   return k
  99. end
  100.  
  101. on getRegionPtr textCast
  102.   global CR
  103.   if string(textCast) = EMPTY then
  104.     exit
  105.   end if
  106.   set areaList to EMPTY
  107.   set areaList to the text of cast textCast
  108.   set x to the mouseH
  109.   set y to the mouseV
  110.   InRect(x, y, areaList)
  111.   set n to the result
  112.   set n to value(n)
  113.   if n > 0 then
  114.     return n
  115.   else
  116.     return EMPTY
  117.   end if
  118. end
  119.  
  120. on inBtnRegion textCast
  121.   global CR
  122.   if string(textCast) = EMPTY then
  123.     exit
  124.   end if
  125.   set areaList to EMPTY
  126.   set areaList to the text of cast textCast
  127.   set areaList to removeComments(areaList)
  128.   set x to the mouseH
  129.   set y to the mouseV
  130.   InRect(x, y, areaList)
  131.   set n to the result
  132.   set n to value(n)
  133.   if n > 0 then
  134.     set m to line n of areaList
  135.     return m
  136.   else
  137.     return EMPTY
  138.   end if
  139. end
  140.  
  141. on stillInRect theRect
  142.   global CR
  143.   set x to the mouseH
  144.   set y to the mouseV
  145.   InRect(x, y, theRect & CR)
  146.   set n to the result
  147.   set n to value(n)
  148.   if n > 0 then
  149.     return 1
  150.   else
  151.     return 0
  152.   end if
  153. end
  154.