mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 05:39:34 +01:00 
			
		
		
		
	LCL, fix dbgrid entering dataset edit state when selecting a different field and dgAlwaysShowEditor is on
git-svn-id: trunk@28562 -
This commit is contained in:
		
							parent
							
								
									ab77d54fec
								
							
						
					
					
						commit
						935f55fab1
					
				@ -390,6 +390,7 @@ type
 | 
			
		||||
    procedure EditorDoGetValue; override;
 | 
			
		||||
    function  EditorCanAcceptKey(const ch: TUTF8Char): boolean; override;
 | 
			
		||||
    function  EditorIsReadOnly: boolean; override;
 | 
			
		||||
    procedure EditorTextChanged(const aCol,aRow: Integer; const aText:string); override;
 | 
			
		||||
    procedure EndLayout;
 | 
			
		||||
    function  FieldIndexFromGridColumn(AGridCol: Integer): Integer;
 | 
			
		||||
    function  FirstGridColumn: Integer; override;
 | 
			
		||||
@ -2333,8 +2334,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TCustomDBGrid.SetEditText(ACol, ARow: Longint; const Value: string);
 | 
			
		||||
begin
 | 
			
		||||
  if not EditorIsReadOnly then
 | 
			
		||||
    FTempText := Value;
 | 
			
		||||
  FTempText := Value;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TCustomDBGrid.SetFixedCols(const AValue: Integer);
 | 
			
		||||
@ -2868,6 +2868,13 @@ begin
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TCustomDBGrid.EditorTextChanged(const aCol, aRow: Integer;
 | 
			
		||||
  const aText: string);
 | 
			
		||||
begin
 | 
			
		||||
  if not EditorIsReadonly then
 | 
			
		||||
    SetEditText(aCol, aRow, aText);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TCustomDBGrid.HeaderSized(IsColumn: Boolean; Index: Integer);
 | 
			
		||||
var
 | 
			
		||||
  i: Integer;
 | 
			
		||||
 | 
			
		||||
@ -877,6 +877,7 @@ type
 | 
			
		||||
    procedure EditorSelectAll;
 | 
			
		||||
    procedure EditorShow(const SelAll: boolean); virtual;
 | 
			
		||||
    procedure EditorShowInCell(const aCol,aRow:Integer); virtual;
 | 
			
		||||
    procedure EditorTextChanged(const aCol,aRow: Integer; const aText:string); virtual;
 | 
			
		||||
    procedure EditorWidthChanged(aCol,aWidth: Integer); virtual;
 | 
			
		||||
    function  FirstGridColumn: integer; virtual;
 | 
			
		||||
    function  FixedGrid: boolean;
 | 
			
		||||
@ -6907,6 +6908,11 @@ begin
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TCustomGrid.EditorTextChanged(const aCol,aRow: Integer; const aText:string);
 | 
			
		||||
begin
 | 
			
		||||
  SetEditText(aCol, aRow, aText);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TCustomGrid.EditorWidthChanged(aCol, aWidth: Integer);
 | 
			
		||||
begin
 | 
			
		||||
  EditorPos;
 | 
			
		||||
@ -10857,7 +10863,7 @@ end;
 | 
			
		||||
procedure TPickListCellEditor.Select;
 | 
			
		||||
begin
 | 
			
		||||
  if FGrid<>nil then begin
 | 
			
		||||
    FGrid.SetEditText(FCol, FRow, Text);
 | 
			
		||||
    FGrid.EditorTextChanged(FCol, FRow, Text);
 | 
			
		||||
    FGrid.PickListItemSelected(Self);
 | 
			
		||||
  end;
 | 
			
		||||
  inherited Select;
 | 
			
		||||
@ -10865,9 +10871,8 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TPickListCellEditor.Change;
 | 
			
		||||
begin
 | 
			
		||||
  if FGrid<>nil then begin
 | 
			
		||||
    FGrid.SetEditText(FCol, FRow, Text);
 | 
			
		||||
  end;
 | 
			
		||||
  if FGrid<>nil then
 | 
			
		||||
    FGrid.EditorTextChanged(FCol, FRow, Text);
 | 
			
		||||
  inherited Change;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user