LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Block mouse click

How can I block or ignore a mouse click and other events? When data is processed I change the cursor to the hour glass and then I don't want the user to be able to push any buttons.
0 Kudos
Message 1 of 2
(2,955 Views)
To block user interface events from being generated, you must discard the corresponding events in the controls callbacks.

In your application, you can use a global variable as a flag for "updating in process" and in controls' callbacks swallow the user interface events, this way:


if (operationInProgress) {
switch (event) {
case EVENT_LEFT_CLICK:
case EVENT_RIGHT_CLICK:
case EVENT_LEFT_DOUBLE_CLICK:
case EVENT_RIGHT_DOUBLE_CLICK:
case EVENT_KEYPRESS:
return 1; // Swallow the events
default:
return 0;
}
}


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 2
(2,950 Views)