01-21-2016 04:55 AM
I use a very minimalistic dialog VI showing only a Gauge indicator on its front panel. Here is the snapshot of this VI:
The purpose of this dialog is that, the user can pop up a larger size gauge indicator via clicking on the menu selection of one of the many indicators on the main VI front panel. The window behaviour is set to "floating", and I use the "Preallocated clone reentrant execution" so the user can launch as many dialogs as necessary. This is the place where I call async these dialog VIs:
Everything works as I expect, however I have some questions, someone might help...
Thanks very much for any advice!
Best Regards,
Solved! Go to Solution.
01-21-2016 06:22 AM
@Blokk wrote:
What would be the best technique to detect if the user has ALREADY launched that specific indicator dialog, and instead of launching another, maybe just bring the already runnning dialog to the front and centered?
In similar "popout" functionality, using a messaging system, I send a message to all popouts that is basically "Are you showing this reference? (and if you are bring yourself to front)". Then I wait for all replies and if they all say "No" than I launch a new popout.
01-21-2016 06:29 AM - edited 01-21-2016 06:30 AM
Hmm, sounds good, but then I have to extend the recent UserEvents functionality. I think just now, as a shortcut, I will create an FGV where I store the string labels of all running dialogs. When the user tries to launch a dialog, I just check whether the required string is in the string array stored in the FGV. So avoiding extra UserEvents to send there and back.
By the way, the execution mode is OK in this case?
Thanks!
01-21-2016 09:30 AM
Actually I had to use your idea as well, so what I do, I use the FGV to store and check if a dialog is already running or not, if it does, I send a UserEvent command beside the ItemTag and the CtrlRef values to all running dialogs. All running dialogs check which one of them corresponds to the sent ItemTag and Ctrl value, if so, it brings itself to the front center of the actual screen.
It works very nice.
Thanks! 🙂
01-21-2016 09:52 AM - edited 01-21-2016 09:52 AM
@Blokk wrote:
By the way, the execution mode is OK in this case?
I don't think Shared versus Parallel Reentrant makes any difference to 0x80 Open VI ref, which makes a new clone regardless.
@Blokk wrote:
I think just now, as a shortcut, I will create an FGV where I store the string labels of all running dialogs.
Personally I never use FGVs, but I've put effort into reuse code to make messaging easier.
01-21-2016 02:32 PM
Here is the code to message all Popouts and see if any one replied that it was already showing the item requersted (a VI, in my case):