mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 11:19:24 +02:00
added ComponentDeleting event
git-svn-id: trunk@2464 -
This commit is contained in:
parent
26b0f98c42
commit
ee1c1ef848
@ -1120,14 +1120,25 @@ end;
|
||||
|
||||
procedure TDesigner.DoDeleteComponent(AComponent: TComponent;
|
||||
FreeComponent: boolean);
|
||||
var
|
||||
Hook: TPropertyEditorHook;
|
||||
begin
|
||||
PopupMenuComponentEditor:=nil;
|
||||
if TheFormEditor.FindComponent(AComponent)<>nil then begin
|
||||
// unselect component
|
||||
ControlSelection.Remove(AComponent);
|
||||
// call RemoveComponent handler
|
||||
if Assigned(FOnRemoveComponent) then
|
||||
FOnRemoveComponent(Self,AComponent);
|
||||
// call component deleting handlers
|
||||
Hook:=GetPropertyEditorHook;
|
||||
if Hook<>nil then
|
||||
Hook.ComponentDeleting(AComponent);
|
||||
// delete component
|
||||
TheFormEditor.DeleteControl(AComponent,FreeComponent);
|
||||
// unmark component
|
||||
DeletingComponents.Remove(AComponent);
|
||||
// call ComponentDeleted handler
|
||||
if Assigned(FOnComponentDeleted) then
|
||||
FOnComponentDeleted(Self,AComponent);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user