Browse Source

Change style of selected local variable item - do not highlight it

newNRvisualizers
David Srbecký 14 years ago
parent
commit
97210949c5
  1. 8
      src/AddIns/Debugger/Debugger.AddIn/Pads/Commands/WatchPadCommands.cs
  2. 6
      src/AddIns/Debugger/Debugger.AddIn/Pads/Common/AutoCompleteTextBox.cs
  3. 27
      src/AddIns/Debugger/Debugger.AddIn/Pads/Common/CommonResources.xaml
  4. 3
      src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs

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

@ -20,9 +20,11 @@ namespace Debugger.AddIn @@ -20,9 +20,11 @@ namespace Debugger.AddIn
{
if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner;
var node = new TreeNode(string.Empty, null).ToSharpTreeNode();
pad.Items.Add(node);
pad.Tree.FocusNode(node);
var node = new TreeNode(string.Empty, null);
node.CanSetName = true;
var sharpNode = node.ToSharpTreeNode();
pad.Items.Add(sharpNode);
pad.Tree.FocusNode(sharpNode);
}
}
}

6
src/AddIns/Debugger/Debugger.AddIn/Pads/Common/AutoCompleteTextBox.cs

@ -8,6 +8,7 @@ using System.Windows.Input; @@ -8,6 +8,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.CodeCompletion;
@ -56,7 +57,10 @@ namespace Debugger.AddIn.Pads.Controls @@ -56,7 +57,10 @@ namespace Debugger.AddIn.Pads.Controls
this.editor = (TextEditor)tmp;
this.editor.Background = Brushes.Transparent;
this.editor.ClearValue(TextEditor.FontFamilyProperty);
this.editor.ClearValue(TextEditor.FontSizeProperty);
this.editor.ShowLineNumbers = false;
this.editor.WordWrap = false;
this.editor.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
this.editor.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;
this.editor.TextArea.GotKeyboardFocus += delegate {
@ -70,7 +74,7 @@ namespace Debugger.AddIn.Pads.Controls @@ -70,7 +74,7 @@ namespace Debugger.AddIn.Pads.Controls
this.editor.TextArea.PreviewKeyDown += editor_TextArea_PreviewKeyDown;
this.editor.TextArea.TextEntered += editor_TextArea_TextEntered;
this.Content = this.editor;
this.Content = this.editor.TextArea;
}
void editor_TextArea_PreviewKeyDown(object sender, KeyEventArgs e)

27
src/AddIns/Debugger/Debugger.AddIn/Pads/Common/CommonResources.xaml

@ -7,6 +7,31 @@ @@ -7,6 +7,31 @@
xmlns:tv="http://icsharpcode.net/sharpdevelop/treeview"
>
<Style x:Key="itemContainerStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="true">
<GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Local Variables Pad and Watch Pad -->
<tv:SharpGridView x:Key="variableGridView">
<GridView.Columns>
@ -30,7 +55,7 @@ @@ -30,7 +55,7 @@
<GridViewColumn Header="{core:Localize MainWindow.Windows.Debug.LocalVariables.TypeColumn}" Width="200">
<GridViewColumn.CellTemplate>
<DataTemplate>
<local:AutoCompleteTextBox Text="{Binding Node.Type}" />
<local:AutoCompleteTextBox Text="{Binding Node.Type}" IsEditable="False"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>

3
src/AddIns/Debugger/Debugger.AddIn/Pads/LocalVarPad.cs

@ -2,10 +2,12 @@ @@ -2,10 +2,12 @@
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
using Debugger;
using Debugger.AddIn.TreeModel;
using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop.Services;
using ICSharpCode.TreeView;
@ -32,6 +34,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -32,6 +34,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
this.tree.Root = new SharpTreeNode();
this.tree.ShowRoot = false;
this.tree.View = (GridView)res["variableGridView"];
this.tree.ItemContainerStyle = (Style)res["itemContainerStyle"];
WindowsDebugger.RefreshingPads += RefreshPad;
RefreshPad();

Loading…
Cancel
Save