From: <ah...@us...> - 2007-12-16 12:25:04
|
Revision: 11608 http://jvcl.svn.sourceforge.net/jvcl/?rev=11608&view=rev Author: ahuser Date: 2007-12-16 04:25:00 -0800 (Sun, 16 Dec 2007) Log Message: ----------- Mantis #4299: JvDBSpinEdit - FocusKilled - OnEdit gets fired (Mantis #4299) Modified Paths: -------------- trunk/jvcl/run/JvDBSpinEdit.pas Modified: trunk/jvcl/run/JvDBSpinEdit.pas =================================================================== --- trunk/jvcl/run/JvDBSpinEdit.pas 2007-12-16 12:06:48 UTC (rev 11607) +++ trunk/jvcl/run/JvDBSpinEdit.pas 2007-12-16 12:25:00 UTC (rev 11608) @@ -322,11 +322,18 @@ procedure TJvDBSpinEdit.SetValue(NewValue: Extended); begin - FIsNull := (Text = '') and (NewValue = 0.0); - if not (FIsNull and FAllowNull) then - inherited SetValue(NewValue); - if not FDataChanging then - FDataLink.Edit; + if FDataLink.CanModify then + begin + FIsNull := (Text = '') and (NewValue = 0.0); + if not (FIsNull and FAllowNull) then + inherited SetValue(NewValue); + if not FDataChanging and (FDataLink.Field <> nil) then + begin + if (IsNull and not FDataLink.Field.IsNull) or + (not IsNull and FDataLink.Field.Value <> NewValue) then + FDataLink.Edit; + end; + end; end; procedure TJvDBSpinEdit.TextChanged; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |