Browse Source

Debugger tooltips - added visualizer picker image.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4749 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 17 years ago
parent
commit
c0a9d4c1f5
  1. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  2. 19
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerPopup.cs
  3. 6
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml
  4. 103
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml.cs
  5. 5
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/Images.xaml
  6. 32
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/LazyItemsControl.cs
  7. 16
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/VirtualizingIEnumerable.cs
  8. 12
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.cs
  9. 178
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.xaml
  10. BIN
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/magnifier.png

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -265,6 +265,7 @@
<Compile Include="Src\Services\ProjectBinding\IProjectBinding.cs" /> <Compile Include="Src\Services\ProjectBinding\IProjectBinding.cs" />
<Compile Include="Src\Internal\Templates\Project\ProjectCreateInformation.cs" /> <Compile Include="Src\Internal\Templates\Project\ProjectCreateInformation.cs" />
<Compile Include="Src\Services\ProjectBinding\ProjectBindingService.cs" /> <Compile Include="Src\Services\ProjectBinding\ProjectBindingService.cs" />
<None Include="Src\Services\Debugger\Tooltips\magnifier.png" />
<None Include="Src\Services\ParserService\OldParserService.cs" /> <None Include="Src\Services\ParserService\OldParserService.cs" />
<Compile Include="Src\Services\DisplayBinding\DisplayBindingDoozer.cs" /> <Compile Include="Src\Services\DisplayBinding\DisplayBindingDoozer.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\CombineOpenEvaluator.cs" /> <Compile Include="Src\Internal\ConditionEvaluators\CombineOpenEvaluator.cs" />
@ -883,6 +884,7 @@
<Page Include="Src\Gui\Dialogs\TreeViewOptionsDialog.xaml" /> <Page Include="Src\Gui\Dialogs\TreeViewOptionsDialog.xaml" />
<Page Include="Src\Gui\Workbench\WpfWorkbench.xaml" /> <Page Include="Src\Gui\Workbench\WpfWorkbench.xaml" />
<Page Include="Src\Services\Debugger\Tooltips\DebuggerTooltipControl.xaml" /> <Page Include="Src\Services\Debugger\Tooltips\DebuggerTooltipControl.xaml" />
<Page Include="Src\Services\Debugger\Tooltips\Images.xaml" />
<Page Include="Src\Services\Debugger\Tooltips\VisualizerPicker.xaml" /> <Page Include="Src\Services\Debugger\Tooltips\VisualizerPicker.xaml" />
<Page Include="Src\TextEditor\Gui\Dialogs\GotoDialog.xaml" /> <Page Include="Src\TextEditor\Gui\Dialogs\GotoDialog.xaml" />
</ItemGroup> </ItemGroup>

19
src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerPopup.cs

