LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MessagePopup Hidden

Solved!
Go to solution

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.

0 Kudos
Message 1 of 20
(4,901 Views)

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.

    

0 Kudos
Message 2 of 20
(4,880 Views)

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.

 

0 Kudos
Message 3 of 20
(4,871 Views)

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.

 

0 Kudos
Message 4 of 20
(4,869 Views)

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
0 Kudos
Message 5 of 20
(4,842 Views)

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.

0 Kudos
Message 6 of 20
(4,837 Views)

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

0 Kudos
Message 7 of 20
(4,792 Views)

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.

0 Kudos
Message 8 of 20
(4,787 Views)

Lars:

 

If you still need a simple example I can try create one for you.

 

Just let me know.

 

Thanks.

0 Kudos
Message 9 of 20
(4,786 Views)

For the record, here are two other threads on this topic:

 

This one is related to multiple threads.

This one ends with my screenshots documenting the problem with CVI.

 

--Ian

0 Kudos
Message 10 of 20
(4,766 Views)