IDE: set csAncestor for root components with ancestors

git-svn-id: trunk@22487 -
This commit is contained in:
mattias 2009-11-08 11:03:34 +00:00
parent c18d7be9ac
commit 4346679737
2 changed files with 10 additions and 2 deletions

View File

@ -295,6 +295,7 @@ const
procedure SetComponentDesignMode(AComponent: TComponent; Value: Boolean); procedure SetComponentDesignMode(AComponent: TComponent; Value: Boolean);
procedure SetComponentDesignInstanceMode(AComponent: TComponent; Value: Boolean); procedure SetComponentDesignInstanceMode(AComponent: TComponent; Value: Boolean);
procedure SetComponentInlineMode(AComponent: TComponent; Value: Boolean); procedure SetComponentInlineMode(AComponent: TComponent; Value: Boolean);
procedure SetComponentAncestorMode(AComponent: TComponent; Value: Boolean);
implementation implementation
@ -325,6 +326,11 @@ begin
TSetDesigningComponent.SetInlineOfComponent(AComponent, True); TSetDesigningComponent.SetInlineOfComponent(AComponent, True);
end; end;
procedure SetComponentAncestorMode(AComponent: TComponent; Value: Boolean);
begin
TSetDesigningComponent(AComponent).SetAncestor(Value);
end;
class procedure TSetDesigningComponent.SetDesigningOfComponent( class procedure TSetDesigningComponent.SetDesigningOfComponent(
AComponent: TComponent; Value: Boolean); AComponent: TComponent; Value: Boolean);
begin begin
@ -862,11 +868,12 @@ function TJITComponentList.AddJITComponentFromStream(BinStream: TStream;
Abort:=false; Abort:=false;
OnFindAncestors(Self,AncestorClass,Ancestors,AncestorStreams,Abort); OnFindAncestors(Self,AncestorClass,Ancestors,AncestorStreams,Abort);
if Abort then exit(false); if Abort then exit(false);
if Ancestors<>nil then begin if (Ancestors<>nil) and (Ancestors.Count>0) then begin
for i:=Ancestors.Count-1 downto 0 do begin for i:=Ancestors.Count-1 downto 0 do begin
ReadStream(TExtMemoryStream(AncestorStreams[i]), ReadStream(TExtMemoryStream(AncestorStreams[i]),
TComponent(Ancestors[i]).ClassType); TComponent(Ancestors[i]).ClassType);
end; end;
SetComponentAncestorMode(FCurReadJITComponent,true);
end; end;
finally finally
Ancestors.Free; Ancestors.Free;

View File

@ -4346,7 +4346,8 @@ begin
end; end;
function TMainIDE.CreateNewForm(NewUnitInfo: TUnitInfo; function TMainIDE.CreateNewForm(NewUnitInfo: TUnitInfo;
AncestorType: TPersistentClass; ResourceCode: TCodeBuffer; UseCreateFormStatements: Boolean): TModalResult; AncestorType: TPersistentClass; ResourceCode: TCodeBuffer;
UseCreateFormStatements: Boolean): TModalResult;
var var
CInterface: TComponentInterface; CInterface: TComponentInterface;
NewComponent: TComponent; NewComponent: TComponent;