LCL, fix dbgrid editor show on pressing RETURN, issue #14325

git-svn-id: trunk@21204 -
This commit is contained in:
jesus 2009-08-12 18:03:29 +00:00
parent 3e9f4bda8d
commit 3058684e23

View File

@ -751,26 +751,32 @@ end;
procedure TCustomDBGrid.OnDataSetChanged(aDataSet: TDataSet); procedure TCustomDBGrid.OnDataSetChanged(aDataSet: TDataSet);
begin begin
{$Ifdef dbgDBGrid} {$Ifdef dbgDBGrid}
DBGOut('('+name+') ','TCustomDBDrid.OnDataSetChanged(aDataSet='); DebugLn('(%s) TCustomDBDrid.OnDataSetChanged(aDataSet=%s) INIT',[name,dbgsname(ADataset)]);
if aDataSet=nil then DebugLn('nil)')
else DebugLn(aDataSet.Name,')');
{$endif} {$endif}
if EditorMode then if EditorMode then
EditorMode := False; EditorMode := False;
LayoutChanged; LayoutChanged;
UpdateActive; UpdateActive;
SelectEditor;
if (dgAlwaysShowEditor in Options) then if (dgAlwaysShowEditor in Options) then
EditorMode := true; EditorMode := true;
{$Ifdef dbgDBGrid}
DebugLn('(%s) TCustomDBDrid.OnDataSetChanged(aDataSet=%s) DONE',[name,dbgsname(ADataset)]);
{$endif}
end; end;
procedure TCustomDBGrid.OnDataSetOpen(aDataSet: TDataSet); procedure TCustomDBGrid.OnDataSetOpen(aDataSet: TDataSet);
begin begin
{$Ifdef dbgDBGrid} {$Ifdef dbgDBGrid}
DebugLn('(',name,') ','TCustomDBGrid.OnDataSetOpen'); DebugLn('(%s) TCustomDBDrid.OnDataSetOpen INIT',[name]);
{$endif} {$endif}
RenewColWidths; RenewColWidths;
LinkActive(True); LinkActive(True);
UpdateActive; UpdateActive;
SelectEditor;
{$Ifdef dbgDBGrid}
DebugLn('(%s) TCustomDBDrid.OnDataSetOpen DONE',[name]);
{$endif}
end; end;
procedure TCustomDBGrid.OnDataSetClose(aDataSet: TDataSet); procedure TCustomDBGrid.OnDataSetClose(aDataSet: TDataSet);
@ -821,12 +827,16 @@ end;
procedure TCustomDBGrid.OnNewDataSet(aDataSet: TDataset); procedure TCustomDBGrid.OnNewDataSet(aDataSet: TDataset);
begin begin
{$ifdef dbgDBGrid} {$Ifdef dbgDBGrid}
DebugLn('(',name,') ','TCustomDBGrid.OnNewDataSet'); DebugLn('(%s) TCustomDBDrid.OnNewDataset INIT',[name]);
{$endif} {$endif}
RenewColWidths; RenewColWidths;
LinkActive(True); LinkActive(True);
UpdateActive; UpdateActive;
SelectEditor;
{$Ifdef dbgDBGrid}
DebugLn('(%s) TCustomDBDrid.OnNewDataset DONE',[name]);
{$endif}
end; end;
procedure TCustomDBGrid.OnDataSetScrolled(aDataset: TDataSet; Distance: Integer); procedure TCustomDBGrid.OnDataSetScrolled(aDataset: TDataSet; Distance: Integer);
@ -2180,6 +2190,9 @@ procedure TCustomDBGrid.SelectEditor;
var var
aEditor: TWinControl; aEditor: TWinControl;
begin begin
{$ifdef dbgDBGrid}
DebugLn('TCustomDBGrid.SelectEditor INIT Editor=',dbgsname(editor));
{$endif}
if (FDatalink<>nil) and FDatalink.Active then begin if (FDatalink<>nil) and FDatalink.Active then begin
inherited SelectEditor; inherited SelectEditor;
if Assigned(OnSelectEditor) then begin if Assigned(OnSelectEditor) then begin
@ -2189,6 +2202,9 @@ begin
end; end;
end else end else
Editor := nil; Editor := nil;
{$ifdef dbgDBGrid}
DebugLn('TCustomDBGrid.SelectEditor DONE Editor=',dbgsname(editor));
{$endif}
end; end;
procedure TCustomDBGrid.SetEditText(ACol, ARow: Longint; const Value: string); procedure TCustomDBGrid.SetEditText(ACol, ARow: Longint; const Value: string);