From: <ob...@us...> - 2006-11-06 09:03:26
|
Revision: 11004 http://svn.sourceforge.net/jvcl/?rev=11004&view=rev Author: obones Date: 2006-11-06 01:03:20 -0800 (Mon, 06 Nov 2006) Log Message: ----------- Mantis 3982: Notification when removing the datasource. Modified Paths: -------------- trunk/jvcl/run/JvDBSpinEdit.pas Modified: trunk/jvcl/run/JvDBSpinEdit.pas =================================================================== --- trunk/jvcl/run/JvDBSpinEdit.pas 2006-11-06 08:59:36 UTC (rev 11003) +++ trunk/jvcl/run/JvDBSpinEdit.pas 2006-11-06 09:03:20 UTC (rev 11004) @@ -71,6 +71,9 @@ public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + property IsNull: Boolean read FIsNull; published property AllowNull: Boolean read FAllowNull write FAllowNull default True; @@ -259,6 +262,18 @@ FDataLink.Edit; end; +procedure TJvDBSpinEdit.Notification(AComponent: TComponent; + Operation: TOperation); +begin + inherited Notification(AComponent, Operation); + + if Operation = opRemove then + begin + if Assigned(FDataLink) and (AComponent = DataSource) then + DataSource := nil; + end; +end; + procedure TJvDBSpinEdit.ReadReadOnlyField(Reader: TReader); begin ReadOnly := Reader.ReadBoolean; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |