View Full Version : Don't loose dialog focus

03 March 2009, 11:11 AM
Hi all,
I have a problem when I want to use a mini modal dialog that looses focus.
If the modal dialog disappears behind another dialog, even though it's in modal mode(!) it's impossible to bring the modal dialog back, because the interface is locked...
Is there any way to either always keep the modal dialog on top of everything or create a non modal dialog that can still pause the script flow waiting for input?

Any ideas would be appreciated, as long as I can somehow resume the script when input in the dialog has been entered.


03 March 2009, 12:49 PM
well, you can't really halt a script in a modeless dialog - you could have the main script pop up that modeless dialog, call it a day, and then let that modeless dialog call another function that resumes operation (or even worse.. set a timer that continuously checks whether that modeless dialog has given output yet)

Specifically for the problem of modal dialogs getting obscured, short of installing one of those alt-tab alternatives that let you tab to any window/dialog, try this trick...

rollout roll_test "test" (
button btn_test "test"
timer tick_tock active:true interval:250
on tick_tock tick do (
if ((keyboard.altPressed) AND (keyboard.shiftPressed) AND (keyboard.controlPressed)) do ( setFocus btn_test )
createDialog roll_test

You'd have to explain to users that they can press ctrl+alt+shift to bring the dialog back to front. Doesn't work if you somehow manage to have a dialog that is set 'always on top' obscuring it.

03 March 2009, 12:59 PM
No that'll be more then sufficient, didn't know about the setFocus command that's what I need!


03 March 2009, 01:03 PM
Even though it's hacking I love solutions like these :beer:

Works a treat!

03 March 2009, 04:18 PM
It should really be called 'HackScript', not MaxScript...

I've something similar happening when destroying a Modal Dialog in Max9 x64 which is created from a dotnet ListView interaction. I'm having to specifically set the focus back to the Dotnet controller... or else...

Thanks for the trick Richard, added that right now...

CGTalk Moderation
03 March 2009, 04:18 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.