implemented FindDeclarationOfOIProperty path for child components

git-svn-id: trunk@8936 -
This commit is contained in:
mattias 2006-03-13 22:35:50 +00:00
parent 60115fa7ed
commit c4aef17fa9
2 changed files with 17 additions and 5 deletions

View File

@ -1387,7 +1387,7 @@ var
Context: TFindContext;
begin
Result:=false;
//DebugLn('TFindDeclarationTool.FindDeclarationOfPropertyPath PropertyPath="',PropertyPath,'"');
DebugLn('TFindDeclarationTool.FindDeclarationOfPropertyPath PropertyPath="',PropertyPath,'"');
if PropertyPath='' then exit;
BuildTree(false);
@ -1404,13 +1404,13 @@ begin
try
// then search the properties
repeat
//DebugLn('TFindDeclarationTool.FindDeclarationOfPropertyPath ',Context.Node.DescAsString);
DebugLn('TFindDeclarationTool.FindDeclarationOfPropertyPath ',Context.Node.DescAsString);
if (not (Context.Node.Desc in [ctnClass,ctnClassInterface,ctnRecordType]))
then
exit;
Params.Flags:=[fdfExceptionOnNotFound,fdfSearchInAncestors];
Identifier:=GetNextIdentifier;
//DebugLn('TFindDeclarationTool.FindDeclarationOfPropertyPath Identifier="',identifier,'"');
DebugLn('TFindDeclarationTool.FindDeclarationOfPropertyPath Identifier="',identifier,'"');
if Identifier='' then exit;
Params.SetIdentifier(Self,PChar(Identifier),nil);
Params.ContextNode:=Context.Node;

View File

@ -199,6 +199,7 @@ var
AFile: TLazProjectFile;
NewCode: TCodeBuffer;
NewX, NewY: integer;
APersistent: TPersistent;
begin
Result:=false;
Code:=nil;
@ -236,9 +237,20 @@ begin
if LoadCodeBuffer(Code,AFile.Filename,[])<>mrOk then begin
exit;
end;
if Row.Editor=nil then begin
DebugLn('FindDeclarationOfOIProperty Row.Editor=nil');
exit;
end;
// create the property search path
PropPath:=LookupRoot.ClassName+'.'+
AnInspector.GetActivePropertyGrid.PropertyPath(Row);
APersistent:=Row.Editor.GetComponent(0);
if APersistent=nil then begin
DebugLn('FindDeclarationOfOIProperty APersistent=nil');
exit;
end;
PropPath:=AnInspector.GetActivePropertyGrid.PropertyPath(Row);
if APersistent is TComponent then
PropPath:=TComponent(APersistent).Name+'.'+PropPath;
PropPath:=LookupRoot.ClassName+'.'+PropPath;
// find the property declaration
if not CodeToolBoss.FindDeclarationOfPropertyPath(Code,PropPath,NewCode,
NewX,NewY,NewTopLine) then