home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club KidSoft Volume 3 #2
/
CKSPCV32.BIN
/
movies
/
dialogs.dir
/
00001_Script_1
next >
Wrap
Text File
|
1995-02-07
|
4KB
|
136 lines
-- *** Need to add win dialog looks
on startMovie
ShowAllChannels
SetTextInfo "Dialog Text", " ", "left", "chicago", 12, "plain"
SetTextInfo "Ask Text", " ", "left", "chicago", 12, "plain"
global gDialogType
go to marker(gDialogType)
end
on stopMovie
RestoreKeyDownScript
end
on CloseAnswer buttonPressed
ForgetAMIAW "DIALOGS"
global gDialogCloseHandler
if voidP(gDialogCloseHandler) = TRUE or gDialogCloseHandler = empty then
set doIt = empty
else
set doIt = gDialogCloseHandler & "(" & quote & buttonPressed & quote & ")"
end if
return doIt
end
on CloseAsk buttonPressed, askText
ForgetAMIAW "DIALOGS"
global gDialogCloseHandler
if voidP(gDialogCloseHandler) = TRUE or gDialogCloseHandler = empty then
set doIt = return
else
set doIt = gDialogCloseHandler & "(" & quote & buttonPressed & quote & "," & quote & askText & quote & ")"
end if
return doIt
end
on CloseDialog buttonText
cursor 4
if label(0) = marker("MacAnswer") then
set doIt = CloseAnswer(buttonText)
else
set foo = field "Ask Text"
set doIt = CloseAsk(buttonText, foo)
end if
ExecuteDialogHandler(doIt)
end
on DialogKeyDownScript
-- Can only deal with default button since we have no idea what the text of any other button might be
-- and whether cmd-. or escape should be used on them...
set stdKey = IsOKCancelKey(the key)
if stdKey = "OK" then
set buttonText = the text of cast "OK Button"
CloseDialog(buttonText)
else if stdKey = "Cancel" then
-- do nothing
end if
end
on HideDialogItems
set the visible of sprite 3 to FALSE -- Button 1 (Left)
set the visible of sprite 4 to FALSE -- Button 2 (Center)
set the visible of sprite 5 to FALSE -- OK button (Right/Default)
set the visible of sprite 6 to FALSE -- OK Button outline
end
on InitDialog
global gDialogText, gDialogAskText
global gDialogButton1, gDialogButton2, gDialogButton3
put gDialogText into field "Dialog Text"
put gDialogAskText into field "Ask Text"
global gDialogHeight
set windowRect = the rect of window "DIALOGS"
set curHeight = getAt(windowRect, 4) - getAt(windowRect, 2)
if curHeight <> gDialogHeight then
set top = getAt(windowRect, 2)
setAt(windowRect, 4, top + gDialogHeight)
set the rect of window "DIALOGS" = windowRect
end if
set buttonV = gDialogHeight - 40
if gDialogButton1 <> empty and voidP(gDialogButton1) <> TRUE then -- Left
set the text of cast "Button 1" = gDialogButton1
puppetSprite 3, TRUE
set the locV of sprite 3 = buttonV
set the visible of sprite 3 to TRUE
else
set the visible of sprite 3 to FALSE
end if
if gDialogButton2 <> empty and voidP(gDialogButton2) <> TRUE then -- Center
set the text of cast "Button 2" = gDialogButton2
puppetSprite 4, TRUE
set the locV of sprite 4 = buttonV
set the visible of sprite 4 to TRUE
else
set the visible of sprite 4 to FALSE
end if
if gDialogButton3 <> empty and voidP(gDialogButton3) <> TRUE then -- Right
set the text of cast "OK Button" = gDialogButton3
puppetSprite 5, TRUE
set the locV of sprite 5 = buttonV
puppetSprite 6, TRUE -- OK outline
set the locV of sprite 6 = buttonV + the height of sprite 6 / 2 - 4
set the visible of sprite 5 to TRUE
set the visible of sprite 6 to TRUE
else
set the visible of sprite 5 to FALSE
set the visible of sprite 6 to FALSE
end if
updateStage
end
on RestoreKeyDownScript
global savedKeyDownScript
set the keyDownScript to savedKeyDownScript
set the exitLock = TRUE
end
on SetDialogKeyDownScript
global savedKeyDownScript
set savedKeyDownScript = the keyDownScript
set the keyDownScript to "DialogKeyDownScript"
set the exitLock = TRUE
end
on UpdateCurrentDialog
-- stage calls this when it wants to change the dialog in place, but not bring the current one down first
InitDialog
end