LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling user interaction with panel.

I have a large panel, with many nested subpanels which each contain many controls. I would like to disable user interaction with this panel at times. Dimming the panel with SetPanelAttribute (panel, ATTR_DIMMED, 1) is not ideal because it makes the controls hard to read. Simply not processing events is also not possible because there is another panel that the user does need to interact with. And I'd like to avoid manually setting ATTR_CTRL_MODE to VAL_INDICATOR on all the controls if possible.
Any suggestions?
0 Kudos
Message 1 of 5
(3,761 Views)
You could try using a global variable set to 0 to process callback events and set to 1 if you want to skip event processing. Next in all your control callbacks you have to insert this instruction (at the very beginning):

if (processEvents) return 1;

The 'return 1' swallows all mouse and keyboard events (as if they weren't happened), so for example if the user clicks of numerics up and down arrows or types a new value the control is not updated.
When you decide to process events again simply set 'processEvents = 0' and all will work as usual.

Depending on the number of controls and callbacks in your panels, this operation can be tedious and you can forgive some callback. You could consider to simplify your code joining at least the simplest callbacks in one, de
tecting the control at the beginning (switch (control)...) and executing the proper code.

Hope this helps you a little.
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 2 of 5
(3,761 Views)
From my experience, once a user finds that a panel won't respond, their next action is ! Might be an idea to have a control which specifically tells them what's going on?
0 Kudos
Message 3 of 5
(3,761 Views)
Good suggestion. My program is designed to monitor and control a large number of devices, and one feature it has is to take snapshots of the current state. The situation in which I want to lockout interaction with my main panel is when the user goes into playback mode to view the previously taken snapshots. In this case I do change the background color of the main panel to remind them that they are in playback mode and another window comes up that .... Oh, cool I just thought of how to do what I want to 🙂 Like I was saying I popup another window to let them cycle through the snapshots theyve taken. If I make this window a PopupPanel, then it will steal focus until it is closed, blocking them from interacting with the main window. Funny how
you don't think of the answer until you decide that you need to ask someone for help 🙂 thanks.
0 Kudos
Message 4 of 5
(3,761 Views)
Glad to be of service.

Since I've just had too much to drink to drive, but not enough to burn myself on the oven that I've just taken my reheated pizza out of, I thought I'd share these thoughts:-

1. LabWindows can do anything - just ask it nicely.

2. It is a graphical USER interface. The users are often pretty stupid however, so KISS!

3. Work for yourself. Your program should be simple enough that you can understand it six months later, but complex enough that no-one else will EVER understand it.

4. It is easy to be clever with a program like this. You can Active-X your data direct into an Excel spreadsheet. This is complicated, and will impress your peer group.

5. You are not employed by your peer group, you work for s
omeone with a degree in business studies. Your efforts will go completely unregarded.

6. Data is best presented in .CSV format, which is blindingly simple to do, and will give any normal PC-illiterate manager orgasms as Excel effortlessly imports it.

7. Come the year 2030 or so, the Y2K bug will actually happen. Then we'll all be found out!
0 Kudos
Message 5 of 5
(3,761 Views)