Browse Source

Text visualizer has two separate buttons for Copy to clipboard and Close.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4808 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 17 years ago
parent
commit
b781b6e676
  1. 63
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/TextVisualizer/TextVisualizerWindow.xaml
  2. 10
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/TextVisualizer/TextVisualizerWindow.xaml.cs

63
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/TextVisualizer/TextVisualizerWindow.xaml

@ -1,16 +1,49 @@ @@ -1,16 +1,49 @@
<Window x:Class="Debugger.AddIn.Visualizers.TextVisualizer.TextVisualizerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Text visualizer" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen"
MinWidth="300" MinHeight="300" MaxWidth="1000" MaxHeight="700">
<DockPanel Margin="2">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<Button Name="btnCopy" HorizontalAlignment="Left" Padding="4 2" Margin="0 4" Click="BtnCopy_Click">Copy to clipboard and close</Button>
<CheckBox Name="chbWrap" IsChecked="false" VerticalAlignment="Center" Margin="4 0" Unchecked="CheckBox_CheckedChanged" Checked="CheckBox_CheckedChanged">Word wrap</CheckBox>
</StackPanel>
<Border Margin="0" Padding="2">
<TextBox Background="White" IsReadOnly="True" Name="txtText" Width="Auto" Height="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"></TextBox>
</Border>
</DockPanel>
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="Debugger.AddIn.Visualizers.TextVisualizer.TextVisualizerWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Text visualizer"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen"
MinWidth="300"
MinHeight="300"
MaxWidth="1000"
MaxHeight="700">
<DockPanel
Margin="2">
<StackPanel
DockPanel.Dock="Top"
Orientation="Horizontal">
<Button
Name="btnCopy"
HorizontalAlignment="Left"
Padding="4 2"
Margin="4"
Click="BtnCopy_Click">Copy to clipboard</Button>
<Button
Name="btnClose"
HorizontalAlignment="Left"
Padding="4 2"
Margin="0 4"
Click="BtnClose_Click">Close</Button>
<CheckBox
Name="chbWrap"
IsChecked="false"
VerticalAlignment="Center"
Margin="4 0"
Unchecked="CheckBox_CheckedChanged"
Checked="CheckBox_CheckedChanged">Word wrap</CheckBox>
</StackPanel>
<Border
Margin="0"
Padding="2">
<TextBox
Background="White"
IsReadOnly="True"
Name="txtText"
Width="Auto"
Height="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"></TextBox>
</Border>
</DockPanel>
</Window>

10
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/TextVisualizer/TextVisualizerWindow.xaml.cs

@ -41,15 +41,19 @@ namespace Debugger.AddIn.Visualizers.TextVisualizer @@ -41,15 +41,19 @@ namespace Debugger.AddIn.Visualizers.TextVisualizer
set { this.txtText.Text = value; }
}
void CheckBox_CheckedChanged(object sender, RoutedEventArgs e)
{
txtText.TextWrapping = chbWrap.IsChecked.GetValueOrDefault(false) ? TextWrapping.Wrap : TextWrapping.NoWrap;
}
void BtnCopy_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText(txtText.Text);
Close();
}
void CheckBox_CheckedChanged(object sender, RoutedEventArgs e)
void BtnClose_Click(object sender, RoutedEventArgs e)
{
txtText.TextWrapping = chbWrap.IsChecked.GetValueOrDefault(false) ? TextWrapping.Wrap : TextWrapping.NoWrap;
Close();
}
}
}
Loading…
Cancel
Save