mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 23:00:35 +02:00
dbgrid: fix editor doesnt hide if while editing the last record user press down arrow key (issue #8262)
grid: enable descendant grids to override DrawCellGrid git-svn-id: trunk@10612 -
This commit is contained in:
parent
f0d0a647d0
commit
cca097adbc
@ -893,6 +893,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomDBGrid.OnDataSetScrolled(aDataset: TDataSet; Distance: Integer);
|
||||
var
|
||||
OldEditorMode: boolean;
|
||||
begin
|
||||
{$ifdef dbgDBGrid}
|
||||
DebugLn(ClassName, ' (',name,')', '.OnDataSetScrolled(',IntToStr(Distance),')');
|
||||
@ -902,11 +904,20 @@ begin
|
||||
// todo: Use a fast interface method to scroll a rectangular section of window
|
||||
// if distance=+, Row[Distance] to Row[RowCount-2] UP
|
||||
// if distance=-, Row[FixedRows+1] to Row[RowCount+Distance] DOWN
|
||||
|
||||
OldEditorMode := EditorMode;
|
||||
if OldEditorMode then
|
||||
EditorMode := False;
|
||||
|
||||
if Distance<>0 then begin
|
||||
Row:= FixedRows + FDataLink.ActiveRecord;
|
||||
Invalidate
|
||||
end else
|
||||
UpdateActive;
|
||||
|
||||
|
||||
if OldEditorMode and (dgAlwaysShowEditor in Options) then
|
||||
EditorMode := True;
|
||||
end;
|
||||
|
||||
procedure TCustomDBGrid.OnUpdateData(aDataSet: TDataSet);
|
||||
|
@ -6691,7 +6691,7 @@ begin
|
||||
end;
|
||||
DefaultDrawCell(aCol,aRow,aRect,aState);
|
||||
end;
|
||||
inherited DrawCellGrid(aCol,aRow,aRect,aState);
|
||||
DrawCellGrid(aCol,aRow,aRect,aState);
|
||||
end;
|
||||
|
||||
procedure TCustomDrawGrid.DrawFocusRect(aCol, aRow: Integer; ARect: TRect);
|
||||
|
Loading…
Reference in New Issue
Block a user