mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:39:31 +02:00
ide: delete all container items instead of container deletion
git-svn-id: trunk@22920 -
This commit is contained in:
parent
835f394fbd
commit
544cd5cf41
@ -4259,7 +4259,7 @@ procedure TObjectInspectorDlg.ComponentTreeKeyDown(Sender: TObject;
|
||||
var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
if (Shift = []) and (Key = VK_DELETE) and
|
||||
(Selection.Count > 0) and (Selection[0] is TComponent) and
|
||||
(Selection.Count > 0) and
|
||||
(MessageDlg(oisDeleteComponents, mtConfirmation,[mbYes, mbNo],0) = mrYes) then
|
||||
begin
|
||||
OnDeletePopupmenuItemClick(nil);
|
||||
@ -4427,12 +4427,27 @@ end;
|
||||
procedure TObjectInspectorDlg.OnDeletePopupmenuItemClick(Sender: TObject);
|
||||
var
|
||||
ADesigner: TIDesigner;
|
||||
ACollection: TCollection;
|
||||
i: integer;
|
||||
begin
|
||||
if (Selection.Count > 0) then
|
||||
begin
|
||||
ADesigner := FindRootDesigner(Selection[0]);
|
||||
if ADesigner is TComponentEditorDesigner then
|
||||
begin
|
||||
if Selection[0] is TCollection then
|
||||
begin
|
||||
ACollection := TCollection(Selection[0]);
|
||||
Selection.BeginUpdate;
|
||||
Selection.Clear;
|
||||
for i := 0 to ACollection.Count - 1 do
|
||||
Selection.Add(ACollection.Items[i]);
|
||||
Selection.EndUpdate;
|
||||
if Assigned(FOnSelectPersistentsInOI) then
|
||||
FOnSelectPersistentsInOI(Self);
|
||||
end;
|
||||
TComponentEditorDesigner(ADesigner).DeleteSelection;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user