From 43466797372cc91f3b5d7d26f6deb2be3b960b0a Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 8 Nov 2009 11:03:34 +0000 Subject: [PATCH] IDE: set csAncestor for root components with ancestors git-svn-id: trunk@22487 - --- designer/jitforms.pp | 9 ++++++++- ide/main.pp | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/designer/jitforms.pp b/designer/jitforms.pp index 9a99448d69..f1fa3dea44 100644 --- a/designer/jitforms.pp +++ b/designer/jitforms.pp @@ -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; diff --git a/ide/main.pp b/ide/main.pp index c0ef1fd80a..e2044c6806 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -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;