From c6197e81fed95ceb26affabda995f221fc42daff Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 10 Jul 2008 13:36:50 +0000 Subject: [PATCH] IDE: creating component interfaces for nested/inline components git-svn-id: trunk@15734 - --- ide/customformeditor.pp | 8 ++++++-- ide/main.pp | 17 ++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ide/customformeditor.pp b/ide/customformeditor.pp index fcd9991091..5526cc9e3a 100644 --- a/ide/customformeditor.pp +++ b/ide/customformeditor.pp @@ -2407,10 +2407,14 @@ procedure TCustomFormEditor.CreateChildComponentInterfaces( AComponent: TComponent); var i: Integer; + ChildComponent: TComponent; begin // create a component interface for each component owned by the new component - for i:=0 to AComponent.ComponentCount-1 do - CreateComponentInterface(AComponent.Components[i],false); + for i:=0 to AComponent.ComponentCount-1 do begin + ChildComponent:=AComponent.Components[i]; + CreateComponentInterface(ChildComponent, + csInline in ChildComponent.ComponentState); + end; end; function TCustomFormEditor.GetDefaultComponentParent(TypeClass: TComponentClass diff --git a/ide/main.pp b/ide/main.pp index a947dd5b36..6cee98e84e 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -1381,9 +1381,7 @@ begin end else if IsJITMethod(Method) then begin JITMethod:=TJITMethod(Method.Data); Result:=JITMethod.TheMethodName; - {$IFDEF EnableTFrame} - DebugLn(['TMainIDE.OnPropHookGetMethodName ',dbgsName(GlobalDesignHook.LookupRoot),' ',dbgsName(JITMethod.TheClass)]); - {$ENDIF} + //DebugLn(['TMainIDE.OnPropHookGetMethodName ',dbgsName(GlobalDesignHook.LookupRoot),' ',dbgsName(JITMethod.TheClass)]); if (GlobalDesignHook.LookupRoot.ClassType<>JITMethod.TheClass) or ((GlobalDesignHook.LookupRoot is TComponent) and (csInline in TComponent(GlobalDesignHook.LookupRoot).ComponentState)) @@ -13905,7 +13903,8 @@ end; function TMainIDE.OnPropHookCreateMethod(const AMethodName: ShortString; ATypeInfo: PTypeInfo; APersistent: TPersistent; const APropertyPath: string): TMethod; -var ActiveSrcEdit: TSourceEditor; +var + ActiveSrcEdit: TSourceEditor; ActiveUnitInfo: TUnitInfo; r: boolean; OldChange: Boolean; @@ -13915,10 +13914,13 @@ begin if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource]) then exit; {$IFDEF IDE_DEBUG} - writeln(''); - writeln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName); + debugln(''); + debugln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName); DebugLn(['[TMainIDE.OnPropHookCreateMethod] Persistent=',dbgsName(APersistent),' Unit=',GetClassUnitName(APersistent.ClassType),' Path=',APropertyPath]); {$ENDIF} + + DebugLn(['TMainIDE.OnPropHookCreateMethod ',APropertyPath]); + OldChange:=OpenEditorsOnCodeToolChange; OpenEditorsOnCodeToolChange:=true; try @@ -13965,7 +13967,8 @@ begin AClassName:=ActiveUnitInfo.Component.ClassName; CurMethodName:=AMethodName; - if IsValidIdentPair(AMethodName,AnInheritedClassName,AInheritedMethodName) then begin + if IsValidIdentPair(AMethodName,AnInheritedClassName,AInheritedMethodName) + then begin ActiveSrcEdit:=nil; ActiveUnitInfo:=Project1.UnitWithComponentClassName(AnInheritedClassName); if ActiveUnitInfo=nil then begin