Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

No button value for MouseUp event in CNiGraph

I have a CNiGraph with a OnPlotAreaMouseUp callback.
When this callback is called the Button parameter is always zero. The shift parameter appears to work correctly showing, shift and alt status, but the Button value never changes. Any ideas?
0 Kudos
Message 1 of 3
(3,287 Views)
This behavior is by design. The button parameter to the plot area mouse events specifies the state of the buttons. When the mouse up event occurs, the button in question is up, so you get a 0 which indicates that no buttons are depressed. That being said, I'm not sure that this designed behavior is what most applications need. Unfortunately, we cannot change the behavior without risking breaking existing applications.

The best you can do at this point is to handle the plot area mouse down events, save the mouse state, and compare this saved state against the state specified by the plot area mouse up event to determine which mouse button caused the plot area mouse up event.
Message 2 of 3
(3,287 Views)
Thanks for the answer, I guess it does make sense (sort of). I'll use the workaround you suggest.

Best Wishes

Paul
0 Kudos
Message 3 of 3
(3,287 Views)