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 @@ -28,7 +28,7 @@ namespace Debugger.AddIn
if (this.Owner is WatchPad) {
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}"));
inputWindow.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWindow;
var result = inputWindow.ShowDialog();
@ -39,13 +39,13 @@ namespace Debugger.AddIn @@ -39,13 +39,13 @@ namespace Debugger.AddIn
if (!string.IsNullOrEmpty(input)) {
// 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,
language == "VB" || language == "VBNet" ? SupportedLanguage.VBNet : SupportedLanguage.CSharp);
var list = (WatchList)pad.Control;
var list = pad.WatchList;
if(!list.WatchItems.ContainsItem(text))
list.WatchItems.Add(text);
@ -62,15 +62,13 @@ namespace Debugger.AddIn @@ -62,15 +62,13 @@ namespace Debugger.AddIn
{
if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner;
var list = (WatchList)pad.Control;
var list = pad.WatchList;
var node = list.SelectedNode;
if (node == null)
return;
list.WatchItems.Remove(node);
((WatchPad)this.Owner).RefreshPad();
}
}
@ -92,7 +90,7 @@ namespace Debugger.AddIn @@ -92,7 +90,7 @@ namespace Debugger.AddIn
{
if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner;
var list = (WatchList)pad.Control;
var list = pad.WatchList;
list.WatchItems.Clear();
}
}
@ -104,7 +102,7 @@ namespace Debugger.AddIn @@ -104,7 +102,7 @@ namespace Debugger.AddIn
{
if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner;
var list = (WatchList)pad.Control;
var list = pad.WatchList;
if (list.SelectedNode is ExpressionNode) {
string text = ((ExpressionNode)list.SelectedNode).FullText;
ClipboardWrapper.SetText(text);

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

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

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

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

Loading…
Cancel
Save