home *** CD-ROM | disk | FTP | other *** search
/ Comic Book Maker: The Smurfs / COMIC.iso / mac / data_m / dialog / 00033_initStandardDialogBhvr.ls < prev    next >
Encoding:
Text File  |  1999-07-07  |  1.7 KB  |  52 lines

  1. property myParams
  2. global gDialogPresent, gObj3
  3.  
  4. on beginSprite me
  5.   set bugFix to the left of sprite 2
  6.   if the height of the rect of sprite 2 < 50 then
  7.     set bugFix to the rect of sprite 10
  8.     if not (the number of member the member of sprite 9) then
  9.       set alertIconHeight to 32
  10.     else
  11.       set alertIconHeight to the height of the member of sprite 9
  12.     end if
  13.     set dialogBottom to max(alertIconHeight + 15 + 60, the bottom of sprite 10 + 20 + 40)
  14.     set myRect to rect(0, 0, 300, dialogBottom)
  15.     set the locV of sprite 1 to dialogBottom - 40
  16.     set the locV of sprite 9 to dialogBottom - 40 - 20
  17.     set the rect of sprite 2 to myRect
  18.   else
  19.     set myRect to the rect of sprite 2
  20.   end if
  21.   checkBtnLocations(the bottom of myRect)
  22.   set offsetPoint to point(getAt(the rect of the stage, 1) + ((640 - the width of myRect) / 2), getAt(the rect of the stage, 2) + ((480 - the height of myRect) / 2))
  23.   set theRect to myRect + rect(offsetPoint, offsetPoint)
  24.   set the rect of the activeWindow to theRect
  25.   set the modal of the activeWindow to 1
  26.   set the visible of the activeWindow to 1
  27.   set the keyDownScript to "checkKey(sprite " & the currentSpriteNum & ")"
  28.   set the selStart to 0
  29.   set the selEnd to 100
  30. end
  31.  
  32. on checkKEy me
  33.   if (the key = RETURN) or (the key = ENTER) then
  34.     handleDefaultKeyDown(script 1)
  35.   else
  36.     if the controlDown + the commandDown then
  37.       if the key = "d" then
  38.         mouseDown(sprite(8))
  39.         set x to the ticks + 5
  40.         repeat while the ticks < x
  41.         end repeat
  42.         mouseUp(sprite(8))
  43.         stopEvent()
  44.       end if
  45.     end if
  46.   end if
  47. end
  48.  
  49. on getPropertyDescriptionList
  50.   return [#myParams: [#comment: "Params:", #format: #integer, #default: VOID]]
  51. end
  52.