04-10-2010 05:32 PM
I have a MessagePopup window that can get hidden behind another panel.
I have a DisplayPanel(somePanel) that is active and after a timeout I call a MessagePopup ("Msg Title", "Msg") and the user must click on the 'OK' button.
By accident I can somehow force the MessagePopup() window to be hidden behind either the main panel or DisplayPanel(somePanel) and I cannot get back to the MessagePopup() window again so I have to kill the application from the Task Manager.
Enclosed are the typical settings of any panel.
Thanks for any advice/hints.
Solved! Go to Solution.
04-11-2010 01:28 AM
Well, why do you set the floating attribute to 'always'? The default is 'never'; this causes your panels to float above all others...
So if it is possible to change this attribute, I guess that this should solve your problem.
Otherwise, you might try calling SetPanelAttribute (panel_handle, ATTR_FLOATING, VAL_FLOAT_ALWAYS) for the message popup to bring it to front.
04-11-2010 11:41 AM
Wolfgang,
I had to set that value to 'Always' because the sub-panels kept hiding behind the main panel (which is undesirable).
Any sub-panel must never hide behind the main panel.
The problem now is a ConfirmPopup() hiding behind a sub-panel and I cannot get back to it.
I know it is there somewhere because I coded it but a 'User' would not know it is there because it is hidden.
How do you set ATTR_FLOATING on a Popup? I do not know what the handle is on a ConfirmPopup?
Here is the statement where it happens:
result = ConfirmPopup (msg_str, isIsdnInsert_ptr);
Thanks.
04-11-2010 12:46 PM
Ok, I have to correct myself, I didn't pay attention... it's not possible to set the attribute for a popup.
An alternative could be to minimize your panels programmatically, just before calling the popup.
Moeover, I do not understand what you call sub-panel; if these are child panels, you could set their z-order and possibly avoid that they get hidden behind a main panel.
04-12-2010 10:22 AM
To get back to the hidden panel, did you try Alt-Tab twice (releasing Alt in between)?
I have very occasionally seen this, and two Alt-Tabs get the modal panel back to the front.
Of course, it should not be needed at all, but I have no idea whether to blame NI or MS.
--Ian
04-12-2010 11:05 AM
Ian,
I will give your solution a try, the only downfall is that the 'User' will not know to do this.
Thanks for the tips.
04-13-2010 03:53 PM
Hey NI Nubie,
Even if that solution does work, I definitely wouldn't want you to have to tape a piece of paper to your screen saying "hit Alt-Tab twice if dialog is lost"...
Could you create a simple example that shows the behavior that you are describing? We might be able to get more insight into what you're seeing if we could reproduce it here on our end. Just post the code with instructions on what we need to do to get the message popup hidden as you're describing. Let us know!
Lars L
National Instruments
04-13-2010 04:52 PM
Hi Lars.
Here are the conditions that cause the problem to occur:
CVI app is executing statemachine code every 100 mSec by means of a timer.
1. The code in question has displayed a Text Message panel (DisplayPanel()) whose settings are listed in the earlier post.
2. The code now waits for User actions (detected by calling a VisaWrite() and a VisaRead () ).
3. If there is no User actions after 20 seconds a ConfirmPopup() is called and blocks the code until the User presses a button.
If the main CVI app window is minized at 2. above then after the 20 seconds elapses (caused by the ConfirmPopup()) the CVI app and the DisplayPanel now become maximized and frozen but the ConfirmPopup() is nowhere to be found.
The only thing that can be done is to open task manager and kill the CVI app.
Could ProcessSystemEvents() be a concern here? I call this every 100 mSec after the statemachine code is executed.
Thanks.
I will include the snippet of code. Look at the end of SM_ISDN1_CALL102_9:
Let me know if you need anymore info.
04-13-2010 04:55 PM
Lars:
If you still need a simple example I can try create one for you.
Just let me know.
Thanks.
04-14-2010 09:21 AM