TFloatSpinEdit: fix updating control in SetValue (issue #0026488)

git-svn-id: trunk@46005 -
This commit is contained in:
bart 2014-08-02 08:55:59 +00:00
parent a469a64f53
commit 33b12a6ca4

View File

@ -113,8 +113,13 @@ begin
end;
procedure TCustomFloatSpinEdit.SetValue(const AValue: Double);
var
ValueFromText: Extended;
begin
if FValue = AValue then Exit;
if (FValue = AValue)
//if you set text by code (or paste it) and text is not a valid float, then FValue will hold the previous value
//and in that case we should not exit here...
and (TryStrToFloat(Text, ValueFromText) and (ValueFromText = FValue)) then Exit;
FValue := AValue;
// clear FValueChanged to prevent getting the old value from the widget