Strange behaviour of TSpinEdit when Value = MaxInt and then increment
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
If a TSpinEdit is not limited (e.i. MaxValue=MinValue) and you set Value to MaxInt and then you click the increment spinner the text in the control changes from 2147483647 to 2147483648, but when querying Value, it will report -2147483648.
This process continues when you further increment the SpinEdit.
SpinEdit1: Text = 2147483648, Value = -2147483648
SpinEdit1: Text = 2147483649, Value = -2147483647
SpinEdit1: Text = 2147483650, Value = -2147483646
SpinEdit1: Text = 2147483651, Value = -2147483645
SpinEdit1: Text = 2147483652, Value = -2147483644
Steps to reproduce:
Build and run attached demo.
Click Button1
Click the up spinner of the SpinEdit, click the speedbutton with caption '?'
Repeat this.
(Never mind the other controls on the demo, I was testing T(Float)SpinEditEx when I encountered this.)
Additional information:
The internal value of a TSpinEdit is of type Double.
This is the root cause of the discrepancy between text and value.
Mantis conversion info:
- Mantis ID: 32793
- OS: Win10-64
- Build: r56186
- Platform: i386
- Version: 1.9 (SVN)
- Fixed in version: 2.0.6
- Fixed in revision: r61945 (#96eee65d)
- Target version: 2.0.6