IDE: creating component interfaces for nested/inline components

git-svn-id: trunk@15734 -
This commit is contained in:
mattias 2008-07-10 13:36:50 +00:00
parent ee57894807
commit c6197e81fe
2 changed files with 16 additions and 9 deletions

View File

@ -2407,10 +2407,14 @@ procedure TCustomFormEditor.CreateChildComponentInterfaces(
AComponent: TComponent); AComponent: TComponent);
var var
i: Integer; i: Integer;
ChildComponent: TComponent;
begin begin
// create a component interface for each component owned by the new component // create a component interface for each component owned by the new component
for i:=0 to AComponent.ComponentCount-1 do for i:=0 to AComponent.ComponentCount-1 do begin
CreateComponentInterface(AComponent.Components[i],false); ChildComponent:=AComponent.Components[i];
CreateComponentInterface(ChildComponent,
csInline in ChildComponent.ComponentState);
end;
end; end;
function TCustomFormEditor.GetDefaultComponentParent(TypeClass: TComponentClass function TCustomFormEditor.GetDefaultComponentParent(TypeClass: TComponentClass

View File

@ -1381,9 +1381,7 @@ begin
end else if IsJITMethod(Method) then begin end else if IsJITMethod(Method) then begin
JITMethod:=TJITMethod(Method.Data); JITMethod:=TJITMethod(Method.Data);
Result:=JITMethod.TheMethodName; Result:=JITMethod.TheMethodName;
{$IFDEF EnableTFrame} //DebugLn(['TMainIDE.OnPropHookGetMethodName ',dbgsName(GlobalDesignHook.LookupRoot),' ',dbgsName(JITMethod.TheClass)]);
DebugLn(['TMainIDE.OnPropHookGetMethodName ',dbgsName(GlobalDesignHook.LookupRoot),' ',dbgsName(JITMethod.TheClass)]);
{$ENDIF}
if (GlobalDesignHook.LookupRoot.ClassType<>JITMethod.TheClass) if (GlobalDesignHook.LookupRoot.ClassType<>JITMethod.TheClass)
or ((GlobalDesignHook.LookupRoot is TComponent) or ((GlobalDesignHook.LookupRoot is TComponent)
and (csInline in TComponent(GlobalDesignHook.LookupRoot).ComponentState)) and (csInline in TComponent(GlobalDesignHook.LookupRoot).ComponentState))
@ -13905,7 +13903,8 @@ end;
function TMainIDE.OnPropHookCreateMethod(const AMethodName: ShortString; function TMainIDE.OnPropHookCreateMethod(const AMethodName: ShortString;
ATypeInfo: PTypeInfo; ATypeInfo: PTypeInfo;
APersistent: TPersistent; const APropertyPath: string): TMethod; APersistent: TPersistent; const APropertyPath: string): TMethod;
var ActiveSrcEdit: TSourceEditor; var
ActiveSrcEdit: TSourceEditor;
ActiveUnitInfo: TUnitInfo; ActiveUnitInfo: TUnitInfo;
r: boolean; r: boolean;
OldChange: Boolean; OldChange: Boolean;
@ -13915,10 +13914,13 @@ begin
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource]) if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource])
then exit; then exit;
{$IFDEF IDE_DEBUG} {$IFDEF IDE_DEBUG}
writeln(''); debugln('');
writeln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName); debugln('[TMainIDE.OnPropHookCreateMethod] ************ ',AMethodName);
DebugLn(['[TMainIDE.OnPropHookCreateMethod] Persistent=',dbgsName(APersistent),' Unit=',GetClassUnitName(APersistent.ClassType),' Path=',APropertyPath]); DebugLn(['[TMainIDE.OnPropHookCreateMethod] Persistent=',dbgsName(APersistent),' Unit=',GetClassUnitName(APersistent.ClassType),' Path=',APropertyPath]);
{$ENDIF} {$ENDIF}
DebugLn(['TMainIDE.OnPropHookCreateMethod ',APropertyPath]);
OldChange:=OpenEditorsOnCodeToolChange; OldChange:=OpenEditorsOnCodeToolChange;
OpenEditorsOnCodeToolChange:=true; OpenEditorsOnCodeToolChange:=true;
try try
@ -13965,7 +13967,8 @@ begin
AClassName:=ActiveUnitInfo.Component.ClassName; AClassName:=ActiveUnitInfo.Component.ClassName;
CurMethodName:=AMethodName; CurMethodName:=AMethodName;
if IsValidIdentPair(AMethodName,AnInheritedClassName,AInheritedMethodName) then begin if IsValidIdentPair(AMethodName,AnInheritedClassName,AInheritedMethodName)
then begin
ActiveSrcEdit:=nil; ActiveSrcEdit:=nil;
ActiveUnitInfo:=Project1.UnitWithComponentClassName(AnInheritedClassName); ActiveUnitInfo:=Project1.UnitWithComponentClassName(AnInheritedClassName);
if ActiveUnitInfo=nil then begin if ActiveUnitInfo=nil then begin