Hello,
I have a script that looks like this:
macroScript AutoBackToggle
category:"Haider"
buttonText:"AB-Toggle"
toolTip:"AutoBackup Toggle"
(
on isChecked do (autoBackup.enabled)
on execute do
if autoBackup.enabled == true then
(
autoBackup.enabled = false
/*print (autoBackup.enabled)*/
messageBox "Autobackup disabled." title:"Autobackup State" beep:false
)
else
(
autoBackup.enabled = true
/*print (autoBackup.enabled)*/
messageBox "Autobackup enabled." title:"Autobackup State" beep:false
)
)The messageBox command will lock the user, forcing one to press OK before continuing.
How do I change the popup to be a regular information popup that doesn't "lock" the viewport?
By
Comments (12)
Comment policy
.
I noticed some strange behaviours
- the rollout shows up upon Max startup, before I have pressed the button.
- rollout reappears even though I close it
But if you looking better solution then try this
.
@But if you looking better solution then try this
I emailed you last time because I had some problems. It still doesnt work with me. Will look into it again and return to you with complete report on what happens.
Thanks for the fix
Could you please add so that if I dont close the popup, but press the button again, it kills the popup and recreats it, showing the right message?
It was you :)
I don't know what is the problem, really.
.
It was you :)
I don't know what is the problem, really.
Hehe, yep :)
We'll check it later again.
Could you please add so that if I dont close the popup (red x), but press the toolbar-button again, it kills the old popup and recreats it, showing the right message?
Try with this
-- change this line
on isChecked do (msgRollPopup() ; autoBackup.enabled)
.
Almost done.
It needs to destroy the previous popup too :)
I wrote this on the phone. I can't test it
-- next cahnge this
global msgRollPopup,msgRoll
BTW you need to learn mxs very quick. Read mxs help document.
You have too meny questions :)
.
@BTW you need to learn mxs very quick. Read mxs help document.
You have too meny questions :)
You're so right. I am trying to catch up learning. Until then, I am at your mercy ;)
I made these changes to make it work:
.
Replace it with regular rollout.
macroScript AutoBackToggle
category:"Haider"
buttonText:"AB-Toggle"
toolTip:"AutoBackup Toggle"
(
global msgRollPopup
fn msgRollPopup =
(
try(destroyDialog ::msgRoll)catch()
rollout bgaRoll "Autobackup State"
(
local msg = if autoBackup.enabled then " Autobackup enabled." else " Autobackup disabled."
label lbl msg pos:[5,5] style_sunkenedge:on width:140 height:16
)
createDialog bgaRoll 150 26 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
)
on isChecked do (autoBackup.enabled)
on execute do
if autoBackup.enabled == true then
(
autoBackup.enabled = off
msgRollPopup()
)
else
(
autoBackup.enabled = on
msgRollPopup()
)
)