fixed getting old value from widgetset when setting the new value (issue #1992)

git-svn-id: trunk@9122 -
This commit is contained in:
vincents 2006-04-14 18:06:47 +00:00
parent 70cab5a647
commit 1167080b3b

View File

@ -19,9 +19,9 @@
{-----------------------------------------------------------------------------}
procedure TCustomFloatSpinEdit.UpdateControl;
begin
if MaxValue<MinValue then fMaxValue:=MinValue;
if Value<fMinValue then Value:=fMinValue;
if Value>fMaxValue then Value:=fMaxValue;
if MaxValue<MinValue then FMaxValue:=MinValue;
if FValue<FMinValue then FValue:=fMinValue;
if FValue>FMaxValue then FValue:=fMaxValue;
if (not HandleAllocated) then exit;
if ([csLoading,csDestroying]*ComponentState<>[]) then begin
FUpdatePending := true;
@ -175,6 +175,8 @@ Procedure TCustomFloatSpinEdit.SetValue(const num : Single);
begin
if FValue = Num then exit;
FValue := Num;
// clear FValueChanged to prevent getting the old value from the widget
FValueChanged := false;
FUpdatePending := true;
UpdateControl;
end;