@ -19,26 +19,26 @@ namespace ICSharpCode.SharpDevelop.Debugging
public class DebuggerPopup : Popup public class DebuggerPopup : Popup
{ {
private DebuggerTooltipControl contentControl; private DebuggerTooltipControl contentControl;
public DebuggerPopup(DebuggerTooltipControl parentControl) public DebuggerPopup(DebuggerTooltipControl parentControl)
{ {
this.contentControl = new DebuggerTooltipControl(parentControl); this.contentControl = new DebuggerTooltipControl(parentControl);
this.contentControl.containingPopup = this; this.contentControl.containingPopup = this;
this.Child = this.contentControl; this.Child = this.contentControl;
this.IsLeaf = false; this.IsLeaf = false;
//this.contentControl.Focusable = true; //this.contentControl.Focusable = true;
//Keyboard.Focus(this.contentControl); //Keyboard.Focus(this.contentControl);
//this.AllowsTransparency = true; //this.AllowsTransparency = true;
//this.PopupAnimation = PopupAnimation.Slide; //this.PopupAnimation = PopupAnimation.Slide;
} }
public IEnumerable<ITreeNode> ItemsSource public IEnumerable<ITreeNode> ItemsSource
{ {
get { return this.contentControl.ItemsSource; } get { return this.contentControl.ItemsSource; }
set { this.contentControl.ItemsSource = value; } set { this.contentControl.ItemsSource = value; }
} }
private bool isLeaf; private bool isLeaf;
public bool IsLeaf public bool IsLeaf
{ {
@ -50,21 +50,20 @@ namespace ICSharpCode.SharpDevelop.Debugging
this.StaysOpen = !isLeaf; this.StaysOpen = !isLeaf;
} }
} }
protected override void OnClosed(EventArgs e) protected override void OnClosed(EventArgs e)
{ {
base.OnClosed(e); base.OnClosed(e);
if (isLeaf) if (isLeaf) {
{
this.contentControl.CloseOnLostFocus(); this.contentControl.CloseOnLostFocus();
} }
} }
public void Open() public void Open()
{ {
this.IsOpen = true; this.IsOpen = true;
} }
public void CloseSelfAndChildren() public void CloseSelfAndChildren()
{ {
this.contentControl.CloseChildPopups(); this.contentControl.CloseChildPopups();

6
src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml

@ -4,11 +4,7 @@
xmlns:debugging="clr-namespace:ICSharpCode.SharpDevelop.Debugging"> xmlns:debugging="clr-namespace:ICSharpCode.SharpDevelop.Debugging">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary Source="VisualizerPicker.xaml" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="VisualizerPicker.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<!-- TODO move styles to ResourceDictionary --> <!-- TODO move styles to ResourceDictionary -->
<Style x:Key="ExpandCollapseToggleStyle" <Style x:Key="ExpandCollapseToggleStyle"

103
src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml.cs

@ -27,140 +27,130 @@ namespace ICSharpCode.SharpDevelop.Debugging
private readonly double ChildPopupOpenYOffet = 15; private readonly double ChildPopupOpenYOffet = 15;
private readonly int InitialItemsCount = 12; private readonly int InitialItemsCount = 12;
private readonly int VisibleItemsCount = 11; private readonly int VisibleItemsCount = 11;
public DebuggerTooltipControl() public DebuggerTooltipControl()
{ {
InitializeComponent(); InitializeComponent();
} }
public DebuggerTooltipControl(ITreeNode node) public DebuggerTooltipControl(ITreeNode node)
: this(new ITreeNode[] { node }) : this(new ITreeNode[] { node })
{ {
} }
public DebuggerTooltipControl(IEnumerable<ITreeNode> nodes) public DebuggerTooltipControl(IEnumerable<ITreeNode> nodes)
: this() : this()
{ {
this.ItemsSource = nodes; this.ItemsSource = nodes;
} }
public DebuggerTooltipControl(DebuggerTooltipControl parentControl) public DebuggerTooltipControl(DebuggerTooltipControl parentControl)
: this() : this()
{ {
this.parentControl = parentControl; this.parentControl = parentControl;
} }
public event RoutedEventHandler Closed; public event RoutedEventHandler Closed;
protected void OnClosed() protected void OnClosed()
{ {
if (this.Closed != null) if (this.Closed != null) {
{
this.Closed(this, new RoutedEventArgs()); this.Closed(this, new RoutedEventArgs());
} }
} }
private LazyItemsControl<ITreeNode> lazyGrid; private LazyItemsControl<ITreeNode> lazyGrid;
private IEnumerable<ITreeNode> itemsSource; private IEnumerable<ITreeNode> itemsSource;
public IEnumerable<ITreeNode> ItemsSource public IEnumerable<ITreeNode> ItemsSource
{ {
get { return this.itemsSource; }
set set
{ {
this.itemsSource = value; this.itemsSource = value;
this.lazyGrid = new LazyItemsControl<ITreeNode>(this.dataGrid, InitialItemsCount); this.lazyGrid = new LazyItemsControl<ITreeNode>(this.dataGrid, InitialItemsCount);
lazyGrid.ItemsSource = new VirtualizingIEnumerable<ITreeNode>(value); lazyGrid.ItemsSource = new VirtualizingIEnumerable<ITreeNode>(value);
this.dataGrid.AddHandler(ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(handleScroll)); this.dataGrid.AddHandler(ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(handleScroll));
if (this.lazyGrid.ItemsSourceTotalCount != null) if (this.lazyGrid.ItemsSourceTotalCount != null) {
{
// hide up/down buttons if too few items // hide up/down buttons if too few items
btnUp.Visibility = btnDown.Visibility = btnUp.Visibility = btnDown.Visibility =
this.lazyGrid.ItemsSourceTotalCount.Value <= VisibleItemsCount ? Visibility.Collapsed : Visibility.Visible; this.lazyGrid.ItemsSourceTotalCount.Value <= VisibleItemsCount ? Visibility.Collapsed : Visibility.Visible;
} }
} }
get
{
return this.itemsSource;
}
} }
/// <inheritdoc/> /// <inheritdoc/>
public bool ShowAsPopup { public bool ShowAsPopup
get { {
get
{
return true; return true;
} }
} }
/// <inheritdoc/> /// <inheritdoc/>
public bool Close(bool mouseClick) public bool Close(bool mouseClick)
{ {
if (mouseClick || (!mouseClick && !isChildExpanded)) if (mouseClick || (!mouseClick && !isChildExpanded)) {
{
CloseChildPopups(); CloseChildPopups();
return true; return true;
} } else {
else
{
return false; return false;
} }
} }
DebuggerPopup childPopup { get; set; } DebuggerPopup childPopup { get; set; }
DebuggerTooltipControl parentControl { get; set; } DebuggerTooltipControl parentControl { get; set; }
internal DebuggerPopup containingPopup { get; set; } internal DebuggerPopup containingPopup { get; set; }
bool isChildExpanded bool isChildExpanded
{ {
get { get
{
return this.childPopup != null && this.childPopup.IsOpen; return this.childPopup != null && this.childPopup.IsOpen;
} }
} }
private ToggleButton expandedButton; private ToggleButton expandedButton;
/// <summary> /// <summary>
/// Closes the child popup of this control, if it exists. /// Closes the child popup of this control, if it exists.
/// </summary> /// </summary>
public void CloseChildPopups() public void CloseChildPopups()
{ {
if (this.expandedButton != null) if (this.expandedButton != null) {
{
this.expandedButton.IsChecked = false; this.expandedButton.IsChecked = false;
this.expandedButton = null; this.expandedButton = null;
// nice simple example of indirect recursion // nice simple example of indirect recursion
this.childPopup.CloseSelfAndChildren(); this.childPopup.CloseSelfAndChildren();
} }
} }
public void CloseOnLostFocus() public void CloseOnLostFocus()
{ {
// when leaf below us closes, we become the leaf // when leaf below us closes, we become the leaf
if (this.containingPopup != null) if (this.containingPopup != null) {
this.containingPopup.IsLeaf = true; this.containingPopup.IsLeaf = true;
if (!this.IsMouseOver) }
{ if (!this.IsMouseOver) {
if (this.containingPopup != null) if (this.containingPopup != null) {
{
this.containingPopup.IsOpen = false; this.containingPopup.IsOpen = false;
this.containingPopup.IsLeaf = false; this.containingPopup.IsLeaf = false;
} }
if (this.parentControl != null) if (this.parentControl != null) {
{
this.parentControl.CloseOnLostFocus(); this.parentControl.CloseOnLostFocus();
} }
OnClosed(); OnClosed();
} } else {
else
{
// leaf closed because of click inside this control - stop the closing chain // leaf closed because of click inside this control - stop the closing chain
if (this.expandedButton != null && !this.expandedButton.IsMouseOver) if (this.expandedButton != null && !this.expandedButton.IsMouseOver) {
{
this.expandedButton.IsChecked = false; this.expandedButton.IsChecked = false;
this.expandedButton = null; this.expandedButton = null;
} }
} }
} }
private void btnExpander_Click(object sender, RoutedEventArgs e) private void btnExpander_Click(object sender, RoutedEventArgs e)
{ {
var clickedButton = (ToggleButton)e.OriginalSource; var clickedButton = (ToggleButton)e.OriginalSource;
@ -168,19 +158,16 @@ namespace ICSharpCode.SharpDevelop.Debugging
// use device independent units, because child popup Left/Top are in independent units // use device independent units, because child popup Left/Top are in independent units
Point buttonPos = clickedButton.PointToScreen(new Point(0, 0)).TransformFromDevice(clickedButton); Point buttonPos = clickedButton.PointToScreen(new Point(0, 0)).TransformFromDevice(clickedButton);
if (clickedButton.IsChecked.GetValueOrDefault(false)) if (clickedButton.IsChecked.GetValueOrDefault(false)) {
{
CloseChildPopups(); CloseChildPopups();
this.expandedButton = clickedButton; this.expandedButton = clickedButton;
// open child Popup // open child Popup
if (this.childPopup == null) if (this.childPopup == null) {
{
this.childPopup = new DebuggerPopup(this); this.childPopup = new DebuggerPopup(this);
this.childPopup.Placement = PlacementMode.Absolute; this.childPopup.Placement = PlacementMode.Absolute;
} }
if (this.containingPopup != null) if (this.containingPopup != null) {
{
this.containingPopup.IsLeaf = false; this.containingPopup.IsLeaf = false;
} }
this.childPopup.IsLeaf = true; this.childPopup.IsLeaf = true;
@ -188,24 +175,22 @@ namespace ICSharpCode.SharpDevelop.Debugging
this.childPopup.VerticalOffset = buttonPos.Y + ChildPopupOpenYOffet; this.childPopup.VerticalOffset = buttonPos.Y + ChildPopupOpenYOffet;
this.childPopup.ItemsSource = clickedNode.ChildNodes; this.childPopup.ItemsSource = clickedNode.ChildNodes;
this.childPopup.Open(); this.childPopup.Open();
} } else {
else
{
CloseChildPopups(); CloseChildPopups();
} }
} }
private void handleScroll(object sender, ScrollChangedEventArgs e) private void handleScroll(object sender, ScrollChangedEventArgs e)
{ {
btnUp.IsEnabled = !this.lazyGrid.IsScrolledToStart; btnUp.IsEnabled = !this.lazyGrid.IsScrolledToStart;
btnDown.IsEnabled = !this.lazyGrid.IsScrolledToEnd; btnDown.IsEnabled = !this.lazyGrid.IsScrolledToEnd;
} }
void BtnUp_Click(object sender, RoutedEventArgs e) void BtnUp_Click(object sender, RoutedEventArgs e)
{ {
this.lazyGrid.ScrollViewer.ScrollUp(1); this.lazyGrid.ScrollViewer.ScrollUp(1);
} }
void BtnDown_Click(object sender, RoutedEventArgs e) void BtnDown_Click(object sender, RoutedEventArgs e)
{ {
this.lazyGrid.ScrollViewer.ScrollDown(1); this.lazyGrid.ScrollViewer.ScrollDown(1);

5
src/Main/Base/Project/Src/Services/Debugger/Tooltips/Images.xaml

@ -0,0 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<BitmapImage x:Key="MagnifierImage" UriSource="magnifier.png" />
</ResourceDictionary>

32
src/Main/Base/Project/Src/Services/Debugger/Tooltips/LazyItemsControl.cs

@ -18,7 +18,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
{ {
private ItemsControl itemsControl; private ItemsControl itemsControl;
private int initialItemsCount; private int initialItemsCount;
/// <summary> /// <summary>
/// Creates new instance of LazyItemsControl. /// Creates new instance of LazyItemsControl.
/// </summary> /// </summary>
@ -28,12 +28,12 @@ namespace ICSharpCode.SharpDevelop.Debugging
{ {
if (wrappedItemsControl == null) if (wrappedItemsControl == null)
throw new ArgumentNullException("wrappedItemsControl"); throw new ArgumentNullException("wrappedItemsControl");
this.initialItemsCount = initialItemsCount; this.initialItemsCount = initialItemsCount;
this.itemsControl = wrappedItemsControl; this.itemsControl = wrappedItemsControl;
this.itemsControl.AddHandler(ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(handleScroll)); this.itemsControl.AddHandler(ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(handleScroll));
} }
private ScrollViewer scrollViewerCached; private ScrollViewer scrollViewerCached;
public ScrollViewer ScrollViewer public ScrollViewer ScrollViewer
{ {
@ -44,7 +44,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return this.scrollViewerCached; return this.scrollViewerCached;
} }
} }
public bool IsScrolledToStart public bool IsScrolledToStart
{ {
get get
@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return ScrollViewer.VerticalOffset == 0; return ScrollViewer.VerticalOffset == 0;
} }
} }
public bool IsScrolledToEnd public bool IsScrolledToEnd
{ {
get get
@ -68,7 +68,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return (ScrollViewer.VerticalOffset >= totalItems - ScrollViewer.ViewportHeight); return (ScrollViewer.VerticalOffset >= totalItems - ScrollViewer.ViewportHeight);
} }
} }
private int? itemsSourceTotalCount = null; private int? itemsSourceTotalCount = null;
/// <summary> Items count of underlying IEnumerable. Null until scrolled to the end of IEnumerable. </summary> /// <summary> Items count of underlying IEnumerable. Null until scrolled to the end of IEnumerable. </summary>
public int? ItemsSourceTotalCount public int? ItemsSourceTotalCount
@ -78,15 +78,12 @@ namespace ICSharpCode.SharpDevelop.Debugging
return this.itemsSourceTotalCount; return this.itemsSourceTotalCount;
} }
} }
private VirtualizingIEnumerable<T> itemsSource; private VirtualizingIEnumerable<T> itemsSource;
/// <summary> The collection that underlying ItemsControl sees. </summary> /// <summary> The collection that underlying ItemsControl sees. </summary>
public VirtualizingIEnumerable<T> ItemsSource public VirtualizingIEnumerable<T> ItemsSource
{ {
get get { return itemsSource; }
{
return itemsSource;
}
set set
{ {
this.itemsSource = value; this.itemsSource = value;
@ -94,24 +91,21 @@ namespace ICSharpCode.SharpDevelop.Debugging
this.itemsControl.ItemsSource = value; this.itemsControl.ItemsSource = value;
} }
} }
private void addNextItems(VirtualizingIEnumerable<T> sourceToAdd, int nItems) private void addNextItems(VirtualizingIEnumerable<T> sourceToAdd, int nItems)
{ {
sourceToAdd.AddNextItems(nItems); sourceToAdd.AddNextItems(nItems);
if (!sourceToAdd.HasNext) if (!sourceToAdd.HasNext) {
{
// all items from IEnumerable have been added // all items from IEnumerable have been added
this.itemsSourceTotalCount = sourceToAdd.Count; this.itemsSourceTotalCount = sourceToAdd.Count;
} }
} }
private void handleScroll(object sender, ScrollChangedEventArgs e) private void handleScroll(object sender, ScrollChangedEventArgs e)
{ {
if (e.VerticalChange > 0) if (e.VerticalChange > 0) {
{
// scrolled to bottom // scrolled to bottom
if (e.VerticalOffset >= this.itemsSource.Count - e.ViewportHeight) if (e.VerticalOffset >= this.itemsSource.Count - e.ViewportHeight) {
{
addNextItems(this.itemsSource, (int)e.VerticalChange); addNextItems(this.itemsSource, (int)e.VerticalChange);
} }
} }

16
src/Main/Base/Project/Src/Services/Debugger/Tooltips/VirtualizingIEnumerable.cs

@ -18,36 +18,34 @@ namespace ICSharpCode.SharpDevelop.Debugging
public class VirtualizingIEnumerable<T> : ObservableCollection<T> public class VirtualizingIEnumerable<T> : ObservableCollection<T>
{ {
private IEnumerator<T> originalSourceEnumerator; private IEnumerator<T> originalSourceEnumerator;
public VirtualizingIEnumerable(IEnumerable<T> originalSource) public VirtualizingIEnumerable(IEnumerable<T> originalSource)
{ {
if (originalSource == null) if (originalSource == null)
throw new ArgumentNullException("originalSource"); throw new ArgumentNullException("originalSource");
this.originalSourceEnumerator = originalSource.GetEnumerator(); this.originalSourceEnumerator = originalSource.GetEnumerator();
} }
private bool hasNext = true; private bool hasNext = true;
/// <summary> /// <summary>
/// False if all items from underlying IEnumerable have already been added. /// False if all items from underlying IEnumerable have already been added.
/// </summary> /// </summary>
public bool HasNext public bool HasNext
{ {
get get
{ {
return this.hasNext; return this.hasNext;
} }
} }
/// <summary> /// <summary>
/// Requests next <paramref name="count"/> items from underlying IEnumerable source and adds them to the collection. /// Requests next <paramref name="count"/> items from underlying IEnumerable source and adds them to the collection.
/// </summary> /// </summary>
public void AddNextItems(int count) public void AddNextItems(int count)
{ {
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++) {
{ if (!originalSourceEnumerator.MoveNext()) {
if (!originalSourceEnumerator.MoveNext())
{
this.hasNext = false; this.hasNext = false;
break; break;
} }

12
src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.cs

@ -31,15 +31,15 @@ namespace ICSharpCode.SharpDevelop.Debugging
if (clickedCommand == null) { if (clickedCommand == null) {
throw new InvalidOperationException( throw new InvalidOperationException(
string.Format("{0} clicked, only instances of {1} must be present in {2}.", string.Format("{0} clicked, only instances of {1} must be present in {2}.",
this.SelectedItem.GetType().ToString(), typeof(IVisualizerCommand).Name, typeof(VisualizerPicker).Name)); this.SelectedItem.GetType().ToString(), typeof(IVisualizerCommand).Name, typeof(VisualizerPicker).Name));
} }
clickedCommand.Execute(); clickedCommand.Execute();
// make no item selected, so that multiple selections of the same item always execute the command // Make no item selected, so that multiple selections of the same item always execute the command.
// this triggers VisualizerPicker_SelectionChanged again, which returns immediately // This triggers VisualizerPicker_SelectionChanged again, which returns immediately.
this.SelectedIndex = -1; this.SelectedIndex = -1;
} }
public new IEnumerable<IVisualizerCommand> ItemsSource public new IEnumerable<IVisualizerCommand> ItemsSource
{ {
get { return (IEnumerable<IVisualizerCommand>)base.ItemsSource; } get { return (IEnumerable<IVisualizerCommand>)base.ItemsSource; }

178
src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.xaml

@ -2,6 +2,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
xmlns:debugging="clr-namespace:ICSharpCode.SharpDevelop.Debugging"> xmlns:debugging="clr-namespace:ICSharpCode.SharpDevelop.Debugging">
<!--
<BitmapImage x:Key="MagnifierImage" UriSource="magnifier.png" /> -->
<Style x:Key="ComboBoxFocusVisual"> <Style x:Key="ComboBoxFocusVisual">
<Setter Property="Control.Template"> <Setter Property="Control.Template">
<Setter.Value> <Setter.Value>
@ -20,66 +24,72 @@
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/> <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
<Geometry x:Key="DownArrowGeometry">M 0 0 L 2 3 L 4 0 Z</Geometry> <Geometry x:Key="DownArrowGeometry">M 0 0 L 2 3 L 4 0 Z</Geometry>
<Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}"> <Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/> <Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/> <Setter Property="Focusable" Value="false"/>
<Setter Property="ClickMode" Value="Press"/> <Setter Property="ClickMode" Value="Press"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}"> <ControlTemplate TargetType="{x:Type ToggleButton}">
<!-- Button face - changed from original ButtonChrome to Border -->
<Border Name="FaceBorder" Background="White" CornerRadius="2" BorderBrush="Gray" BorderThickness="1" Padding="1" >
<Grid HorizontalAlignment="Right" Width="5">
<Path x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="FaceBorder" Property="Background" Value="#FFE0EDFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
<GradientStop Color="#ABADB3" Offset="0.05"/>
<GradientStop Color="#E2E3EA" Offset="0.07"/>
<GradientStop Color="#E3E9EF" Offset="1"/>
</LinearGradientBrush>
<Style TargetType="{x:Type debugging:VisualizerPicker}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Padding" Value="4,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type debugging:VisualizerPicker}">
<!-- ComboBox face -->
<Grid x:Name="MainGrid" SnapsToDevicePixels="true" Width="18" Height="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<Popup x:Name="PART_Popup" Margin="1" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}" Color="Transparent">
<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer CanContentScroll="true">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Border>
</Microsoft_Windows_Themes:SystemDropShadowChrome>
</Popup>
<ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
<!-- Content of ComboBox face --> <!-- Button face - changed from original ButtonChrome to Border -->
<ContentPresenter <Border Name="FaceBorder" Background="White" CornerRadius="2" BorderBrush="#FFD9D9E9" BorderThickness="1" Padding="1" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<!--
<Image Grid.Column="0" Width="10" Height="10" Stretch="Fill" Source="{StaticResource MagnifierImage}" /> -->
<Path Grid.Column="1" x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="FaceBorder" Property="Background" Value="#FFE0EDFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
<GradientStop Color="#ABADB3" Offset="0.05"/>
<GradientStop Color="#E2E3EA" Offset="0.07"/>
<GradientStop Color="#E3E9EF" Offset="1"/>
</LinearGradientBrush>
<Style TargetType="{x:Type debugging:VisualizerPicker}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Padding" Value="4,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type debugging:VisualizerPicker}">
<!-- ComboBox face -->
<Grid x:Name="MainGrid" SnapsToDevicePixels="true" Width="18" Height="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<Popup x:Name="PART_Popup" Margin="1" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}" Color="Transparent">
<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer CanContentScroll="true">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Border>
</Microsoft_Windows_Themes:SystemDropShadowChrome>
</Popup>
<ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
<!-- Content of ComboBox face -->
<ContentPresenter
HorizontalAlignment="Left" HorizontalAlignment="Left"
Margin="0" Margin="0"
VerticalAlignment="Center" VerticalAlignment="Center"
@ -90,29 +100,29 @@
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/> ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true"> <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/> <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
<Setter Property="Color" TargetName="Shdw" Value="#71000000"/> <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
</Trigger> </Trigger>
<Trigger Property="HasItems" Value="false"> <Trigger Property="HasItems" Value="false">
<Setter Property="Height" TargetName="DropDownBorder" Value="95"/> <Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="false"> <Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
<Setter Property="Background" Value="#FFF4F4F4"/> <Setter Property="Background" Value="#FFF4F4F4"/>
</Trigger> </Trigger>
<Trigger Property="IsGrouping" Value="true"> <Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/> <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
<Style.Triggers> <Style.Triggers>
<Trigger Property="IsEditable" Value="true"> <Trigger Property="IsEditable" Value="true">
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

BIN
src/Main/Base/Project/Src/Services/Debugger/Tooltips/magnifier.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Loading…
Cancel
Save