home *** CD-ROM | disk | FTP | other *** search
/ Passport / passport.iso / pc / passport / textbox.dxr / 00002.ls < prev    next >
Encoding:
Text File  |  1998-01-26  |  1.1 KB  |  47 lines

  1. on prepareMovie
  2.   repeat with i in [2, 3, 5]
  3.     set the cursor of sprite i to [50, 51]
  4.   end repeat
  5. end
  6.  
  7. on openWindow
  8.   repeat with i = 2 to 5
  9.     set the visible of sprite i to 0
  10.   end repeat
  11. end
  12.  
  13. on EndMovie
  14. end
  15.  
  16. on SetTxt Cod, NoResize
  17.   if voidp(NoResize) then
  18.     set NoResize to 0
  19.   end if
  20.   tell the stage
  21.     readFile(Cod)
  22.   end tell
  23.   set the text of field 1 to the result
  24.   set the boxType of member 1 to #adjust
  25.   if the height of member 1 > 349 then
  26.     set the boxType of member 1 to #fixed
  27.     repeat with i = 2 to 5
  28.       set the visible of sprite i to 1
  29.     end repeat
  30.   else
  31.     repeat with i = 2 to 5
  32.       set the visible of sprite i to 0
  33.     end repeat
  34.     set TB to the rect of window "TextBox"
  35.     set myRect to inflate(TB, 0, integer((the height of member 1 - 353) / 2) - 20)
  36.     set myRectY1 to getAt(myRect, 2)
  37.     set myRectY2 to getAt(myRect, 4)
  38.     if not NoResize then
  39.       repeat while union(TB, myRect) <> myRect
  40.         set TB to rect(getAt(TB, 1), min(getAt(TB, 2) + 5, myRectY1), getAt(TB, 3), max(getAt(TB, 4) - 5, myRectY2))
  41.         set the rect of window "TextBox" to TB
  42.         updateStage()
  43.       end repeat
  44.     end if
  45.   end if
  46. end
  47.