diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs index 7b656faf94..d8153b1548 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DynamicTreeDebuggerRow.cs @@ -217,6 +217,7 @@ namespace ICSharpCode.SharpDevelop.Services DynamicTreeRow MakeSubMenu(string name, params IEnumerable[] elements) { DynamicTreeRow rootRow = new DynamicTreeRow(); + rootRow.ShowMinusWhileExpanded = true; DebuggerGridControl.AddColumns(rootRow.ChildColumns); rootRow[2].Text = name; foreach(IEnumerable rows in elements) { diff --git a/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicTreeRow.cs b/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicTreeRow.cs index 8cc9c33a93..b03152e973 100644 --- a/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicTreeRow.cs +++ b/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicTreeRow.cs @@ -193,15 +193,32 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid #region Child form static bool isOpeningChild; + /// + /// Block the next click event - used to ensure that a click on the "-" sign + /// does not cause the submenu to open again when the "-" sign becomes a "+" sign + /// before the click event is handled. + /// + bool blockClickEvent; + protected virtual void OnPlusClick(object sender, DynamicListEventArgs e) { + if (blockClickEvent) { blockClickEvent = false; return; } OnExpanding(e); ChildForm frm = new ChildForm(); frm.Closed += delegate { + blockClickEvent = true; if (expandedIn != null) expandedIn.Remove(e.List); OnCollapsed(e); plus.RaiseItemChanged(); + Timer timer = new Timer(); + timer.Interval = 85; + timer.Tick += delegate(object sender2, EventArgs e2) { + ((Timer)sender2).Stop(); + ((Timer)sender2).Dispose(); + blockClickEvent = false; + }; + timer.Start(); }; Point p = e.List.PointToScreen(e.List.GetPositionFromRow(this)); p.Offset(e.List.Columns[0].Width, Height); @@ -292,6 +309,9 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid bool showWindowWithoutActivation; + /// + /// Gets/Sets whether the window will receive focus when it is shown. + /// public bool ShowWindowWithoutActivation { get { return showWindowWithoutActivation;