added ComponentDeleting event

git-svn-id: trunk@2464 -
This commit is contained in:
mattias 2002-08-17 23:41:23 +00:00
parent 26b0f98c42
commit ee1c1ef848

View File

@ -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;