mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 12:59:16 +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;
|
procedure TDesigner.DoDeleteComponent(AComponent: TComponent;
|
||||||
FreeComponent: boolean);
|
FreeComponent: boolean);
|
||||||
|
var
|
||||||
|
Hook: TPropertyEditorHook;
|
||||||
begin
|
begin
|
||||||
PopupMenuComponentEditor:=nil;
|
PopupMenuComponentEditor:=nil;
|
||||||
if TheFormEditor.FindComponent(AComponent)<>nil then begin
|
if TheFormEditor.FindComponent(AComponent)<>nil then begin
|
||||||
|
// unselect component
|
||||||
ControlSelection.Remove(AComponent);
|
ControlSelection.Remove(AComponent);
|
||||||
|
// call RemoveComponent handler
|
||||||
if Assigned(FOnRemoveComponent) then
|
if Assigned(FOnRemoveComponent) then
|
||||||
FOnRemoveComponent(Self,AComponent);
|
FOnRemoveComponent(Self,AComponent);
|
||||||
|
// call component deleting handlers
|
||||||
|
Hook:=GetPropertyEditorHook;
|
||||||
|
if Hook<>nil then
|
||||||
|
Hook.ComponentDeleting(AComponent);
|
||||||
|
// delete component
|
||||||
TheFormEditor.DeleteControl(AComponent,FreeComponent);
|
TheFormEditor.DeleteControl(AComponent,FreeComponent);
|
||||||
|
// unmark component
|
||||||
DeletingComponents.Remove(AComponent);
|
DeletingComponents.Remove(AComponent);
|
||||||
|
// call ComponentDeleted handler
|
||||||
if Assigned(FOnComponentDeleted) then
|
if Assigned(FOnComponentDeleted) then
|
||||||
FOnComponentDeleted(Self,AComponent);
|
FOnComponentDeleted(Self,AComponent);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user