IDE: codeexplorer: surrounding showing nested procedures

git-svn-id: trunk@30803 -
This commit is contained in:
mattias 2011-05-18 22:31:59 +00:00
parent 47ea4a4ac4
commit 223d952b99
2 changed files with 24 additions and 3 deletions

View File

@ -1644,18 +1644,38 @@ procedure TCodeExplorerView.CreateSurroundings(Tool: TCodeTool);
ChildCTNode: TCodeTreeNode;
ChildData: TViewNodeData;
ChildTVNode: TTreeNode;
AddChilds: Boolean;
Add: Boolean;
ParentTVNode: TTreeNode;
begin
Data:=TViewNodeData(TVNode.Data);
CTNode:=Data.CTNode;
ChildCTNode:=CTNode.FirstChild;
while ChildCTNode<>nil do begin
while ChildCTNode<>nil do
begin
AddChilds:=false;
Add:=false;
if CTNodeIsEnclosing(ChildCTNode,p) then begin
AddChilds:=true;
Add:=true;
end else if (CTNode.Desc=ctnProcedure)
and (ChildCTNode.Desc<>ctnProcedureHead) then begin
Add:=true
end;
ParentTVNode:=TVNode;
if Add then
begin
ChildData:=TViewNodeData.Create(ChildCTNode,false);
ChildTVNode:=CodeTreeview.Items.AddChildObject(
TVNode,GetCodeNodeDescription(Tool,ChildCTNode),ChildData);
ChildTVNode.ImageIndex:=GetCodeNodeImage(Tool,ChildCTNode);
ChildTVNode.SelectedIndex:=ChildTVNode.ImageIndex;
CreateSubNodes(ChildTVNode,p);
ParentTVNode:=ChildTVNode;
end;
if AddChilds then
begin
CreateSubNodes(ParentTVNode,p);
ChildTVNode.Expanded:=true;
end;
ChildCTNode:=ChildCTNode.NextBrother;
@ -1671,7 +1691,7 @@ var
begin
if fSurroundingsNode = nil then
begin
fSurroundingsNode:=CodeTreeview.Items.Add(nil, 'Surroundings');
fSurroundingsNode:=CodeTreeview.Items.Add(nil, lisCESurroundings);
Data:=TViewNodeData.Create(Tool.Tree.Root,false);
Data.Desc:=ctnNone;
Data.StartPos:=Tool.SrcLen;

View File

@ -4363,6 +4363,7 @@ resourcestring
lisNewAncestors = 'New Ancestors';
lisCEModeShowCategories = 'Show Categories';
lisCEModeShowSourceNodes = 'Show Source Nodes';
lisCESurroundings = 'Surroundings';
lisCEIn = '%s in %s';
lisCEOUpdate = 'Update';
lisCEORefreshAutomatically = 'Refresh automatically';