04-04-2011 07:03 PM
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
Solved! Go to Solution.
04-05-2011 03:20 AM
Hi Kanu,
these questions involve some very basic concepts in CVI that you may need to study or refresh.
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.
04-05-2011 12:03 PM - edited 04-05-2011 12:10 PM
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
04-05-2011 01:12 PM
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
04-05-2011 01:37 PM
Thanks for help.
Kanu