IDE: code explorer: show only top level nodes

git-svn-id: trunk@29977 -
This commit is contained in:
mattias 2011-03-21 21:22:20 +00:00
parent 493447bf27
commit 265f94e8af
2 changed files with 12 additions and 9 deletions

View File

@ -252,7 +252,7 @@ function CodeExplorerCategoryNameToEnum(const s: string): TCodeExplorerCategory;
function CodeExplorerLocalizedString(const c: TCodeExplorerCategory): string;
function CodeObserverCatNameToEnum(const s: string): TCEObserverCategory;
function CodeExplorerLocalizedString(const c: TCEObserverCategory): string;
function dbgs(c: TCodeExplorerCategory): string; overload;
implementation
@ -318,6 +318,11 @@ begin
end;
end;
function dbgs(c: TCodeExplorerCategory): string;
begin
Result:=CodeExplorerCategoryNames[c];
end;
{ TCodeExplorerOptions }
procedure TCodeExplorerOptions.SetRefresh(const AValue: TCodeExplorerRefresh);

View File

@ -786,9 +786,9 @@ begin
Category:=cecNone;
if ShowNode
and ((CodeNode.Parent=nil)
or (CodeNode.Parent.Desc in AllCodeSections)
or (CodeNode.Parent.Parent=nil)
or (CodeNode.Parent.Parent.Desc in AllCodeSections)) then
or (CodeNode.Parent.Desc in AllCodeSections)
or (CodeNode.Parent.Parent=nil)
or (CodeNode.Parent.Parent.Desc in AllCodeSections)) then
begin
// top level definition
case CodeNode.Desc of
@ -818,12 +818,8 @@ begin
end else begin
ShowNode:=false;
end;
end else if (CodeNode.Parent<>nil)
and (CodeNode.Parent.Desc in (AllClassSections+AllClassInterfaces+[ctnRecordType]))
then begin
// show class, interface and record nodes
ShowNode:=true;
end else begin
// not a top level node
ShowNode:=false;
end;
//DebugLn(['TCodeExplorerView.CreateNodes ',CodeNode.DescAsString,' ShowNode=',ShowNode,' ShowChilds=',ShowChilds]);
@ -833,6 +829,8 @@ begin
NodeData:=TViewNodeData.Create(CodeNode);
NodeText:=GetCodeNodeDescription(ACodeTool,CodeNode);
NodeImageIndex:=GetCodeNodeImage(ACodeTool,CodeNode);
//if NodeText='TCodeExplorerView' then
// debugln(['TCodeExplorerView.CreateIdentifierNodes CodeNode=',CodeNode.DescAsString,' NodeText="',NodeText,'" Category=',dbgs(Category),' InFrontViewNode=',InFrontViewNode<>nil,' ParentViewNode=',ParentViewNode<>nil]);
if InFrontViewNode<>nil then
ViewNode:=CodeTreeview.Items.InsertObjectBehind(
InFrontViewNode,NodeText,NodeData)