Economy-x-Talk - Sample Scripts
Ask & Answer Dlog patches for Rev.
Every time when I update Revolution, I apply these patches.
Before an answer or ask dialog window appear on screen, the suspendStack message is issued. You can use this message to quickly change the menu bar, disabling all items for instance. After dismissing the answer and ask dialogs, no message is issued, thus you don't get a resumeStack message either. This is a very inconvenient bug in Revolution which is easily solved by this patch.
In the message box, type
go stack "Ask dialog"
and replace the mouseUp handler of the OK and Cancel buttons by the respective scripts as proposed here (see scripts). Save the Ask dialog stack and close it. Then type
go stack "Answer dialog"
in the mesage box. Replace the mouseUp handler in the card script by the one proposed here. From now on, you can handle the resumeStack message after closing the Ask or Answer dialog. You can add messages as you like, within the try control structure. [MS]
Addendum January 2008:
In Rev 2.9 and later, you will find a closeAccept handler in card 1 of stack "Ask Dialog". Put the patch, starting with "-- my patch" at the end of the closeAccept handler. The mouseUp handlers are still patched in the same way as before.
-- Script of button OK of stack "Ask Dialog"
on mouseUp
-- RunRev's part
switch the fieldmode of this card
case "plain"
case "question"
case "error"
case "information"
case "warning"
get field 2
break
case "clear"
get field 3
break
case "password"
get mcencrypt(field 3)
break
end switch
set the dialogData to it
lock messages
close this stack
revCleanUpAskDialog--won't get closeStack
unlock messages
-- my patch
put the defaultStack into myOldDfltStack
set the defaultStack to the topStack
try
send "resumeStack" to this cd
end try
set the defaultStack to myOldDfltStack
end mouseUp
-- Script of button Cancel of stack "Ask Dialog"
on mouseUp
-- RunRev's part
lock messages
close this stack
revCleanUpAskDialog--won't get closeStack
unlock messages
-- my patch
put the defaultStack into myOldDfltStack
set the defaultStack to the topStack
try
send "resumeStack" to this cd
end try
set the defaultStack to myOldDfltStack
end mouseUp
-- MouseUp handler of card script of cd 1 of stack Answer Dialog
on mouseUp
-- RunRev's part
if the name of the target contains "button" then
lock messages--prevents user stack getting refocusing messages
close this stack
revCleanUpAnswerDialog--won't get closeStack
unlock messages
set the dialogData to the short name of the target
-- my patch
put the defaultStack into myOldDfltStack
set the defaultStack to the topStack
try
send "resumeStack" to this cd
end try
set the defaultStack to myOldDfltStack
end if
end mouseUp
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.