mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 14:29:36 +02:00
IDE: implemented auto loading frame hidden when ptting a frame onto a form
git-svn-id: trunk@15695 -
This commit is contained in:
parent
86cf5d94fb
commit
63efe33bc3
27
ide/main.pp
27
ide/main.pp
@ -6227,7 +6227,9 @@ begin
|
|||||||
FLastFormActivated:=nil;
|
FLastFormActivated:=nil;
|
||||||
ComponentStillUsed:=(not (cfCloseDependencies in Flags))
|
ComponentStillUsed:=(not (cfCloseDependencies in Flags))
|
||||||
and UnitComponentIsUsed(AnUnitInfo,false);
|
and UnitComponentIsUsed(AnUnitInfo,false);
|
||||||
//DebugLn(['TMainIDE.CloseUnitComponent ',AnUnitInfo.Filename,' ComponentStillUsed=',ComponentStillUsed,' UnitComponentIsUsed=',UnitComponentIsUsed(AnUnitInfo,false),' ',dbgs(AnUnitInfo.Flags),' DepAncestor=',AnUnitInfo.FindUsedByComponentDependency([ucdtAncestor])<>nil,' DepInline=',AnUnitInfo.FindUsedByComponentDependency([ucdtInlineClass])<>nil]);
|
{$IFDEF EnableTFrame}
|
||||||
|
DebugLn(['TMainIDE.CloseUnitComponent ',AnUnitInfo.Filename,' ComponentStillUsed=',ComponentStillUsed,' UnitComponentIsUsed=',UnitComponentIsUsed(AnUnitInfo,false),' ',dbgs(AnUnitInfo.Flags),' DepAncestor=',AnUnitInfo.FindUsedByComponentDependency([ucdtAncestor])<>nil,' DepInline=',AnUnitInfo.FindUsedByComponentDependency([ucdtInlineClass])<>nil]);
|
||||||
|
{$ENDIF}
|
||||||
if (OldDesigner=nil) then begin
|
if (OldDesigner=nil) then begin
|
||||||
// hidden component
|
// hidden component
|
||||||
//DebugLn(['TMainIDE.CloseUnitComponent freeing hidden component without designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]);
|
//DebugLn(['TMainIDE.CloseUnitComponent freeing hidden component without designer: ',AnUnitInfo.Filename,' ',DbgSName(AnUnitInfo.Component)]);
|
||||||
@ -7647,6 +7649,9 @@ var
|
|||||||
UnitList: TStringList;
|
UnitList: TStringList;
|
||||||
i: integer;
|
i: integer;
|
||||||
AnUnitInfo: TUnitInfo;
|
AnUnitInfo: TUnitInfo;
|
||||||
|
LFMCode: TCodeBuffer;
|
||||||
|
LFMFilename: String;
|
||||||
|
TheModalResult: TModalResult;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
UnitList := TStringList.Create;
|
UnitList := TStringList.Create;
|
||||||
@ -7661,6 +7666,26 @@ begin
|
|||||||
if TViewUnitsEntry(UnitList.Objects[i]).Selected then
|
if TViewUnitsEntry(UnitList.Objects[i]).Selected then
|
||||||
begin
|
begin
|
||||||
AnUnitInfo := Project1.Units[TViewUnitsEntry(UnitList.Objects[i]).ID];
|
AnUnitInfo := Project1.Units[TViewUnitsEntry(UnitList.Objects[i]).ID];
|
||||||
|
if (AnUnitInfo.Component=nil) then begin
|
||||||
|
// load the frame
|
||||||
|
LFMFilename:=ChangeFileExt(AnUnitInfo.Filename,'.lfm');
|
||||||
|
if not FileExists(LFMFilename) then begin
|
||||||
|
DebugLn(['TMainIDE.DoSelectFrame file not found: ',LFMFilename]);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// load the lfm file
|
||||||
|
TheModalResult:=LoadCodeBuffer(LFMCode,LFMFilename,[lbfCheckIfText]);
|
||||||
|
if TheModalResult<>mrOk then begin
|
||||||
|
debugln('TMainIDE.DoSelectFrame Failed loading ',LFMFilename);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
TheModalResult:=DoLoadLFM(AnUnitInfo,LFMCode,
|
||||||
|
[ofQuiet,ofOnlyIfExists,ofLoadHiddenResource],[]);
|
||||||
|
if TheModalResult<>mrOk then begin
|
||||||
|
debugln('TMainIDE.DoSelectFrame Failed streaming ',LFMFilename);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
if (AnUnitInfo.Component<>nil) then
|
if (AnUnitInfo.Component<>nil) then
|
||||||
begin
|
begin
|
||||||
Result := TComponentClass(AnUnitInfo.Component.ClassType);
|
Result := TComponentClass(AnUnitInfo.Component.ClassType);
|
||||||
|
Loading…
Reference in New Issue
Block a user