From f2c8cd5bed7e2d718851ea0ef7730e058dac569c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 30 Aug 2013 20:58:00 +0200 Subject: [PATCH] reimplement WatchPad --- .../Pads/AutoCompleteTextBox.cs | 25 +++--- .../Debugger.AddIn/Pads/CommonResources.xaml | 28 +++--- .../Debugger/Debugger.AddIn/Pads/WatchPad.cs | 85 +++++++++++-------- .../Debugger.AddIn/Pads/WatchPadCommands.cs | 6 +- .../Debugger.AddIn/TreeModel/Utils.cs | 2 +- .../Debugger.AddIn/TreeModel/ValueNode.cs | 20 +++-- 6 files changed, 95 insertions(+), 71 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs index c65c8956bd..4bd74cde5b 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/AutoCompleteTextBox.cs @@ -28,7 +28,7 @@ namespace Debugger.AddIn.Pads.Controls public static readonly DependencyProperty IsEditableProperty = DependencyProperty.Register("IsEditable", typeof(bool), typeof(AutoCompleteTextBox), - new FrameworkPropertyMetadata(true, IsEditableChanged)); + new FrameworkPropertyMetadata(true, IsEditableChanged)); public string Text { get { return (string)GetValue(TextProperty); } @@ -65,16 +65,21 @@ namespace Debugger.AddIn.Pads.Controls this.editor.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden; this.editor.TextArea.GotKeyboardFocus += delegate { this.Background = Brushes.White; + this.Foreground = Brushes.Black; }; this.editor.TextArea.LostKeyboardFocus += delegate { this.Background = Brushes.Transparent; + this.ClearValue(ForegroundProperty); this.Text = this.editor.Text; - this.editor.Select(0, 0); + this.editorAdapter.ClearSelection(); }; this.editor.TextArea.PreviewKeyDown += editor_TextArea_PreviewKeyDown; this.editor.TextArea.TextEntered += editor_TextArea_TextEntered; this.Content = this.editor.TextArea; + + HorizontalContentAlignment = HorizontalAlignment.Stretch; + VerticalContentAlignment = VerticalAlignment.Stretch; } void editor_TextArea_PreviewKeyDown(object sender, KeyEventArgs e) @@ -99,22 +104,22 @@ namespace Debugger.AddIn.Pads.Controls string language = ProjectService.CurrentProject == null ? "C#" : ProjectService.CurrentProject.Language; #warning reimplement this! // NRefactoryResolver resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language)); -// +// // var seg = frame.NextStatement; -// +// // var expressionFinder = ParserService.GetExpressionFinder(seg.Filename); // var info = ParserService.GetParseInformation(seg.Filename); -// +// // string text = ParserService.GetParseableFileContent(seg.Filename).Text; -// +// // int currentOffset = this.editor.CaretOffset; -// +// // var expr = expressionFinder.FindExpression(currentText, currentOffset); -// +// // expr.Region = new DomRegion(seg.StartLine, seg.StartColumn, seg.EndLine, seg.EndColumn); -// +// // var rr = resolver.Resolve(expr, info, text); -// +// // if (rr != null) { // editorAdapter.ShowCompletionWindow(new DotCodeCompletionItemProvider().GenerateCompletionListForResolveResult(rr, expr.Context)); // } diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/CommonResources.xaml b/src/AddIns/Debugger/Debugger.AddIn/Pads/CommonResources.xaml index 53441f0761..224ad7c638 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/CommonResources.xaml +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/CommonResources.xaml @@ -5,7 +5,7 @@ xmlns:local="clr-namespace:Debugger.AddIn.Pads.Controls" xmlns:core="http://icsharpcode.net/sharpdevelop/core" xmlns:tv="http://icsharpcode.net/sharpdevelop/treeview" - > +>