mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-07 04:09:35 +01:00
IDE: fixed searching owner of virtual files
git-svn-id: trunk@13168 -
This commit is contained in:
parent
de4cdcb3a7
commit
53e8d6533f
@ -2,7 +2,7 @@
|
|||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<PathDelim Value="/"/>
|
<PathDelim Value="/"/>
|
||||||
<Version Value="5"/>
|
<Version Value="6"/>
|
||||||
<General>
|
<General>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
@ -22,14 +22,14 @@
|
|||||||
</RunParams>
|
</RunParams>
|
||||||
<RequiredPackages Count="3">
|
<RequiredPackages Count="3">
|
||||||
<Item1>
|
<Item1>
|
||||||
<PackageName Value="SynEdit"/>
|
<PackageName Value="FCL"/>
|
||||||
<MinVersion Major="1" Valid="True"/>
|
<MinVersion Major="1" Valid="True"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
<Item2>
|
<Item2>
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
<Item3>
|
<Item3>
|
||||||
<PackageName Value="FCL"/>
|
<PackageName Value="SynEdit"/>
|
||||||
<MinVersion Major="1" Valid="True"/>
|
<MinVersion Major="1" Valid="True"/>
|
||||||
</Item3>
|
</Item3>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
|
|||||||
@ -3656,7 +3656,7 @@ function TProject.UnitInfoWithFilename(const AFilename: string;
|
|||||||
begin
|
begin
|
||||||
Result:=TheFilename;
|
Result:=TheFilename;
|
||||||
if (pfsfResolveFileLinks in SearchFlags)
|
if (pfsfResolveFileLinks in SearchFlags)
|
||||||
and (FilenameIsAbsolute(Result)) then
|
and FilenameIsAbsolute(Result) then
|
||||||
Result:=ReadAllLinks(Result,false);
|
Result:=ReadAllLinks(Result,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -862,6 +862,34 @@ end;
|
|||||||
TCustomForm WndProc
|
TCustomForm WndProc
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomForm.WndProc(var TheMessage : TLMessage);
|
procedure TCustomForm.WndProc(var TheMessage : TLMessage);
|
||||||
|
|
||||||
|
{-----------------------------------------------------------------------
|
||||||
|
Return if the control contain a form
|
||||||
|
-----------------------------------------------------------------------}
|
||||||
|
function ContainsForm(Control : TWinControl) : Boolean;
|
||||||
|
var
|
||||||
|
I : Integer;
|
||||||
|
Found : Boolean;
|
||||||
|
begin
|
||||||
|
Found := False;
|
||||||
|
if Control <> Nil then
|
||||||
|
begin
|
||||||
|
I := 1;
|
||||||
|
while (I <= Control.ControlCount) And (Not Found) do
|
||||||
|
begin
|
||||||
|
if (Control.Controls[I-1] Is TCustomForm)
|
||||||
|
then
|
||||||
|
Found := True
|
||||||
|
else
|
||||||
|
If (Control.Controls[I-1] Is TWinControl)
|
||||||
|
then
|
||||||
|
Found := ContainsForm(Control.Controls[I-1] As TWinControl);
|
||||||
|
Inc(I);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result := Found;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
FocusHandle : HWND;
|
FocusHandle : HWND;
|
||||||
MenuItem : TMenuItem;
|
MenuItem : TMenuItem;
|
||||||
@ -911,7 +939,7 @@ begin
|
|||||||
DebugLn('[TCustomForm.WndProc] ',Name,':',ClassName,' FActiveControl=',DbgSName(FActiveControl));
|
DebugLn('[TCustomForm.WndProc] ',Name,':',ClassName,' FActiveControl=',DbgSName(FActiveControl));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LCLIntf.SetFocus(FocusHandle);
|
LCLIntf.SetFocus(FocusHandle);
|
||||||
exit;
|
if not ContainsForm(Self) then exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -1170,14 +1170,12 @@ begin
|
|||||||
and (PreferredSize[asboHorizontal]>0)
|
and (PreferredSize[asboHorizontal]>0)
|
||||||
then begin
|
then begin
|
||||||
// the control.width is fixed to its preferred width
|
// the control.width is fixed to its preferred width
|
||||||
MinimumSize[asboHorizontal]:=PreferredSize[asboHorizontal];
|
|
||||||
MaximumSize[asboHorizontal]:=PreferredSize[asboHorizontal];
|
MaximumSize[asboHorizontal]:=PreferredSize[asboHorizontal];
|
||||||
end;
|
end;
|
||||||
if (Control.AutoSize or (Control.BorderSpacing.CellAlignVertical<>ccaFill))
|
if (Control.AutoSize or (Control.BorderSpacing.CellAlignVertical<>ccaFill))
|
||||||
and (PreferredSize[asboVertical]>0)
|
and (PreferredSize[asboVertical]>0)
|
||||||
then begin
|
then begin
|
||||||
// the control.height is fixed to its preferred height
|
// the control.height is fixed to its preferred height
|
||||||
MinimumSize[asboVertical]:=PreferredSize[asboVertical];
|
|
||||||
MaximumSize[asboVertical]:=PreferredSize[asboVertical];
|
MaximumSize[asboVertical]:=PreferredSize[asboVertical];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -2982,6 +2982,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
UnitOwners.Free;
|
UnitOwners.Free;
|
||||||
|
end else begin
|
||||||
|
DebugLn(['TPkgManager.GetMissingDependenciesForUnit WARNING: unit has no owner: ',UnitFilename]);
|
||||||
end;
|
end;
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
@ -3088,10 +3090,9 @@ var
|
|||||||
Add: Boolean;
|
Add: Boolean;
|
||||||
begin
|
begin
|
||||||
if AProject=nil then exit;
|
if AProject=nil then exit;
|
||||||
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
|
|
||||||
if BaseDir='' then exit;
|
|
||||||
Add:=false;
|
Add:=false;
|
||||||
if not (piosfExcludeOwned in Flags) then begin
|
if not (piosfExcludeOwned in Flags) then begin
|
||||||
|
//DebugLn(['SearchInProject ',AProject.ProjectInfoFile,' UnitFilename=',UnitFilename]);
|
||||||
if AProject.UnitInfoWithFilename(UnitFilename,
|
if AProject.UnitInfoWithFilename(UnitFilename,
|
||||||
[pfsfResolveFileLinks,pfsfOnlyProjectFiles])<>nil
|
[pfsfResolveFileLinks,pfsfOnlyProjectFiles])<>nil
|
||||||
then
|
then
|
||||||
@ -3100,12 +3101,15 @@ var
|
|||||||
if (piosfIncludeSourceDirectories in Flags)
|
if (piosfIncludeSourceDirectories in Flags)
|
||||||
and FilenameIsAbsolute(UnitFilename) then begin
|
and FilenameIsAbsolute(UnitFilename) then begin
|
||||||
// search in project source directories
|
// search in project source directories
|
||||||
ProjectDirs:=AProject.LazCompilerOptions.OtherUnitFiles+';.';
|
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
|
||||||
if not IDEMacros.CreateAbsoluteSearchPath(ProjectDirs,BaseDir) then exit;
|
if BaseDir<>'' then begin
|
||||||
if FindPathInSearchPath(PChar(SrcDir),length(SrcDir),
|
ProjectDirs:=AProject.LazCompilerOptions.OtherUnitFiles+';.';
|
||||||
PChar(ProjectDirs),length(ProjectDirs))<>nil
|
if not IDEMacros.CreateAbsoluteSearchPath(ProjectDirs,BaseDir) then exit;
|
||||||
then
|
if FindPathInSearchPath(PChar(SrcDir),length(SrcDir),
|
||||||
Add:=true;
|
PChar(ProjectDirs),length(ProjectDirs))<>nil
|
||||||
|
then
|
||||||
|
Add:=true;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
if Add then
|
if Add then
|
||||||
Result.Add(AProject);
|
Result.Add(AProject);
|
||||||
@ -3114,6 +3118,7 @@ var
|
|||||||
var
|
var
|
||||||
PkgFile: TPkgFile;
|
PkgFile: TPkgFile;
|
||||||
begin
|
begin
|
||||||
|
//DebugLn(['TPkgManager.GetPossibleOwnersOfUnit ',UnitFilename]);
|
||||||
Result:=TFPList.Create;
|
Result:=TFPList.Create;
|
||||||
|
|
||||||
SrcDir:=ExtractFilePath(UnitFilename);
|
SrcDir:=ExtractFilePath(UnitFilename);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user