LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"Always On Top" panel sometimes isn't...

I've had a request from a customer to avoid the situation that can occur during the execution of a CVI program. The GUI is very small, and if he clicks another Windows application (Explorer, for instance) while the CVI one is active then, as expected, the GUI disappears behind the window with the new focus. Easy! I thought, and selected the "Always On Top" floating option in the uir editor for my main panel. This did not have the desired effect, though. When the panel is displayed, it is indeed on top of all other windows, but when the user selects a GUI control to bring up a FileSelectPopup() (modal) dialogue box, then this box and the original panel lose their floating status and can be covered by another window. As soon as the FileSelect box is dismissed, the main GUI is once again always floating. Is this expected behaviour? I'm using CVI 7.0 with Windows XP.
 
JR
0 Kudos
Message 1 of 5
(4,865 Views)
Hello JR,

Yes, this is expected behavior. Modal dialogs have priority even over floating panels. The reason being that modal dialogs typically require immediate attention from the user, and they disallow interaction with all other panels. If floating panels remained on top of modal dialogs, the end user might never see them, and they would probably be puzzled as to why they could no longer operate their panels. And even if they knew that there was a modal dialog behind them, they still would not be able to move the other panel out of the way.

Knowing this, you could perhaps move your GUI panel immediately before calling FileSelectPopup. This way, you can avoid it being covered by the file dialog, which you can assume to be displayed at the center of the monitor.

Luis
0 Kudos
Message 2 of 5
(4,835 Views)

Luis,

I fully expected the modal FileSeletPopup() dialogue box to cover my CVI panel: this is not the issue here and is of course the whole point of using a modal dialogue box in the first place! The issue is that the CVI panel (and any subsequent dialogue boxes generated by the program) needs to be set to be always on top of other Windows applications (Word, Excel, Explorer...). Setting the relevant panel attribute to FLOAT_ALWAYS does indeed make the CVI panel have the desired effect, but when the program pops up a file dialogue box the overall effect is as if this attribute is not in force - the popup panel can be covered by another Windows application. As soon as the popup is dismissed, the CVI application regains its correct z-order status and cannot be obscured. Is there a way to keep the popup panel "always on top" as well - I would have expected it to have inherited this status from the main panel?

JR

0 Kudos
Message 3 of 5
(4,813 Views)
JR,

Yes, I think I understand your point, and it is legitimate. Unfortunately, however, it is not possible to do what you need.

There are two somewhat separate issues, having to do with the floating status each of the windows involved:

1. The main panel has to be "de-floated" while the modal panel is up, since there is no way to make it floating with respect to other applications, but not floating with respect to the modal panel. So it has to be completely de-floated.

2. The modal panel itself is not floating, because we cannot assume that that is what the programmer wants. You raise the possibility of inheriting the floating attribute from the main panel, which I agree, would make sense in your application. However, in CVI there really is no concept of a "main panel". There could be an indeterminate number of panels at the time that a modal dialog is displayed. There could even be zero other panels. Therefore, there really is no such thing as inheritance from panel to panel. And in this case, the modal dialog isn't really even a panel, in the CVI sense of the word. It sounds from your first post as if this is a file dialog -- which is indeed modal -- but it is not a UI panel, capable of having the standard set of attributes that all panels can have.

Your requirement does makes sense, and I feel bad that CVI is not handling it. The real problem, I suppose, is that this is the first time I can think of, where we received a request for modal dialogs to be floating. Otherwise we might have already provided some way of doing this.

Luis
Message 4 of 5
(4,795 Views)
Thanks Luis. I'll have to sweet talk our customer into thinking he wants what we are able to provide... Smiley Very Happy
 
JR
Message 5 of 5
(4,790 Views)