Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
Delphi XE3 Enterprise
|
AW: Eigene TImage Komponente mit Dataset
16. Aug 2012, 16:12
Delphi-Quellcode:
TCTFlowDatalink = class(TDataLink)
private
FFieldCount: Integer;
FModified: Boolean;
FInUpdateData: Boolean;
protected
procedure ActiveChanged; override;
procedure DataSetChanged; override;
procedure DataSetScrolled(Distance: Integer); override;
procedure LayoutChanged; override;
procedure RecordChanged(Field: TField); override;
procedure UpdateData; override;
public
constructor Create(aCTFlow: TCTFlow);
destructor Destroy; override;
procedure Modified;
procedure Reset;
property FieldCount: Integer read FFieldCount;
end;
TCTFlow...
Private
FDataLink: TCTFlowDatalink;
function GetDataSource: TDataSource;
procedure SetDataSource(const Value: TDataSource);
Public
constructor Create(AOwner: Tcomponent);
destructor Destroy;overload;
Published
property DataSource: TDataSource read GetDataSource write SetDataSource;
...
implementation
constructor TCTFlow.Create(AOwner: Tcomponent);
begin
inherited;
....
FDataLink := CreateDataLink;
end;
destructor TCTFlow.Destroy;
begin
......
FreeAndNil(FDataLink);
inherited;
end;
function TCTFlow.GetDataSource: TDataSource;
begin
Result := FDataLink.DataSource;
end;
procedure TCTFlow.SetDataSource(const Value: TDataSource);
begin
if Value = FDataLink.DataSource then
Exit;
if Assigned(Value) then
if Assigned(Value.DataSet) then
if Value.DataSet.IsUnidirectional then
DatabaseError(SDataSetUnidirectional);
FDataLink.DataSource := Value;
if Value <> nil then
Value.FreeNotification(self);
end;
function TCTFlow.CreateDataLink: TCTFlowDatalink;
begin
Result := TCTFlowDatalink.Create(self);
end;
.....
Thomas Wassermann H₂♂ Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂♂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)
|