mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:20:25 +02:00
ide: don't add Application.CreateForm to the project unit for items that does not need them (frames for example)
git-svn-id: trunk@15088 -
This commit is contained in:
parent
31be257cbb
commit
6320d6fc03
13
ide/main.pp
13
ide/main.pp
@ -589,7 +589,7 @@ type
|
|||||||
NewOwner: TObject; NewFilename: string; var NewCodeBuffer: TCodeBuffer;
|
NewOwner: TObject; NewFilename: string; var NewCodeBuffer: TCodeBuffer;
|
||||||
var NewUnitName: string): TModalResult;
|
var NewUnitName: string): TModalResult;
|
||||||
function CreateNewForm(NewUnitInfo: TUnitInfo;
|
function CreateNewForm(NewUnitInfo: TUnitInfo;
|
||||||
AncestorType: TPersistentClass; ResourceCode: TCodeBuffer): TModalResult;
|
AncestorType: TPersistentClass; ResourceCode: TCodeBuffer; UseCreateFormStatements: Boolean): TModalResult;
|
||||||
|
|
||||||
// methods for 'save unit'
|
// methods for 'save unit'
|
||||||
function DoShowSaveFileAsDialog(AnUnitInfo: TUnitInfo;
|
function DoShowSaveFileAsDialog(AnUnitInfo: TUnitInfo;
|
||||||
@ -4253,7 +4253,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainIDE.CreateNewForm(NewUnitInfo: TUnitInfo;
|
function TMainIDE.CreateNewForm(NewUnitInfo: TUnitInfo;
|
||||||
AncestorType: TPersistentClass; ResourceCode: TCodeBuffer): TModalResult;
|
AncestorType: TPersistentClass; ResourceCode: TCodeBuffer; UseCreateFormStatements: Boolean): TModalResult;
|
||||||
var
|
var
|
||||||
CInterface: TComponentInterface;
|
CInterface: TComponentInterface;
|
||||||
NewComponent: TComponent;
|
NewComponent: TComponent;
|
||||||
@ -4301,8 +4301,11 @@ begin
|
|||||||
|
|
||||||
NewUnitInfo.ComponentName:=NewComponent.Name;
|
NewUnitInfo.ComponentName:=NewComponent.Name;
|
||||||
NewUnitInfo.ComponentResourceName:=NewUnitInfo.ComponentName;
|
NewUnitInfo.ComponentResourceName:=NewUnitInfo.ComponentName;
|
||||||
if NewUnitInfo.IsPartOfProject and Project1.AutoCreateForms
|
if UseCreateFormStatements and
|
||||||
and (pfMainUnitHasCreateFormStatements in Project1.Flags) then begin
|
NewUnitInfo.IsPartOfProject and
|
||||||
|
Project1.AutoCreateForms and
|
||||||
|
(pfMainUnitHasCreateFormStatements in Project1.Flags) then
|
||||||
|
begin
|
||||||
Project1.AddCreateFormToProjectFile(NewComponent.ClassName,
|
Project1.AddCreateFormToProjectFile(NewComponent.ClassName,
|
||||||
NewComponent.Name);
|
NewComponent.Name);
|
||||||
end;
|
end;
|
||||||
@ -6884,7 +6887,7 @@ begin
|
|||||||
//DebugLn(['TMainIDE.DoNewFile ',dbgsName(NewUnitInfo.Component),' ',dbgsName(NewUnitInfo.Component.ClassParent)]);
|
//DebugLn(['TMainIDE.DoNewFile ',dbgsName(NewUnitInfo.Component),' ',dbgsName(NewUnitInfo.Component.ClassParent)]);
|
||||||
end else begin
|
end else begin
|
||||||
// create a default form/datamodule
|
// create a default form/datamodule
|
||||||
Result:=CreateNewForm(NewUnitInfo,AncestorType,nil);
|
Result := CreateNewForm(NewUnitInfo, AncestorType, nil, NewFileDescriptor.UseCreateFormStatements);
|
||||||
end;
|
end;
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user