IDE: auto open designer form: open only the active unit form, not all, bug #16825

git-svn-id: trunk@26432 -
This commit is contained in:
mattias 2010-07-02 22:38:30 +00:00
parent 358af10c61
commit 6b289c7897

View File

@ -8383,7 +8383,7 @@ var
if FilenameIsPascalUnit(AFilename) then begin
// this could be a unit with a form
//debugln('TMainIDE.DoOpenEditorFile ',AFilename,' ',OpenFlagsToString(Flags));
if (not (ofDoNotLoadResource in Flags))
if ([ofDoNotLoadResource,ofProjectLoading]*Flags=[])
and ( (ofDoLoadResource in Flags)
or ((not Project1.AutoOpenDesignerFormsDisabled)
and (EnvironmentOptions.AutoCreateFormsOnOpen
@ -9986,6 +9986,18 @@ begin
SourceEditorManager.ShowActiveWindowOnTop(True);
end;
if ([ofDoNotLoadResource]*Flags=[])
and ( (not Project1.AutoOpenDesignerFormsDisabled)
and EnvironmentOptions.AutoCreateFormsOnOpen
and (SourceEditorManager.ActiveEditor<>nil) )
then begin
// auto open form of active unit
AnUnitInfo:=Project1.UnitWithEditorComponent(SourceEditorManager.ActiveEditor);
if AnUnitInfo<>nil then
Result:=DoLoadLFM(AnUnitInfo,[ofProjectLoading,ofMultiOpen,ofOnlyIfExists],
[cfSaveDependencies]);
end;
// select a form (object inspector, formeditor, control selection)
if FLastFormActivated<>nil then begin
LastDesigner:=TDesigner(FLastFormActivated.Designer);