home *** CD-ROM | disk | FTP | other *** search
/ PC Media 8 / pc-media-windows-95.iso / mdialogs.dir / 00061.ls < prev    next >
Encoding:
Text File  |  1995-08-31  |  2.1 KB  |  104 lines

  1. on startMovie
  2.   if the machineType = 256 then
  3.     set the exitLock to 1
  4.   end if
  5. end
  6.  
  7. on setSprites default
  8.   global gCurrDialogButtonDM
  9.   set gCurrDialogButtonDM to default
  10.   puppetSprite(2, 1)
  11.   puppetSprite(3, 1)
  12.   if the castNum of sprite 4 <> 0 then
  13.     puppetSprite(4, 1)
  14.   end if
  15. end
  16.  
  17. on keyDown
  18.   global gCurrDialogButtonDM
  19.   if voidp(gCurrDialogButtonDM) then
  20.     set gCurrDialogButtonDM to 2
  21.   end if
  22.   set lastsprite to gCurrDialogButtonDM
  23.   if the key = TAB then
  24.     if the castNum of sprite 4 = 0 then
  25.       set limit to 3
  26.     else
  27.       set limit to 4
  28.     end if
  29.     if not (the shiftDown) then
  30.       if lastsprite < limit then
  31.         set gCurrDialogButtonDM to gCurrDialogButtonDM + 1
  32.       else
  33.         set gCurrDialogButtonDM to 2
  34.       end if
  35.     else
  36.       if lastsprite = 2 then
  37.         set gCurrDialogButtonDM to limit
  38.       else
  39.         set gCurrDialogButtonDM to gCurrDialogButtonDM - 1
  40.       end if
  41.     end if
  42.     set c to the castNum of sprite lastsprite
  43.     set the castNum of sprite lastsprite to c - 1
  44.     set c to the castNum of sprite gCurrDialogButtonDM
  45.     set the castNum of sprite gCurrDialogButtonDM to c + 1
  46.     updateStage()
  47.   else
  48.     if (the key = RETURN) or (the key = ENTER) then
  49.       hiliteButton(lastsprite)
  50.       mouseDown(script the scriptNum of sprite lastsprite)
  51.     end if
  52.   end if
  53. end
  54.  
  55. on dialogButtonChoice c
  56.   global gDialogResult, gDialogCallback
  57.   set gDialogResult to c
  58.   if count(the windowList) > 0 then
  59.     tell the stage
  60.       do(gDialogCallback)
  61.     end tell
  62.   else
  63.     beep()
  64.   end if
  65. end
  66.  
  67. on hiliteButton s
  68.   if voidp(s) then
  69.     if the lastClick < 20 then
  70.       set s to the clickOn
  71.     else
  72.       exit
  73.     end if
  74.   end if
  75.   set h to the locH of sprite s
  76.   set v to the locV of sprite s
  77.   set the locH of sprite s to h + 2
  78.   set the locV of sprite s to v + 2
  79.   updateStage()
  80.   wait()
  81.   set the locH of sprite s to h
  82.   set the locV of sprite s to v
  83.   wait()
  84.   updateStage()
  85. end
  86.  
  87. on dialogwidth
  88.   return the width of sprite 1
  89. end
  90.  
  91. on dialogHeight
  92.   return the height of sprite 1
  93. end
  94.  
  95. on wait t
  96.   if voidp(t) then
  97.     set t to 10
  98.   end if
  99.   startTimer()
  100.   repeat while the timer < t
  101.     nothing()
  102.   end repeat
  103. end
  104.