LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

pass values between panels in different UI files

Hi All,

 

Is there a way to pass values between panels belonging to User Interface files ? Or is it easier to have one .uir and different .c and .h files ?

 

Thanks,

Kanu

0 Kudos
Message 1 of 8
(3,122 Views)

Never mind. Got it !

 

However, I have question regarding GetUserEvent() function. The situation is this : I open up a popup from a panel and then wait for Ok button event in this popup. However, I realized that if I open another popup from first popup, the GetUserEvent() is messed up. How do I still wait for th Ok button event of first popup ?

 

Thanks,

Kanu

0 Kudos
Message 2 of 8
(3,116 Views)

I should say that it's not possible for you to trap events from the first popup,and this depends on the basic concept of "popup panel".

When you install a popup panel, all user interaction with existing panels is excluded: all focus it aimed at the popup only, no other user interface event is generated. If you launch another popup from the first one, the second popup prevails over the first one and no event can be generated on the first panel until the second one is closed.

Handling a chain of two popup panels while looping on GetUserEvent can lead to unpredictable situation not so easy to untangle.



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?
Message 3 of 8
(3,111 Views)

Hi Roberto,

 

Thanks a lot for your help. I realized that second popup does prevail the first as per "pop up concept" 🙂 . Also, when I click a button in second panel, the GetUserEvent() function takes that an event and proceeds with the code 😞 . Should I be able to solve it if I go to second popup using DisplayPanel() instead of InstallPopUp() ?

 

Thanks,

Kanu

0 Kudos
Message 4 of 8
(3,106 Views)

If you want to operate indifferently on both panels you cannot load the second as a popup.

Using a single loop with GetUserEvent to hadle events on two different panels can be a little complicated. An alternative could be to leave GetUserEvent to handle events for the popup only, set all controls on the second panel as "normal" instead of "hot" and install callbacks on them that handle EVENT_LEFT_CLICK event instead of commit one.

A little tricky and maybe difficult to understand after a few months you don't look at it: be sure to document it carefully in order to make future maintenance easy.



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 5 of 8
(3,104 Views)

I just realized that DisplayPanel will not work for the second panel as first one has been opened using InstallPopUp. So I was just wondering how should be solving the problem ?

 

Thanks,

Kanu

0 Kudos
Message 6 of 8
(3,102 Views)

Ok... I tried as you suggested but doesn't seem to work. Probably I did not explain my problem fully.

 

Basically, I have a panel (original panel) from where I popup one panel (first popup) using InstallPopUp and wait for Ok button click of first popup in original panel as only then I have to proceed with rest of the code of original panel. This works fine as long as I do not open any other popup from first popup. GetUserEvent() messes up if I open a second popup and click any button on it.

 

Is there any way to work around it ? Only one thing I have to make sure is that original panel's code doesn't proceed until all the popups are closed... thats the main issue. Is there any way I can do this ? or I am just thinking wrong ?

 

Thanks for help. I appreciate it.

 

Regards,

Kanu

0 Kudos
Message 7 of 8
(3,099 Views)

Hi Roberto,

 

I guess.. I am sorry for the bother. I solved my problem. I wait for all the user evenst in GetUserEvent(), which in a while loop, and proceed only when all popup panels are inactive using ATTR_ACTIVE attribute.

 

Thanks for help,

Kanu

 

 

0 Kudos
Message 8 of 8
(3,083 Views)