mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-20 01:08:22 +02:00
LCL, fix dbgrid editor sometimes eating first char, issue #13951
git-svn-id: trunk@23945 -
This commit is contained in:
parent
7b512697ff
commit
ab668a2188
@ -78,7 +78,7 @@ type
|
|||||||
TDbGridExtraOptions = set of TDbGridExtraOption;
|
TDbGridExtraOptions = set of TDbGridExtraOption;
|
||||||
|
|
||||||
TDbGridStatusItem = (gsUpdatingData, gsAddingAutoColumns,
|
TDbGridStatusItem = (gsUpdatingData, gsAddingAutoColumns,
|
||||||
gsRemovingAutoColumns, gsAutoSized);
|
gsRemovingAutoColumns, gsAutoSized, gsStartEditing);
|
||||||
TDbGridStatus = set of TDbGridStatusItem;
|
TDbGridStatus = set of TDbGridStatusItem;
|
||||||
|
|
||||||
TDataSetScrolledEvent =
|
TDataSetScrolledEvent =
|
||||||
@ -764,13 +764,17 @@ begin
|
|||||||
{$Ifdef dbgDBGrid}
|
{$Ifdef dbgDBGrid}
|
||||||
DebugLn('(%s) TCustomDBDrid.OnDataSetChanged(aDataSet=%s) INIT',[name,dbgsname(ADataset)]);
|
DebugLn('(%s) TCustomDBDrid.OnDataSetChanged(aDataSet=%s) INIT',[name,dbgsname(ADataset)]);
|
||||||
{$endif}
|
{$endif}
|
||||||
if EditorMode then
|
if not (gsStartEditing in FGridStatus) then begin
|
||||||
EditorMode := False;
|
if EditorMode then
|
||||||
LayoutChanged;
|
EditorMode := False;
|
||||||
|
LayoutChanged;
|
||||||
|
end;
|
||||||
UpdateActive;
|
UpdateActive;
|
||||||
SelectEditor;
|
if not (gsStartEditing in FGridStatus) then begin
|
||||||
if (dgAlwaysShowEditor in Options) then
|
SelectEditor;
|
||||||
EditorMode := true;
|
if (dgAlwaysShowEditor in Options) then
|
||||||
|
EditorMode := true;
|
||||||
|
end;
|
||||||
{$Ifdef dbgDBGrid}
|
{$Ifdef dbgDBGrid}
|
||||||
DebugLn('(%s) TCustomDBDrid.OnDataSetChanged(aDataSet=%s) DONE',[name,dbgsname(ADataset)]);
|
DebugLn('(%s) TCustomDBDrid.OnDataSetChanged(aDataSet=%s) DONE',[name,dbgsname(ADataset)]);
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -2682,8 +2686,11 @@ begin
|
|||||||
AField := GetFieldFromGridColumn(Col);
|
AField := GetFieldFromGridColumn(Col);
|
||||||
if assigned(AField) then
|
if assigned(AField) then
|
||||||
Result := not AField.CanModify;
|
Result := not AField.CanModify;
|
||||||
if not result then
|
if not result then begin
|
||||||
|
Include(FGridStatus, gsStartEditing);
|
||||||
Result := not FDataLink.Edit;
|
Result := not FDataLink.Edit;
|
||||||
|
Exclude(FGridStatus, gsStartEditing);
|
||||||
|
end;
|
||||||
EditingColumn(Col, not Result);
|
EditingColumn(Col, not Result);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user