1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
4 using System
.Collections
.Generic
;
5 using System
.Windows
.Forms
;
9 public class PRDICheckboxTreeView
: RDICheckboxTreeView
<ProfilerRDI
>
11 public PRDICheckboxTreeView(LogControl logControl
, ProfilerRDI prdiTree
)
12 : base(logControl
, prdiTree
)
14 m_toolTip
.SetToolTip(this,
15 "Right-click: toggle subtree" + Environment
.NewLine
+
16 "Ctrl-left-click: isolate subtree" + Environment
.NewLine
+
17 "Shift-left-click: collapse subtree");
20 public override void AddRDIs(IEnumerable
<ProfilerRDI
> newToAdd
)
22 base.AddRDIs(newToAdd
);
23 LogControl
.AddPRDIs(newToAdd
);
26 public override void SerializeInRDIs(ProfilerRDI
[] prdis
)
31 base.SerializeInRDIs(prdis
);
33 using (CheckStateBlock())
35 foreach (TreeNode node
in TreeNodeHierarchy
)
37 ProfilerRDI prdi
= (ProfilerRDI
)node
.Tag
;
38 node
.Checked
= prdi
.Displayed
;
39 node
.ForeColor
= prdi
.IsCollapsed
? System
.Drawing
.Color
.White
: System
.Drawing
.Color
.Empty
;
40 node
.BackColor
= prdi
.IsCollapsed
? System
.Drawing
.Color
.DarkGray
: System
.Drawing
.Color
.Empty
;
44 LogControl
.PRDIsInvalidated();
47 public override void Undo()
50 LogControl
.PRDIsInvalidated();
53 public override void Redo()
56 LogControl
.PRDIsInvalidated();
59 public override void FilterTextChanged(string filterText
)
61 base.FilterTextChanged(filterText
);
62 LogControl
.InvalidateGraphControl();
65 protected override void OnAfterCheck(TreeViewEventArgs e
)
69 LogControl
.m_spikeFinder
.UpdateCheckState(e
.Node
.FullPath
);
71 if (m_refreshOnTreeNodeChecked
)
72 LogControl
.PRDIsInvalidated();
75 protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e
)
77 base.OnNodeMouseClick(e
);
79 if (e
.Button
== MouseButtons
.Left
)
81 if (StatoscopeForm
.m_shiftIsBeingPressed
)
83 ProfilerRDI prdi
= (ProfilerRDI
)e
.Node
.Tag
;
84 prdi
.IsCollapsed
= !prdi
.IsCollapsed
;
85 e
.Node
.ForeColor
= prdi
.IsCollapsed
? System
.Drawing
.Color
.White
: System
.Drawing
.Color
.Empty
;
86 e
.Node
.BackColor
= prdi
.IsCollapsed
? System
.Drawing
.Color
.DarkGray
: System
.Drawing
.Color
.Empty
;
88 LogControl
.InvalidateGraphControl();
91 if (StatoscopeForm
.m_ctrlIsBeingPressed
)
93 LogControl
.PRDIsInvalidated();
96 else if (e
.Button
== MouseButtons
.Right
)
98 LogControl
.PRDIsInvalidated();