|
@@ -36,6 +36,7 @@ begin
|
|
FBufferCount := 0;
|
|
FBufferCount := 0;
|
|
FEOF := True;
|
|
FEOF := True;
|
|
FBOF := True;
|
|
FBOF := True;
|
|
|
|
+ FIsUniDirectional := False;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -129,7 +130,7 @@ Function TDataset.BookmarkAvailable: Boolean;
|
|
Const BookmarkStates = [dsBrowse,dsEdit,dsInsert];
|
|
Const BookmarkStates = [dsBrowse,dsEdit,dsInsert];
|
|
|
|
|
|
begin
|
|
begin
|
|
- Result:=(Not IsEmpty) and (State in BookmarkStates)
|
|
|
|
|
|
+ Result:=(Not IsEmpty) and not FIsUniDirectional and (State in BookmarkStates)
|
|
and (getBookMarkFlag(ActiveBuffer)=bfCurrent);
|
|
and (getBookMarkFlag(ActiveBuffer)=bfCurrent);
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -139,7 +140,7 @@ var
|
|
I: Integer;
|
|
I: Integer;
|
|
begin
|
|
begin
|
|
FCalcBuffer := Buffer;
|
|
FCalcBuffer := Buffer;
|
|
- if (State <> dsInternalCalc) and (IsUniDirectional = False) then
|
|
|
|
|
|
+ if (State <> dsInternalCalc) and (FIsUniDirectional = False) then
|
|
begin
|
|
begin
|
|
ClearCalcFields(CalcBuffer);
|
|
ClearCalcFields(CalcBuffer);
|
|
for I := 0 to Fields.Count - 1 do
|
|
for I := 0 to Fields.Count - 1 do
|
|
@@ -718,6 +719,7 @@ begin
|
|
{$ifdef dsdebug}
|
|
{$ifdef dsdebug}
|
|
Writeln ('GetPriorRecord: Getting previous record');
|
|
Writeln ('GetPriorRecord: Getting previous record');
|
|
{$endif}
|
|
{$endif}
|
|
|
|
+ CheckBiDirectional;
|
|
If FRecordCount>0 Then SetCurrentRecord(0);
|
|
If FRecordCount>0 Then SetCurrentRecord(0);
|
|
Result:=GetRecord(FBuffers[FBuffercount],gmPrior,True)=grOK;
|
|
Result:=GetRecord(FBuffers[FBuffercount],gmPrior,True)=grOK;
|
|
if result then
|
|
if result then
|
|
@@ -863,6 +865,11 @@ begin
|
|
ShowException(ExceptObject,ExceptAddr);
|
|
ShowException(ExceptObject,ExceptAddr);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TDataSet.SetUniDirectional(const Value: Boolean);
|
|
|
|
+begin
|
|
|
|
+ FIsUniDirectional := Value;
|
|
|
|
+end;
|
|
|
|
+
|
|
Procedure TDataset.SetActive (Value : Boolean);
|
|
Procedure TDataset.SetActive (Value : Boolean);
|
|
|
|
|
|
begin
|
|
begin
|
|
@@ -1065,7 +1072,7 @@ begin
|
|
bfBOF : InternalFirst;
|
|
bfBOF : InternalFirst;
|
|
bfEOF : InternalLast;
|
|
bfEOF : InternalLast;
|
|
end;
|
|
end;
|
|
- FCurrentRecord:=index;
|
|
|
|
|
|
+ if not FIsUniDirectional then FCurrentRecord:=index;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -1097,6 +1104,7 @@ end;
|
|
Procedure TDataset.SetFiltered(Value: Boolean);
|
|
Procedure TDataset.SetFiltered(Value: Boolean);
|
|
|
|
|
|
begin
|
|
begin
|
|
|
|
+ if Value then CheckBiDirectional;
|
|
FFiltered := value;
|
|
FFiltered := value;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -1537,17 +1545,26 @@ Procedure TDataset.First;
|
|
|
|
|
|
|
|
|
|
begin
|
|
begin
|
|
- CheckBrowseMode;
|
|
|
|
- DoBeforeScroll;
|
|
|
|
- ClearBuffers;
|
|
|
|
- try
|
|
|
|
- InternalFirst;
|
|
|
|
- GetNextRecords;
|
|
|
|
- finally
|
|
|
|
- FBOF:=True;
|
|
|
|
- DataEvent(deDatasetChange,0);
|
|
|
|
- DoAfterScroll;
|
|
|
|
- end;
|
|
|
|
|
|
+ if not FBof then
|
|
|
|
+ begin
|
|
|
|
+ CheckBrowseMode;
|
|
|
|
+ DoBeforeScroll;
|
|
|
|
+ if FIsUniDirectional then
|
|
|
|
+ begin
|
|
|
|
+ Active := False;
|
|
|
|
+ Active := True;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ ClearBuffers;
|
|
|
|
+ try
|
|
|
|
+ InternalFirst;
|
|
|
|
+ if not FIsUniDirectional then GetNextRecords;
|
|
|
|
+ finally
|
|
|
|
+ FBOF:=True;
|
|
|
|
+ DataEvent(deDatasetChange,0);
|
|
|
|
+ DoAfterScroll;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
Procedure TDataset.FreeBookmark(ABookmark: TBookmark);
|
|
Procedure TDataset.FreeBookmark(ABookmark: TBookmark);
|
|
@@ -1672,19 +1689,23 @@ end;
|
|
Procedure TDataset.Last;
|
|
Procedure TDataset.Last;
|
|
|
|
|
|
begin
|
|
begin
|
|
- CheckBrowseMode;
|
|
|
|
- DoBeforeScroll;
|
|
|
|
- ClearBuffers;
|
|
|
|
- try
|
|
|
|
- InternalLast;
|
|
|
|
- GetPriorRecords;
|
|
|
|
- if FRecordCount>0 then
|
|
|
|
- FActiveRecord:=FRecordCount-1
|
|
|
|
- finally
|
|
|
|
- FEOF:=true;
|
|
|
|
- DataEvent(deDataSetChange, 0);
|
|
|
|
- DoAfterScroll;
|
|
|
|
- end;
|
|
|
|
|
|
+ CheckBiDirectional;
|
|
|
|
+ if not FEOF then
|
|
|
|
+ begin
|
|
|
|
+ CheckBrowseMode;
|
|
|
|
+ DoBeforeScroll;
|
|
|
|
+ ClearBuffers;
|
|
|
|
+ try
|
|
|
|
+ InternalLast;
|
|
|
|
+ GetPriorRecords;
|
|
|
|
+ if FRecordCount>0 then
|
|
|
|
+ FActiveRecord:=FRecordCount-1
|
|
|
|
+ finally
|
|
|
|
+ FEOF:=true;
|
|
|
|
+ DataEvent(deDataSetChange, 0);
|
|
|
|
+ DoAfterScroll;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
Function TDataset.MoveBy(Distance: Longint): Longint;
|
|
Function TDataset.MoveBy(Distance: Longint): Longint;
|
|
@@ -1883,7 +1904,7 @@ begin
|
|
{$ifdef dsdebug}
|
|
{$ifdef dsdebug}
|
|
Writeln ('Resync called');
|
|
Writeln ('Resync called');
|
|
{$endif}
|
|
{$endif}
|
|
-
|
|
|
|
|
|
+ CheckBiDirectional;
|
|
// place the cursor of the underlying dataset to the active record
|
|
// place the cursor of the underlying dataset to the active record
|
|
// SetCurrentRecord(FActiverecord);
|
|
// SetCurrentRecord(FActiverecord);
|
|
|
|
|