Recent

Author Topic: TSpinEdit possible bug  (Read 5307 times)

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: TSpinEdit possible bug
« Reply #15 on: October 03, 2021, 04:27:04 pm »
I hope I possibly solved it for SpinEditEx in #e868afe1 #16c42cea .

Bart

[ETA] Updated revision hash.
« Last Edit: October 03, 2021, 04:45:10 pm by Bart »

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: TSpinEdit possible bug
« Reply #16 on: October 03, 2021, 04:49:53 pm »
its all based form the customFloatSpinEdit I think its called, shouldn't it be solved for that so that all others will use the same fix ?

No, the T(Float)SpinEditEx family has access to the underlying Edit control (it does not inherit from TCustomEdit, it is a compound control) , so it has acces to it's OnChange event.
So, you can set Modified there, just before OnChange is called.

T(Float)SpinEdit OTH is a native control and setting I tried setting Modified in TextChanged (which will call Chaged, which calls OnChange), but this does not work, somewhere along the line Modified gets reset to True even if I set it to False in TextChanged.

Bart

hennerd

  • Newbie
  • Posts: 6
Re: TSpinEdit possible bug
« Reply #17 on: October 03, 2021, 07:05:42 pm »
I find that with TSpinEdit, if both MaxValue and MinValue are set to the same number, then the component acts as if no limits were present at all.
This is by design, it is Delphi compatible.
I can see that this is not properly documented though.

Bart

Actually the Cocoa implementation of TSpinEdit behaves differently: if MinValue = 0 and MaxValue = 0, Value cannot be changed, it is always 0.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: TSpinEdit possible bug
« Reply #18 on: October 03, 2021, 08:07:43 pm »
Actually the Cocoa implementation of TSpinEdit behaves differently: if MinValue = 0 and MaxValue = 0, Value cannot be changed, it is always 0.
this is fixed here (61c40eb..46d12df)
« Last Edit: October 03, 2021, 08:09:28 pm by skalogryz »

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: TSpinEdit possible bug
« Reply #19 on: October 03, 2021, 09:45:40 pm »
I think I may have fixed it in a slightly different way in #2befd9dd.

Please test.

Bart

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: TSpinEdit possible bug
« Reply #20 on: October 04, 2021, 06:43:14 pm »
Yes, it seems to be working now..

I only tested with TSpinEDit, I didn't to the float version but I assume that should also be working..

The changes are in the parent (TFloatSPinEdit), so yes, that should work.
I must admit I did not actually test that, but the theory says it should  O:-)

Bart

 

TinyPortal © 2005-2018