10-20-2017 03:39 PM
Why use Mouse UP when you can use Mouse Enter? I suppose the Event would be Mouse Enter... and then would prevent code as long as the DBL is changing?
I feel like I may not be understanding fully what Mouse UP is
10-20-2017 03:59 PM
Mouse Up would accomplish what you originally requested:
"doesn't update until you've released it?"
But as has been pointed out, there are other scenarios where that doesn't work. Another scenario is where you mouse down outside of the slider, move the mouse into the slider bounds and then release the mouse. The value isn't changing but a mouse up event will fire.
I think the solution to your problem is don't use a slider where continuous value change events can't be handled properly.
10-20-2017 04:01 PM
Mouse enter: mouse hovers above the control for the first time.
Mouse up: mouse button is released while above control.
Mouse leave: mouse leaves the control area.
So forget about mouse leave. It doesn't do what you want, or is way to complex to get it to do what you want. Note that even when you are moving the slider, there is no guarantee you ever get a mouse up event. And that you might get a mouse up event, while no value was changed (click on anywhere on panel, move while pressing mouse button above control, release button) will trigger the event.
In retrospect, not useful.
10-20-2017 04:02 PM
I have not had good luck in limiting the event queue. Sometimes the event would fire and clear the queue before the next event occurred. On my timescale the events seemed continuous, but the the CPU timescale they were counted as discrete.
Something like below worked for me. You can change the time between events value, here 100 ms.
There is a slight edge case with this method, if the timer value has wrapped around and is less than 100, then the first event will not occur.
mcduff
10-20-2017 04:10 PM
@mcduff wrote:
I have not had good luck in limiting the event queue. Sometimes the event would fire and clear the queue before the next event occurred. On my timescale the events seemed continuous, but the the CPU timescale they were counted as discrete.
Something like below worked for me. You can change the time between events value, here 100 ms.
There is a slight edge case with this method, if the timer value has wrapped around and is less than 100, then the first event will not occur.
mcduff
That won't give you events if they happen within 100ms. So when moving rapidly, you won't get any message except the first.
10-20-2017 04:12 PM
Use Dynamic events.
Register for Mouse enter.
Then dynamically register for mouse down mouse leave and unregister mouse enter.
When mouse down happens then register for mouse up.
When either down or leave fire unregister for those and then reregister for mouse enter.
See the nugget by Ton to learn how to use dynamic events.
Ben
10-20-2017 04:18 PM
@Ben wrote:
Use Dynamic events.
Register for Mouse enter.
Then dynamically register for mouse down mouse leave and unregister mouse enter.
When mouse down happens then register for mouse up.
When either down or leave fire unregister for those and then reregister for mouse enter.
Wouldn't you still be able to make value changes when mouse leave has occurred? When mouse is still down and grabbing he slider thingy.
LV could really use a few more event. Look at gtk for examples. Lost capture and such...
10-20-2017 04:18 PM
For my case, that is what I wanted. I decimated an array based on the plot size, if someone was rapidly resizing the window, a backlog of decimations would occur.
Basically the first and last event would get register. (For example, someone grabbing the side of the window, resizing it back and forth, and then finally letting go.)
For other use cases, change the value to whatever you need for your program.
mcduff
10-20-2017 04:21 PM
wiebe@CARYA wrote:
@Ben wrote:
Use Dynamic events.
Register for Mouse enter.
Then dynamically register for mouse down mouse leave and unregister mouse enter.
When mouse down happens then register for mouse up.
When either down or leave fire unregister for those and then reregister for mouse enter.
Wouldn't you still be able to make value changes when mouse leave has occurred? When mouse is still down and grabbing he slider thingy.
LV could really use a few more event. Look at gtk for examples. Lost capture and such...
Yes so disable the slider when you leave?
Ben
10-21-2017 03:01 AM
@Ben wrote:
wiebe@CARYA wrote:
@Ben wrote:
Use Dynamic events.
Register for Mouse enter.
Then dynamically register for mouse down mouse leave and unregister mouse enter.
When mouse down happens then register for mouse up.
When either down or leave fire unregister for those and then reregister for mouse enter.
Wouldn't you still be able to make value changes when mouse leave has occurred? When mouse is still down and grabbing he slider thingy.
LV could really use a few more event. Look at gtk for examples. Lost capture and such...
Yes so disable the slider when you leave?
Ben
That might work, but it would be very inconvenient for the user. When you grab the slider, it hard to move it left and right and stay perfectly horizontal while doing that.