06-09-2011 12:26 PM
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
06-09-2011 01:52 PM
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
06-09-2011 03:31 PM
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.
06-09-2011 03:52 PM
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
06-09-2011 04:07 PM
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.
06-09-2011 04:11 PM
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
06-09-2011 04:32 PM - edited 06-09-2011 04:33 PM
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
06-09-2011 05:18 PM
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