mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 15:30:52 +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);
|
var Key: Word; Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if (Shift = []) and (Key = VK_DELETE) and
|
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
|
(MessageDlg(oisDeleteComponents, mtConfirmation,[mbYes, mbNo],0) = mrYes) then
|
||||||
begin
|
begin
|
||||||
OnDeletePopupmenuItemClick(nil);
|
OnDeletePopupmenuItemClick(nil);
|
||||||
@ -4427,12 +4427,27 @@ end;
|
|||||||
procedure TObjectInspectorDlg.OnDeletePopupmenuItemClick(Sender: TObject);
|
procedure TObjectInspectorDlg.OnDeletePopupmenuItemClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
ADesigner: TIDesigner;
|
ADesigner: TIDesigner;
|
||||||
|
ACollection: TCollection;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if (Selection.Count > 0) then
|
if (Selection.Count > 0) then
|
||||||
begin
|
begin
|
||||||
ADesigner := FindRootDesigner(Selection[0]);
|
ADesigner := FindRootDesigner(Selection[0]);
|
||||||
if ADesigner is TComponentEditorDesigner then
|
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;
|
TComponentEditorDesigner(ADesigner).DeleteSelection;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user