mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 14:49:34 +01:00 
			
		
		
		
	IDE: fix fields editor cannot delete multi-selection, issue #25892
git-svn-id: trunk@48767 -
This commit is contained in:
		
							parent
							
								
									a17502cadb
								
							
						
					
					
						commit
						d1c8efd0c4
					
				@ -87,6 +87,9 @@ type
 | 
			
		||||
    LinkDataset: TDataset;
 | 
			
		||||
    FDesigner: TComponentEditorDesigner;
 | 
			
		||||
    FComponentEditor: TFieldsComponentEditor;
 | 
			
		||||
    FUpdateSelectionCount: Integer;
 | 
			
		||||
    procedure BeginUpdateSelection;
 | 
			
		||||
    procedure EndUpdateSelection;
 | 
			
		||||
    procedure ExchangeItems(const fFirst, fSecond: integer);
 | 
			
		||||
    procedure RefreshFieldsListBox(SelectAllNew: boolean);
 | 
			
		||||
    function FindChild(ACandidate: TPersistent; out AIndex: Integer): Boolean;
 | 
			
		||||
@ -194,8 +197,9 @@ begin
 | 
			
		||||
  LinkDataSet.Active := False;
 | 
			
		||||
  if FieldsListBox.SelCount = 0 then
 | 
			
		||||
    exit;
 | 
			
		||||
  BeginUpdateSelection;
 | 
			
		||||
  FDesigner.DeleteSelection;
 | 
			
		||||
  SelectionChanged;
 | 
			
		||||
  EndUpdateSelection;
 | 
			
		||||
  if PreActive then
 | 
			
		||||
    LinkDataSet.Active := True;
 | 
			
		||||
end;
 | 
			
		||||
@ -398,6 +402,8 @@ end;
 | 
			
		||||
procedure TDSFieldsEditorFrm.SelectionChanged(AOrderChanged: Boolean = false);
 | 
			
		||||
var SelList: TPersistentSelectionList;
 | 
			
		||||
begin
 | 
			
		||||
  if FUpdateSelectionCount>0 then
 | 
			
		||||
    exit;
 | 
			
		||||
  GlobalDesignHook.RemoveHandlerSetSelection(@OnSetSelection);
 | 
			
		||||
  try
 | 
			
		||||
    SelList := TPersistentSelectionList.Create;
 | 
			
		||||
@ -474,6 +480,18 @@ begin
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TDSFieldsEditorFrm.BeginUpdateSelection;
 | 
			
		||||
begin
 | 
			
		||||
  Inc(FUpdateSelectionCount);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TDSFieldsEditorFrm.EndUpdateSelection;
 | 
			
		||||
begin
 | 
			
		||||
  dec(FUpdateSelectionCount);
 | 
			
		||||
  if FUpdateSelectionCount=0 then
 | 
			
		||||
    SelectionChanged;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
{ TFieldsComponentEditor }
 | 
			
		||||
 | 
			
		||||
function TFieldsComponentEditor.GetVerbCount: Integer;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user