{ --------------------------------------------------------------------- TDatalink ---------------------------------------------------------------------} Constructor TDataLink.Create; begin Inherited Create; FBufferCount:=1; FDatasourceFixed:=False; end; Destructor TDataLink.Destroy; begin Factive:=False; FEditing:=False; FDataSourceFixed:=False; DataSource:=Nil; Inherited Destroy; end; Procedure TDataLink.ActiveChanged; begin end; Procedure TDataLink.CheckActiveAndEditing; Var B : Boolean; begin B:=Assigned(DataSource) and (DataSource.State<>dsInactive); If B<>FActive then begin FActive:=B; ActiveChanged; end; B:=Assigned(DataSource) and (DataSource.State in dsEditModes) and Not FReadOnly; If B<>FEditing Then begin FEditing:=B; EditingChanged; end; end; Procedure TDataLink.CheckBrowseMode; begin end; Function TDataLink.CalcFirstRecord(Index : Integer) : Integer; { recalculates index of first record in buffer, and returns number of record scrolled.} Var A, // Index of active record in buffer F, // Index of current first record in buffer L : Integer; // index of Last (for us) record in buffer; begin Result:=0; A:=DataSource.DataSet.FActiveRecord; F:=FFirstRecord+Index; L:=F+FBufferCount-1; If A>L Then Result:=A-L else If A