mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-03 09:57:41 +01:00
IDE: code explorer: show only top level nodes
git-svn-id: trunk@29977 -
This commit is contained in:
parent
493447bf27
commit
265f94e8af
@ -252,7 +252,7 @@ function CodeExplorerCategoryNameToEnum(const s: string): TCodeExplorerCategory;
|
|||||||
function CodeExplorerLocalizedString(const c: TCodeExplorerCategory): string;
|
function CodeExplorerLocalizedString(const c: TCodeExplorerCategory): string;
|
||||||
function CodeObserverCatNameToEnum(const s: string): TCEObserverCategory;
|
function CodeObserverCatNameToEnum(const s: string): TCEObserverCategory;
|
||||||
function CodeExplorerLocalizedString(const c: TCEObserverCategory): string;
|
function CodeExplorerLocalizedString(const c: TCEObserverCategory): string;
|
||||||
|
function dbgs(c: TCodeExplorerCategory): string; overload;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -318,6 +318,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function dbgs(c: TCodeExplorerCategory): string;
|
||||||
|
begin
|
||||||
|
Result:=CodeExplorerCategoryNames[c];
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCodeExplorerOptions }
|
{ TCodeExplorerOptions }
|
||||||
|
|
||||||
procedure TCodeExplorerOptions.SetRefresh(const AValue: TCodeExplorerRefresh);
|
procedure TCodeExplorerOptions.SetRefresh(const AValue: TCodeExplorerRefresh);
|
||||||
|
|||||||
@ -786,9 +786,9 @@ begin
|
|||||||
Category:=cecNone;
|
Category:=cecNone;
|
||||||
if ShowNode
|
if ShowNode
|
||||||
and ((CodeNode.Parent=nil)
|
and ((CodeNode.Parent=nil)
|
||||||
or (CodeNode.Parent.Desc in AllCodeSections)
|
or (CodeNode.Parent.Desc in AllCodeSections)
|
||||||
or (CodeNode.Parent.Parent=nil)
|
or (CodeNode.Parent.Parent=nil)
|
||||||
or (CodeNode.Parent.Parent.Desc in AllCodeSections)) then
|
or (CodeNode.Parent.Parent.Desc in AllCodeSections)) then
|
||||||
begin
|
begin
|
||||||
// top level definition
|
// top level definition
|
||||||
case CodeNode.Desc of
|
case CodeNode.Desc of
|
||||||
@ -818,12 +818,8 @@ begin
|
|||||||
end else begin
|
end else begin
|
||||||
ShowNode:=false;
|
ShowNode:=false;
|
||||||
end;
|
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
|
end else begin
|
||||||
|
// not a top level node
|
||||||
ShowNode:=false;
|
ShowNode:=false;
|
||||||
end;
|
end;
|
||||||
//DebugLn(['TCodeExplorerView.CreateNodes ',CodeNode.DescAsString,' ShowNode=',ShowNode,' ShowChilds=',ShowChilds]);
|
//DebugLn(['TCodeExplorerView.CreateNodes ',CodeNode.DescAsString,' ShowNode=',ShowNode,' ShowChilds=',ShowChilds]);
|
||||||
@ -833,6 +829,8 @@ begin
|
|||||||
NodeData:=TViewNodeData.Create(CodeNode);
|
NodeData:=TViewNodeData.Create(CodeNode);
|
||||||
NodeText:=GetCodeNodeDescription(ACodeTool,CodeNode);
|
NodeText:=GetCodeNodeDescription(ACodeTool,CodeNode);
|
||||||
NodeImageIndex:=GetCodeNodeImage(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
|
if InFrontViewNode<>nil then
|
||||||
ViewNode:=CodeTreeview.Items.InsertObjectBehind(
|
ViewNode:=CodeTreeview.Items.InsertObjectBehind(
|
||||||
InFrontViewNode,NodeText,NodeData)
|
InFrontViewNode,NodeText,NodeData)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user