From ef3c8ad7a5cbb94ebc359df0697f4626450ca44e Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 18 Aug 2002 08:57:04 +0000 Subject: [PATCH] added ComponentDeleting event git-svn-id: trunk@3020 - --- ide/main.pp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/ide/main.pp b/ide/main.pp index 285435996e..0f542d1103 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -896,7 +896,7 @@ begin end; FreeThenNil(FormEditor1); FreeThenNil(PkgBoss); - FreeThenNil(PropertyEditorHook1); + FreeThenNil(GlobalHook); FreeThenNil(TheCompiler); FreeThenNil(TheOutputFilter); FreeThenNil(MacroList); @@ -1200,15 +1200,15 @@ begin ObjectInspector1.OnSelectComponentInOI:=@OIOnSelectComponent; ObjectInspector1.OnShowOptions:=@OIOnShowOptions; - PropertyEditorHook1:=TPropertyEditorHook.Create; - PropertyEditorHook1.AddHandlerGetMethods(@OnPropHookGetMethods); - PropertyEditorHook1.AddHandlerMethodExists(@OnPropHookMethodExists); - PropertyEditorHook1.AddHandlerCreateMethod(@OnPropHookCreateMethod); - PropertyEditorHook1.AddHandlerShowMethod(@OnPropHookShowMethod); - PropertyEditorHook1.AddHandlerRenameMethod(@OnPropHookRenameMethod); - PropertyEditorHook1.AddHandlerComponentRenamed(@OnPropHookComponentRenamed); - PropertyEditorHook1.AddHandlerComponentAdded(@OnPropHookComponentAdded); - ObjectInspector1.PropertyEditorHook:=PropertyEditorHook1; + GlobalHook:=TPropertyEditorHook.Create; + GlobalHook.AddHandlerGetMethods(@OnPropHookGetMethods); + GlobalHook.AddHandlerMethodExists(@OnPropHookMethodExists); + GlobalHook.AddHandlerCreateMethod(@OnPropHookCreateMethod); + GlobalHook.AddHandlerShowMethod(@OnPropHookShowMethod); + GlobalHook.AddHandlerRenameMethod(@OnPropHookRenameMethod); + GlobalHook.AddHandlerComponentRenamed(@OnPropHookComponentRenamed); + GlobalHook.AddHandlerComponentAdded(@OnPropHookComponentAdded); + ObjectInspector1.PropertyEditorHook:=GlobalHook; EnvironmentOptions.IDEWindowLayoutList.Apply(TForm(ObjectInspector1), DefaultObjectInspectorName); with EnvironmentOptions do begin @@ -2826,7 +2826,7 @@ begin FDisplayState:= dsForm; // select the new form (object inspector, formeditor, control selection) - PropertyEditorHook1.LookupRoot := AForm; + GlobalHook.LookupRoot := AForm; TDesigner(AForm.Designer).SelectOnlyThisComponent(AForm); AForm.ShowOnTop; end; @@ -3549,7 +3549,7 @@ begin // select the new form (object inspector, formeditor, control selection) if not (ofProjectLoading in Flags) then begin - PropertyEditorHook1.LookupRoot := TempForm; + GlobalHook.LookupRoot := TempForm; TDesigner(TempForm.Designer).SelectOnlyThisComponent(TempForm); end; FLastFormActivated:=TempForm; @@ -5148,7 +5148,7 @@ begin // select a form (object inspector, formeditor, control selection) if FLastFormActivated<>nil then begin - PropertyEditorHook1.LookupRoot := FLastFormActivated; + GlobalHook.LookupRoot := FLastFormActivated; TDesigner(FLastFormActivated.Designer).SelectOnlyThisComponent( FLastFormActivated); end; @@ -6283,7 +6283,7 @@ begin AForm.ShowOnTop; if TheControlSelection.SelectionForm<>AForm then begin // select the new form (object inspector, formeditor, control selection) - PropertyEditorHook1.LookupRoot := AForm; + GlobalHook.LookupRoot := AForm; TDesigner(AForm.Designer).SelectOnlyThisComponent(AForm); end; end; @@ -8174,8 +8174,8 @@ var i: integer; begin if (ADesigner<>nil) then i:=Project1.IndexOfUnitWithForm(ADesigner.Form,false,nil) - else if PropertyEditorHook1.LookupRoot<>nil then - i:=Project1.IndexOfUnitWithForm(PropertyEditorHook1.LookupRoot,false,nil) + else if GlobalHook.LookupRoot<>nil then + i:=Project1.IndexOfUnitWithForm(GlobalHook.LookupRoot,false,nil) else i:=-1; if (i>=0) then begin @@ -8637,6 +8637,9 @@ end. { ============================================================================= $Log$ + Revision 1.569 2003/05/19 15:53:08 mattias + added ComponentDeleting event + Revision 1.568 2003/05/19 15:16:49 mattias implemented handler lists for property hooks