LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 8.1 upgrade, now cursor over control causes event

I recently upgraded from CVI 8.0 to 8.1.  In a user interface which always worked before, now when I move the cursor over a command button (not click on it, just hover the cursor over the button) an event is generated.  This event executes code which is not specifically written, but which could be part of the end of the function for the commit event on the command button.  This only occurs with one command button (so far as I can tell) and is somehow the result of the change from CVI 8.0 to 8.1.  Can anyone tell me why this is happening and how I can stop it?
 
Thank you
 
Stuart Van Deusen
0 Kudos
Message 1 of 5
(3,686 Views)
In 8.1, a new event was added called EVENT_MOUSE_POINTER_MOVE. This event will be dispatched to a command button whenever you move the mouse over that button. This is intended behavior. If this is not the event you are seeing, please let me know what the offending event is.

Regards,

-alex
0 Kudos
Message 2 of 5
(3,682 Views)

This appears to be what is happening.  I use cases to respond to events in the call back, and this call back has only a commit event case.  None of the code within the commit event case is executed, only code which is after the case and before the end of the call back function.  I do not have a response to a mouse pointer move defined in the call back.  Shouldn't the call back only be called in I have defined a response to a particular event?  Is there a way to disable all controls from responding to mouse pointer moves?

Thank you

Stuart Van Deusen

 

0 Kudos
Message 3 of 5
(3,681 Views)
In short, no. Independent of whether you explicitly handle an event in the callback, the callback will still be called for every event. This is not a change in behavior. If you have code that shouldn't be called from every event, it needs to be inside the case statement and confined to that particular event. If you have "top level" code in this function, it will also be called when the control receives any other event, such as EVENT_LOST_FOCUS, EVENT_DISCARD, etc. You probably just never noticed this before since the mouse move event will be sent many times (every time the mouse position moves and is still over the control) whereas most other events are fairly sparse.

Regards,

-alex
0 Kudos
Message 4 of 5
(3,675 Views)

Thank you for your help.  I guess I need to clean up my code a bit.

Stuart Van Deusen

0 Kudos
Message 5 of 5
(3,646 Views)