Closed StephanVerbeeck closed 5 years ago
I tried this, but it still has the problem that the NumberEdit "eats" the mouse scroll wheel messages (scrollview is blocked from scrolling when mouse cursor gets above a NumberEdit).
NumberEdit{Value: Bind("Percent", Range{0.00, 200.00}), Suffix: "%", Decimals: 2, Increment: -1},
github.com\lxn\walk\declarative\numberedit.go
inc := ne.Increment
if inc == 0 {
inc = 1
}
github.com\lxn\walk\numberedit.go#819
case win.WM_MOUSEWHEEL:
if nle.ReadOnly() || nle.increment <= 0 {
break
}
I implemented your proposed solution 2 and it works for me on Windows 10 and Server 2008 R2, not eating WM_MOUSEWHEEL
, even when a NumberEdit
is focused.
Thanks! Problem solved.
In a dialog poup to edit the type of booking of an accounting program the following error occurs. When there are more transfers detail boxes than fit on screen and the scrollview is moved up and down with the scrollwheel of the mouse then the value of all the numeric fields change at random.
It took me a while to figure out that NumberEdit uses the mouse scroll wheel ALSO so while scrolling the scrollview some of it goes to the number edit and some goes to the scrollview (depending on where the mouse cursor is at any given moment).
The result is that the user can not control the value that he/she is entering (they always change when this is NOT the intention and cause severe errors in the accounting system!!!
The code of the dialog is added below and I tried to switch the scrollwheel usage of the NumberEdit off by setting the Increment value to 0.0 but that does not work.
location of bug -> github.com\lxn\walk\declarative\numberedit.go#78