T(Float)SpinEditEx: fix setting (initial) value if NullValueBehaviour = nvbShowTextHint.

This commit is contained in:
Bart 2024-02-18 16:02:44 +01:00
parent 893885c9db
commit 5168d97f96
2 changed files with 9 additions and 3 deletions

View File

@ -34,6 +34,9 @@ procedure TSpinEditExBase.UpdateControl;
var var
ANumber: T; ANumber: T;
begin begin
{$ifdef debugspinex}
debugln(['TSpinEditExBase.UpdateControl: FSettingValue=',FSettingValue]);
{$endif}
//if (MaxValue < MinValue) then FMaxValue := MinValue; //if (MaxValue < MinValue) then FMaxValue := MinValue;
if (FNullValueBehaviour <> nvbShowTextHint) then if (FNullValueBehaviour <> nvbShowTextHint) then
FValue := GetLimitedValue(FValue); FValue := GetLimitedValue(FValue);
@ -253,7 +256,8 @@ begin
FUpdatePending := True; FUpdatePending := True;
UpdateControl; UpdateControl;
FSettingValue := False; if not (csLoading in ComponentState) then
FSettingValue := False;
end; end;
function TSpinEditExBase.GetValue: T; function TSpinEditExBase.GetValue: T;

View File

@ -71,13 +71,15 @@ unit SpinEx;
interface interface
{.$define debugspinex}
uses uses
Classes, SysUtils, Math, Classes, SysUtils, Math,
// LCL // LCL
LCLType, Controls, ClipBrd, ComCtrls, GroupedEdit, LResources; LCLType, Controls, ClipBrd, ComCtrls, GroupedEdit, LResources
{$ifdef debugspinex}, LazLogger{$endif};
{.$define debugspinex}
type type
{ TSpinEditExBase } { TSpinEditExBase }