LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I detect when a Panel is visible?

I want to detect when an existing panel is visible and active so I can hide it.  How is this done?
0 Kudos
Message 1 of 3
(3,397 Views)

While it may be deteemined if a panel has been positively made invisible or wether it is THE active panel or not, I'm afraid it's not so easy to calculate if a panel is not completely covered by other panels so that the operator can click on it and activate it. In this latter case if you don't want to explicitly hide it you may need to setup a panel callback that intercepts the "got focus" event and either swallows it (if possible) or makes active the previous active panel (if I'm not wrong one of eventData parameters is the handle of the prevous active panel, so you can SetActive this panel again. You may note the panel being rapidly showed and then obscured again in case the machine is not too fast).



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 2 of 3
(3,394 Views)

After testing it a little I can sat thet unfortunately my solution is not so simple as it could seem. There are a bunch of details that must be observed to make it a minimum functional.

1. Seems that mouse events on a panel cannot be swallowed: you can click on a panel and activate it even if you try to swallow the click

2. EVENT_PANEL_MOVE event is processed only AFTER the panel has been moved. For this reason you must set the panel as not-movable (and maybe not-sizable?) when it must be not-operable

3. Events on the controls are processed BEFORE panel events. That is, you may click on a control and change its state before this event is processed in the panel so you cannot discard it unless you set a global flag of panel operability and test it in every control callback on that panel Smiley Sad

Anyway, I prepared a simple project to test this solution and I attach here: maybe can be of some utility in your work.

Roberto



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 3 of 3
(3,386 Views)