08-22-2011 10:13 AM
I need to open a SubVI as a modeless dialog. My main application window displays a graph, and I am trying to pass a value to another SubVI that I try to open from the main windows. The problem I see is that when a set the properties of the SibVI as a dialog, I am able to open it. However, when I try to use the default or custom (floating) settings for the SubVI Windows Appearance, the window does not show up at all.
Any ideas?
08-22-2011 10:27 AM
Make sure the Show front panel when called check box is checked. If that does not help, upload the VI or at least a screenshot of the dialog and the code.
08-22-2011 03:15 PM - edited 08-22-2011 03:24 PM
I have the same issue with closing the SubVI.
Here is the issue - once the form is closed using the X button, it will never be opened again.
Try "Menu Selection Demo.vi" from the NI Example Finder
Is there a way to disable the X button to prevent it from closing completely? Or something else should be used?
08-22-2011 03:46 PM
Using the property node, you can open and close the fp of your VI. I use this for opening dialogue boxes and info boxes. I have closed this many times using the red X with no issues of it reopening.
08-22-2011 03:50 PM
How will this work in run-time? A user might install the application to a different folder, so the location of the SubVI is unknown.
08-22-2011 04:23 PM
You would make the path relative to the main VI - not hardcoded as in the example.
And regards your original question, look at the similar example called Menu Selection with Events. There, the subVI's 'X' button is disabled - VI Properties>Window Appearance>Customize. You can also use an event to correctly handle the 'X'.
08-22-2011 04:24 PM
This is just a static file path I use on my dev system. I know the path won't change and this is something that does not get distributed. I only showed it as an example of opening and closing a fp using the property node. You can make it dynamic, but with this, I have had no issues with the red X. You can test it out using a static VI path to see if it works in your app first.
08-23-2011 12:44 AM
@Vladiator wrote:
Here is the issue - once the form is closed using the X button, it will never be opened again.
In the case of the specific example you gave, this is basically a bug in the example, probably because whoever wrote it was focused on showing menu concept and not on polishing the UI behavior. The problem there is that you close the FP of the VI, but the VI itself keeps running. This means that the calling VI is now stuck because it's waiting for the subVI to finish running. Like Dennis said, you should either disable the button or handle it using the Panel Close (or, usually better, with the Panel Close?) event.
08-23-2011 09:56 AM
@tst wrote:
In the case of the specific example you gave, this is basically a bug in the example, probably because whoever wrote it was focused on showing menu concept and not on polishing the UI behavior. The problem there is that you close the FP of the VI, but the VI itself keeps running. This means that the calling VI is now stuck because it's waiting for the subVI to finish running. Like Dennis said, you should either disable the button or handle it using the Panel Close (or, usually better, with the Panel Close?) event.
Where do I find the FP.Close Event? It does not seem to exist in LV2009. The online description for FP.Close does not give any example (http://zone.ni.com/reference/en-XX/help/371361F-01/lvprop/vi_close_front_panel/)
08-23-2011 10:35 AM
Well, I got the FP.Close event by selecting the VI Server Reference, then creating an Invoice Mode, connecting it to the VI Server Ref, and then selecting the Fron Panel Close event. Is this the right way?