mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 05:09:05 +02:00
dbgrid: update active row if active record changed (bug #7934)
git-svn-id: trunk@10502 -
This commit is contained in:
parent
17ee7d3f7d
commit
be37b3ea24
@ -2336,6 +2336,9 @@ var
|
||||
CurActiveRecord: Integer;
|
||||
begin
|
||||
if FDataLink.Active then begin
|
||||
{$ifdef dbgGridPaint}
|
||||
DebugLn('DrawAllRows: Link.ActiveRecord=%d, Row=%d',[FDataLink.ActiveRecord, Row]);
|
||||
{$endif}
|
||||
CurActiveRecord:=FDataLink.ActiveRecord;
|
||||
FDrawingEmptyDataset:=FDatalink.DataSet.IsEmpty;
|
||||
end else
|
||||
@ -2377,7 +2380,7 @@ begin
|
||||
{$endif}
|
||||
inherited DrawRow(ARow);
|
||||
{$ifdef dbgGridPaint}
|
||||
DebugLn('End Row')
|
||||
DebugLn(' End Row')
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
@ -2501,6 +2504,7 @@ begin
|
||||
// find out the column count, if result=0 then
|
||||
// there are no visible columns defined or dataset is inactive
|
||||
// or there are no visible fields, ie the grid is blank
|
||||
{$IfDef dbgDBGrid}DebugLn('TCustomDbgrid.UpdateGridCounts INIT');{$endif}
|
||||
BeginVisualChange;
|
||||
try
|
||||
Result := GetColumnCount;
|
||||
@ -2528,11 +2532,15 @@ begin
|
||||
RowCount := RecCount;
|
||||
FixedRows := FRCount;
|
||||
FixedCols := FCCount;
|
||||
|
||||
UpdateGridColumnSizes;
|
||||
|
||||
SetColRow(Col, FixedRows + FDatalink.ActiveRecord);
|
||||
end;
|
||||
finally
|
||||
EndVisualChange;
|
||||
end;
|
||||
{$IfDef dbgDBGrid}DebugLn('TCustomDbgrid.UpdateGridCounts END');{$endif}
|
||||
end;
|
||||
|
||||
procedure TCustomDBGrid.UpdateVertScrollbar(const aVisible: boolean;
|
||||
|
@ -658,7 +658,6 @@ type
|
||||
procedure SetTopRow(const AValue: Integer);
|
||||
procedure TryScrollTo(aCol,aRow: integer);
|
||||
procedure UpdateScrollBarPos(Which: TScrollStyle);
|
||||
procedure UpdateSelectionRange;
|
||||
procedure WriteColumns(Writer: TWriter);
|
||||
procedure WriteColWidths(Writer: TWriter);
|
||||
procedure WriteRowHeights(Writer: TWriter);
|
||||
@ -795,6 +794,7 @@ type
|
||||
function SelectCell(ACol, ARow: Integer): Boolean; virtual;
|
||||
procedure SetCanvasFont(aFont: TFont);
|
||||
procedure SetColor(Value: TColor); override;
|
||||
procedure SetColRow(const ACol,ARow: Integer);
|
||||
procedure SetEditText(ACol, ARow: Longint; const Value: string); dynamic;
|
||||
procedure SetBorderStyle(NewStyle: TBorderStyle); override;
|
||||
procedure SetFixedcolor(const AValue: TColor); virtual;
|
||||
@ -805,6 +805,7 @@ type
|
||||
function TryMoveSelection(Relative: Boolean; var DCol, DRow: Integer): Boolean;
|
||||
procedure UnLockEditor;
|
||||
procedure UpdateHorzScrollBar(const aVisible: boolean; const aRange,aPage: Integer); virtual;
|
||||
procedure UpdateSelectionRange;
|
||||
procedure UpdateVertScrollbar(const aVisible: boolean; const aRange,aPage: Integer); virtual;
|
||||
procedure UpdateBorderStyle;
|
||||
procedure VisualChange; virtual;
|
||||
@ -2677,6 +2678,13 @@ begin
|
||||
inherited SetColor(Value);
|
||||
end;
|
||||
|
||||
procedure TCustomGrid.SetColRow(const ACol, ARow: Integer);
|
||||
begin
|
||||
FCol := ACol;
|
||||
FRow := ARow;
|
||||
UpdateSelectionRange;
|
||||
end;
|
||||
|
||||
procedure TCustomGrid.DrawBorder;
|
||||
var
|
||||
R: TRect;
|
||||
|
Loading…
Reference in New Issue
Block a user