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 SetComponentDesignInstanceMode(AComponent: TComponent; Value: Boolean);
procedure SetComponentInlineMode(AComponent: TComponent; Value: Boolean);
procedure SetComponentAncestorMode(AComponent: TComponent; Value: Boolean);
implementation
@ -325,6 +326,11 @@ begin
TSetDesigningComponent.SetInlineOfComponent(AComponent, True);
end;
procedure SetComponentAncestorMode(AComponent: TComponent; Value: Boolean);
begin
TSetDesigningComponent(AComponent).SetAncestor(Value);
end;
class procedure TSetDesigningComponent.SetDesigningOfComponent(
AComponent: TComponent; Value: Boolean);
begin
@ -862,11 +868,12 @@ function TJITComponentList.AddJITComponentFromStream(BinStream: TStream;
Abort:=false;
OnFindAncestors(Self,AncestorClass,Ancestors,AncestorStreams,Abort);
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
ReadStream(TExtMemoryStream(AncestorStreams[i]),
TComponent(Ancestors[i]).ClassType);
end;
SetComponentAncestorMode(FCurReadJITComponent,true);
end;
finally
Ancestors.Free;

View File

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