IDE: fixed searching owner of virtual files

git-svn-id: trunk@13168 -
This commit is contained in:
mattias 2007-12-05 19:27:09 +00:00
parent de4cdcb3a7
commit 53e8d6533f
5 changed files with 46 additions and 15 deletions

View File

@ -2,7 +2,7 @@
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/>
<Version Value="6"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
@ -22,14 +22,14 @@
</RunParams>
<RequiredPackages Count="3">
<Item1>
<PackageName Value="SynEdit"/>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
<Item3>
<PackageName Value="FCL"/>
<PackageName Value="SynEdit"/>
<MinVersion Major="1" Valid="True"/>
</Item3>
</RequiredPackages>

View File

@ -3656,7 +3656,7 @@ function TProject.UnitInfoWithFilename(const AFilename: string;
begin
Result:=TheFilename;
if (pfsfResolveFileLinks in SearchFlags)
and (FilenameIsAbsolute(Result)) then
and FilenameIsAbsolute(Result) then
Result:=ReadAllLinks(Result,false);
end;

View File

@ -862,6 +862,34 @@ end;
TCustomForm WndProc
------------------------------------------------------------------------------}
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
FocusHandle : HWND;
MenuItem : TMenuItem;
@ -911,7 +939,7 @@ begin
DebugLn('[TCustomForm.WndProc] ',Name,':',ClassName,' FActiveControl=',DbgSName(FActiveControl));
{$ENDIF}
LCLIntf.SetFocus(FocusHandle);
exit;
if not ContainsForm(Self) then exit;
end;
end;
end;

View File

@ -1170,14 +1170,12 @@ begin
and (PreferredSize[asboHorizontal]>0)
then begin
// the control.width is fixed to its preferred width
MinimumSize[asboHorizontal]:=PreferredSize[asboHorizontal];
MaximumSize[asboHorizontal]:=PreferredSize[asboHorizontal];
end;
if (Control.AutoSize or (Control.BorderSpacing.CellAlignVertical<>ccaFill))
and (PreferredSize[asboVertical]>0)
then begin
// the control.height is fixed to its preferred height
MinimumSize[asboVertical]:=PreferredSize[asboVertical];
MaximumSize[asboVertical]:=PreferredSize[asboVertical];
end;

View File

@ -2982,6 +2982,8 @@ begin
end;
end;
UnitOwners.Free;
end else begin
DebugLn(['TPkgManager.GetMissingDependenciesForUnit WARNING: unit has no owner: ',UnitFilename]);
end;
Result:=mrOk;
end;
@ -3088,10 +3090,9 @@ var
Add: Boolean;
begin
if AProject=nil then exit;
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
if BaseDir='' then exit;
Add:=false;
if not (piosfExcludeOwned in Flags) then begin
//DebugLn(['SearchInProject ',AProject.ProjectInfoFile,' UnitFilename=',UnitFilename]);
if AProject.UnitInfoWithFilename(UnitFilename,
[pfsfResolveFileLinks,pfsfOnlyProjectFiles])<>nil
then
@ -3100,12 +3101,15 @@ var
if (piosfIncludeSourceDirectories in Flags)
and FilenameIsAbsolute(UnitFilename) then begin
// search in project source directories
ProjectDirs:=AProject.LazCompilerOptions.OtherUnitFiles+';.';
if not IDEMacros.CreateAbsoluteSearchPath(ProjectDirs,BaseDir) then exit;
if FindPathInSearchPath(PChar(SrcDir),length(SrcDir),
PChar(ProjectDirs),length(ProjectDirs))<>nil
then
Add:=true;
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
if BaseDir<>'' then begin
ProjectDirs:=AProject.LazCompilerOptions.OtherUnitFiles+';.';
if not IDEMacros.CreateAbsoluteSearchPath(ProjectDirs,BaseDir) then exit;
if FindPathInSearchPath(PChar(SrcDir),length(SrcDir),
PChar(ProjectDirs),length(ProjectDirs))<>nil
then
Add:=true;
end;
end;
if Add then
Result.Add(AProject);
@ -3114,6 +3118,7 @@ var
var
PkgFile: TPkgFile;
begin
//DebugLn(['TPkgManager.GetPossibleOwnersOfUnit ',UnitFilename]);
Result:=TFPList.Create;
SrcDir:=ExtractFilePath(UnitFilename);