DoubleEditBox Spinner Increment Rounding

I'm using a DoubleEditBox with the spinner visible. SmallChange is set to .1. Incrementing 1.111 gives you 1.211. I would like to round to SmallChange when using the spinner buttons. IOW, incrementing 1.111 should give you 1.2. Is there any way to determine if a value change was triggered by the spinner versus keyboard?

John

Comments (3)

All the incremental change requests (keyboard up/down, mouse wheel, spinner) flow through the protected virtual CreateIncrementalChangeRequest method. That method is passed an IncrementalChangeRequestKind which tells you things like small increment, but it doesn't provide a source (spinner vs. keyboard).

Thanks for the tip! Would it be possible to build spinner rounding into DoubleEditBox? I think it would benefit all users.

Currently if you set a DoubleEditBox’s spinner increment to .1, incrementing 1.234 results in 1.334, 1.434, 1.534, etc. It would be much better if the spinner rounded the value to multiples of the increment: 1.234 -> 1.3, 1.4, 1.5, etc

I solved this with a simple derived class, but from my perspective very few if any clients would want the current behavior..