mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 05:58:06 +02:00
implemented FindDeclarationOfOIProperty path for child components
git-svn-id: trunk@8936 -
This commit is contained in:
parent
60115fa7ed
commit
c4aef17fa9
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user