From 0be82e62dd33363985a97df210a25cce4622d0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Tue, 7 Feb 2006 12:49:20 +0000 Subject: [PATCH] Implemented SD2-663 - you can copy values from tooltips to clipborad; Values of properties can not be edited git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1086 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Src/Service/DynamicTreeDebuggerRow.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) 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 dc12d83888..fa95eb0dcf 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 @@ -53,6 +53,7 @@ namespace ICSharpCode.SharpDevelop.Services this[1].Paint += OnIconPaint; this[3].FinishLabelEdit += OnLabelEdited; + this[3].MouseDown += OnMouseDown; Update(); } @@ -68,13 +69,11 @@ namespace ICSharpCode.SharpDevelop.Services this[1].Text = ""; // Icon this[2].Text = variable.Name; this[3].Text = variable.Value.AsString; - if (variable.Value is PrimitiveValue && variable.Value.ManagedType != typeof(string)) { - this[3].AllowLabelEdit = true; - } + this[3].AllowLabelEdit = variable.Value is PrimitiveValue && + variable.Value.ManagedType != typeof(string) && + !(variable is PropertyVariable); - if (!variable.Value.MayHaveSubVariables) { - this.ShowPlus = false; - } + this.ShowPlus = variable.Value.MayHaveSubVariables; this.ShowMinusWhileExpanded = true; } @@ -96,6 +95,27 @@ namespace ICSharpCode.SharpDevelop.Services } } + void OnMouseDown(object sender, DynamicListMouseEventArgs e) + { + if (e.Button == MouseButtons.Right) { + ContextMenuStrip menu = new ContextMenuStrip(); + + ToolStripMenuItem copyItem; + copyItem = new ToolStripMenuItem(); + copyItem.Text = "Copy value to clipboard"; + copyItem.Checked = false; + copyItem.Click += delegate { + ClipboardWrapper.SetText(((DynamicListItem)sender).Text); + }; + + menu.Items.AddRange(new ToolStripItem[] { + copyItem + }); + + menu.Show(e.List, e.Location); + } + } + /// /// Called when plus is pressed in debugger tooltip. /// Sets the data to be show in the next level.