LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Force user to fill a window interface before closing it

Solved!
Go to solution

Hi All,

 

We already have an application written in Labwindows and we need to modify for new requirements. According to the present requirement, user should provide more information before proceeding with the application. The idea is to popup a window and force the user to fill information in this window. I have two questions here :

 

- How do I prevent user from closing the second window before he enters anything (something like modal window concept) ? He should be able to access first window only after he clicks ok in the second window, thereby exiting from second.

- How do I pass values between the two windows ?

 

Thanks,

Kanu

0 Kudos
Message 1 of 5
(3,122 Views)
Solution
Accepted by topic author Kanu

Hi Kanu,

these questions involve some very basic concepts in CVI that you may need to study or refresh. Smiley Wink

 

As you may know, the simplest way that you may have a modal window in CVI is to use InstallPopup after loading the panel: this guarantees that the user cannot access other panels before closing the popup panel (well, there are other ways and some caveats in my assertion, but let's go the simplest way first).

When the user clicks on Ok, Close or whichever button you place on that panel, you need to retrieve the value of relevant controls with GetCtrlVal, validate them some way according to the nature of control and your requirements and only if valid close the panel with DiscardPanel (or RemovePopup if you need to reuse it and don't want to reload it).

Passing data to the second panel is made via SetCtrlVal.

 

As you may see, these are very general concepts, that may apply to your application or not. In case you have some doubts please add some more details to your question.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,117 Views)

Thanks Roberto. I appreciate your help. I have one more question. Is it possbile to suspend the functioning of parent window and resume only after the child window has been closed ? What I mean is that could the parent window be made to wait until child window is closed ?

 

Regards,

Kanu

0 Kudos
Message 3 of 5
(3,100 Views)

Kanu:

 

If you want the parent window to wait, you can use InstallPopup() and GetUserEvent().

 

Take a look at the following messages.

 

http://forums.ni.com/t5/LabWindows-CVI/Moving-MessagePopup/m-p/1017597#M44113

 

http://forums.ni.com/t5/LabWindows-CVI/How-do-you-use-InstallPopup/m-p/274074#M18828

0 Kudos
Message 4 of 5
(3,092 Views)

Thanks for help.

 

Kanu

0 Kudos
Message 5 of 5
(3,089 Views)