Browse Source

minor upgrade to WatchPad.cs: add on double click / remove on DEL

pull/2/head
eusebiu 15 years ago committed by Daniel Grunwald
parent
commit
84d90d3aa3
  1. 29
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

29
src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

@ -8,6 +8,7 @@ using System.Windows.Forms;
using Aga.Controls.Tree; using Aga.Controls.Tree;
using Aga.Controls.Tree.NodeControls; using Aga.Controls.Tree.NodeControls;
using Debugger; using Debugger;
using Debugger.AddIn;
using Debugger.AddIn.TreeModel; using Debugger.AddIn.TreeModel;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.Core.WinForms; using ICSharpCode.Core.WinForms;
@ -89,12 +90,21 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
watchList.AllowDrop = true; watchList.AllowDrop = true;
watchList.DragEnter += new DragEventHandler(watchList_DragEnter); watchList.DragEnter += new DragEventHandler(watchList_DragEnter);
watchList.DragDrop += new DragEventHandler(watchList_DragDrop); watchList.DragDrop += new DragEventHandler(watchList_DragDrop);
watchList.KeyUp += new KeyEventHandler(watchList_KeyUp);
watches = new List<TextNode>(); watches = new List<TextNode>();
ResourceService.LanguageChanged += delegate { OnLanguageChanged(); }; ResourceService.LanguageChanged += delegate { OnLanguageChanged(); };
OnLanguageChanged(); OnLanguageChanged();
} }
void watchList_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete) {
RemoveWatchCommand cmd = new RemoveWatchCommand { Owner = this };
cmd.Run();
}
}
void watchList_DragDrop(object sender, DragEventArgs e) void watchList_DragDrop(object sender, DragEventArgs e)
{ {
@ -123,22 +133,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
void watchList_DoubleClick(object sender, MouseEventArgs e) void watchList_DoubleClick(object sender, MouseEventArgs e)
{ {
if (watchList.SelectedNode == null) if (watchList.SelectedNode == null)
{ {
watchList.BeginUpdate(); AddWatchCommand command = new AddWatchCommand { Owner = this };
TextNode text = new TextNode("", SupportedLanguage.CSharp); command.Run();
TreeViewVarNode node = new TreeViewVarNode(this.debuggedProcess, this.watchList, text);
watches.Add(text);
watchList.Root.Children.Add(node);
watchList.EndUpdate();
node.IsSelected = true;
this.RefreshPad();
foreach (NodeControlInfo nfo in watchList.GetNodeControls(node)) {
if (nfo.Control is WatchItemName)
((EditableControl)nfo.Control).MouseUp(new TreeNodeAdvMouseEventArgs(e));
}
} }
} }

Loading…
Cancel
Save