home *** CD-ROM | disk | FTP | other *** search
/ Looney Tunes Photo Print Studio (Special Edition) / LIVEPIX.iso / ORIENTAT / DATA / LPORIENT.DXR / 00003_Utilities.ls < prev    next >
Encoding:
Text File  |  1998-01-16  |  3.3 KB  |  157 lines

  1. on fileExists aFile
  2.   set vFile to FileIO(mnew, "Read", aFile)
  3.   if objectp(vFile) then
  4.     vFile(mdispose)
  5.     return 1
  6.   else
  7.     return 0
  8.   end if
  9. end
  10.  
  11. on stripCRLF aString
  12.   repeat with vI = 1 to length(aString)
  13.     set vCurrChar to char vI of aString
  14.     if (vCurrChar = numToChar(10)) or (vCurrChar = numToChar(13)) then
  15.       delete char vI of aString
  16.     end if
  17.   end repeat
  18.   return aString
  19. end
  20.  
  21. on stripChars aString, aStripChars
  22.   set vI to 1
  23.   repeat while vI <= length(aString)
  24.     set vCurrChar to char vI of aString
  25.     set vStripIt to 0
  26.     repeat with vJ = 1 to length(aStripChars)
  27.       if vCurrChar = char vJ of aStripChars then
  28.         set vStripIt to 1
  29.         exit repeat
  30.       end if
  31.     end repeat
  32.     if vStripIt then
  33.       delete char vI of aString
  34.       next repeat
  35.     end if
  36.     set vI to vI + 1
  37.   end repeat
  38.   return aString
  39. end
  40.  
  41. on SetCursor aCursor
  42.   if aCursor = #none then
  43.     cursor(200)
  44.   else
  45.     if aCursor = #normal then
  46.       cursor(-1)
  47.     else
  48.       if aCursor = #Wait then
  49.         cursor(4)
  50.       else
  51.         if aCursor = #updown then
  52.           cursor([the number of member "UD_CURSOR", the number of member "UD_MASK"])
  53.         else
  54.           if aCursor = #leftright then
  55.             cursor([the number of member "LR_CURSOR", the number of member "LR_MASK"])
  56.           else
  57.             if aCursor = #hand then
  58.               cursor([the number of member "HAND_CURSOR", the number of member "HAND_MASK"])
  59.             end if
  60.           end if
  61.         end if
  62.       end if
  63.     end if
  64.   end if
  65. end
  66.  
  67. on HideAllSprites
  68.   repeat with vI = 1 to 48
  69.     set the visible of sprite vI to 0
  70.   end repeat
  71.   updateStage()
  72. end
  73.  
  74. on ShowAllSprites
  75.   repeat with vI = 1 to 48
  76.     set the visible of sprite vI to 1
  77.   end repeat
  78.   updateStage()
  79. end
  80.  
  81. on StartBufferingEvents
  82.   global gSystem, gEventQ
  83.   if gSystem = "WIN" then
  84.     if gEventQ(mBufferStatus) = 0 then
  85.       gEventQ(mBufferEvents)
  86.     end if
  87.   end if
  88. end
  89.  
  90. on EndBufferingEvents
  91.   global gSystem, gEventQ
  92.   if gSystem = "WIN" then
  93.     if gEventQ(mBufferStatus) = 1 then
  94.       gEventQ(mFlushEvents)
  95.     end if
  96.   else
  97.     if gSystem = "MAC" then
  98.       gFlush(mFlush)
  99.     end if
  100.   end if
  101. end
  102.  
  103. on Wait aTix, aWaitHandler
  104.   set t to the ticks + aTix
  105.   repeat while t > the ticks
  106.     if voidp(aWaitHandler) then
  107.       nothing()
  108.       next repeat
  109.     end if
  110.     do(aWaitHandler)
  111.   end repeat
  112. end
  113.  
  114. on MessagePut aStr
  115.   put aStr
  116. end
  117.  
  118. on ShowDim fromCst, toCst
  119.   if voidp(toCst) then
  120.     put the width of cast fromCst && the height of cast fromCst
  121.   else
  122.     repeat with i = fromCst to toCst
  123.       put the width of cast i && the height of cast i
  124.     end repeat
  125.   end if
  126. end
  127.  
  128. on PutCst fromCst, toCst
  129.   if voidp(toCst) then
  130.     put the rect of cast toCst && ":" && the regPoint of cast toCst
  131.   else
  132.     repeat with i = fromCst to toCst
  133.       put the rect of cast i && ":" && the regPoint of cast i
  134.     end repeat
  135.   end if
  136. end
  137.  
  138. on SetReg fromCst, toCst
  139.   if voidp(toCst) then
  140.     set the regPoint of cast fromCst to point(0, 0)
  141.   else
  142.     repeat with i = fromCst to toCst
  143.       set the regPoint of cast i to point(0, 0)
  144.     end repeat
  145.   end if
  146. end
  147.  
  148. on MoveReg movH, movV, fromCst, toCst
  149.   if voidp(toCst) then
  150.     set the regPoint of cast fromCst to the regPoint of cast fromCst + point(movH, movV)
  151.   else
  152.     repeat with i = fromCst to toCst
  153.       set the regPoint of cast i to the regPoint of cast i + point(movH, movV)
  154.     end repeat
  155.   end if
  156. end
  157.