Browse Source

Fix WatchPad issues;

FontFamily & FontSize in ChangeMarkerMargin tooltip are from CodeEditorOptions
pull/15/head
Eusebiu Marcu 16 years ago
parent
commit
9ca217c1df
  1. 16
      src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs
  2. 6
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
  3. 7
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs

16
src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs

@ -28,7 +28,7 @@ namespace Debugger.AddIn
if (this.Owner is WatchPad) { if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner; WatchPad pad = (WatchPad)this.Owner;
var inputWindow = new WatchInputBox(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.AddWatch}"), var inputWindow = new WatchInputBox(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.AddWatch}"),
StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.EnterExpression}")); StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.EnterExpression}"));
inputWindow.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow; inputWindow.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow;
var result = inputWindow.ShowDialog(); var result = inputWindow.ShowDialog();
@ -39,13 +39,13 @@ namespace Debugger.AddIn
if (!string.IsNullOrEmpty(input)) { if (!string.IsNullOrEmpty(input)) {
// get language // get language
if (ProjectService.CurrentProject == null) return; if (ProjectService.CurrentProject == null) return;
string language = ProjectService.CurrentProject.Language; string language = ProjectService.CurrentProject.Language;
TextNode text = new TextNode(input, TextNode text = new TextNode(input,
language == "VB" || language == "VBNet" ? SupportedLanguage.VBNet : SupportedLanguage.CSharp); language == "VB" || language == "VBNet" ? SupportedLanguage.VBNet : SupportedLanguage.CSharp);
var list = (WatchList)pad.Control; var list = pad.WatchList;
if(!list.WatchItems.ContainsItem(text)) if(!list.WatchItems.ContainsItem(text))
list.WatchItems.Add(text); list.WatchItems.Add(text);
@ -62,15 +62,13 @@ namespace Debugger.AddIn
{ {
if (this.Owner is WatchPad) { if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner; WatchPad pad = (WatchPad)this.Owner;
var list = (WatchList)pad.Control; var list = pad.WatchList;
var node = list.SelectedNode; var node = list.SelectedNode;
if (node == null) if (node == null)
return; return;
list.WatchItems.Remove(node); list.WatchItems.Remove(node);
((WatchPad)this.Owner).RefreshPad(); ((WatchPad)this.Owner).RefreshPad();
} }
} }
@ -92,7 +90,7 @@ namespace Debugger.AddIn
{ {
if (this.Owner is WatchPad) { if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner; WatchPad pad = (WatchPad)this.Owner;
var list = (WatchList)pad.Control; var list = pad.WatchList;
list.WatchItems.Clear(); list.WatchItems.Clear();
} }
} }
@ -104,7 +102,7 @@ namespace Debugger.AddIn
{ {
if (this.Owner is WatchPad) { if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner; WatchPad pad = (WatchPad)this.Owner;
var list = (WatchList)pad.Control; var list = pad.WatchList;
if (list.SelectedNode is ExpressionNode) { if (list.SelectedNode is ExpressionNode) {
string text = ((ExpressionNode)list.SelectedNode).FullText; string text = ((ExpressionNode)list.SelectedNode).FullText;
ClipboardWrapper.SetText(text); ClipboardWrapper.SetText(text);

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

@ -31,6 +31,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
get { return instance; } get { return instance; }
} }
public WatchList WatchList {
get {
return watchList;
}
}
public WatchPad() public WatchPad()
{ {
instance = this; instance = this;

7
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin.cs

@ -8,6 +8,7 @@ using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using ICSharpCode.AvalonEdit.AddIn.Options;
using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Rendering;
@ -145,7 +146,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
Background = Brushes.White Background = Brushes.White
}; };
TextBlock oldTb = new TextBlock() { TextBlock oldTb = new TextBlock() {
FontFamily = new FontFamily("Courier New"), FontFamily = new FontFamily(CodeEditorOptions.Instance.FontFamily),
FontSize = CodeEditorOptions.Instance.FontSize,
Foreground = Brushes.Black, Foreground = Brushes.Black,
Background = Brushes.White, Background = Brushes.White,
TextDecorations = TextDecorations.Strikethrough, TextDecorations = TextDecorations.Strikethrough,
@ -155,7 +157,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
oldTb.Text = diffs[0].Text.Trim(); oldTb.Text = diffs[0].Text.Trim();
TextBlock newTb = new TextBlock() { TextBlock newTb = new TextBlock() {
FontFamily = new FontFamily("Courier New"), FontFamily = new FontFamily(CodeEditorOptions.Instance.FontFamily),
FontSize = CodeEditorOptions.Instance.FontSize,
Foreground = Brushes.Black, Foreground = Brushes.Black,
Background = Brushes.White, Background = Brushes.White,
Text = diffs[1].Text.Trim() Text = diffs[1].Text.Trim()

Loading…
Cancel
Save