12-15-2010 05:42 AM
Hello All,
I allways used these rows of the script with DIADEM 10.2 to close a dialog box and visualize a report, adjust some scales, make some check in View and return to dialog box.
dialog.Hide
WndShow "SHELL", "OPEN"
Wndshow "REPORT", "MAXIMIZE"
Call InteractionOn()
WndShow "SHELL", "HIDE"
Wndshow "REPORT", "HIDE"
dialog.Show
I installed diadem version 2010 EVALUATION and it doesn't work.
THE ERROR IS: SCRIPT STARTED FROM A DIALOG BOX MUST NOT ACTIVATE ANY INTERACTION???????
What is the problem? There are some alternative solution to do the same?
Thanks,
Yustas
12-15-2010 08:38 AM
Hi Yustas,
This sounds familiar. If I remember correctly, R&D never intended it to be possible to start an InteractionOn session from a non-modal SUDialog, and as soon as they realized this loophole existed they shut it down in the next DIAdem version. Philosophically, most people either want to use the InteractionOn approach with a modal SUDialog OR they want to use a non-modal SUDialog INSTEAD of using the InteractionOn approach.
The problem with InteractionOn is that you have to teach your users about it, what it is, how they have to end it, NOT to give up halfway and restart the script, leading to N instances of the script all paused and queued up in stasis waiting for someone to have to press the InteractionOff button N times to clean out the system. It's messy for a new user. It's fine for educated users. Most people feel like you can make both new and experienced users happy with a non-modal SUDialog without resorting to an InteractionOn session.
My guess is you're hiding the non-modal SUDialog because it's large and taking up too much of the monitor. What I have done in that case is make the SUDialog snap back and forth between a "large" version and a "small" version-- like the simple and advanced calculator Windows and DIAdem ship. You can programmatically set the Dialog.height and Dialog.width properties for that. You can also programmatically reposition the small SUDialog with Dialog.Top and Dialog.Left to a corner of the monitor away from the action. It's really just as easy for the user to click on the SUDialog they were just in to turn it back to it's "large" state than it is for them to find and click on the InteractionOff icon.
You can also close the SUDialog before the InteractionON session and launch it again afterwards, such that the InteractionOn command is executed from the parent VBScript instead of from the SUDialog.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
12-16-2010 10:31 AM
Hello Brad,
Thank you for your information. I have followed your advice and now everything works.
Yustas