1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-11 13:50:13 +00:00
6502bench/SourceGen/Tools/WpfGui/HexDumpViewer.xaml
2023-04-14 13:46:40 -07:00

81 lines
3.8 KiB
XML

<!--
Copyright 2019 faddenSoft
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Window x:Class="SourceGen.Tools.WpfGui.HexDumpViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:SourceGen.WpfGui"
mc:Ignorable="d"
Title="Hex Dump Viewer"
Width="542" Height="600" MinWidth="542" MinHeight="180" ResizeMode="CanResizeWithGrip"
ShowInTaskbar="True"
Loaded="Window_Loaded"
PreviewKeyDown="Window_KeyEventHandler">
<Window.Resources>
<system:String x:Key="str_AsciiOnly">Plain ASCII only</system:String>
<system:String x:Key="str_LowHighAscii">Low/High ASCII</system:String>
<system:String x:Key="str_C64Petscii">C64 PETSCII</system:String>
<system:String x:Key="str_C64ScreenCode">C64 Screen Code</system:String>
<system:String x:Key="str_TitleAddon" xml:space="preserve"> - Hex Dump Viewer</system:String>
</Window.Resources>
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- DataGrid gives us Ctrl+A (select-all) and Ctrl+C (text-copy) built in. -->
<DataGrid Name="hexDumpData" Grid.Row="0"
IsReadOnly="True"
ItemsSource="{Binding HexDumpLines}"
FontFamily="{StaticResource GeneralMonoFont}"
SnapsToDevicePixels="True"
GridLinesVisibility="None"
AutoGenerateColumns="False"
HeadersVisibility="Column"
CanUserReorderColumns="False"
CanUserSortColumns="False"
SelectionMode="Extended"
EnableRowVirtualization="True"
ScrollViewer.CanContentScroll="True"
VerticalScrollBarVisibility="Visible">
<DataGrid.Columns>
<!-- Unqualified {Binding} creates a Binding object with default values.
This is how we reference the strings we get from the virtualized IList. -->
<DataGridTextColumn Header="Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F Text"
Width="491" Binding="{Binding}"/>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="1" Margin="0,5,0,0" Orientation="Horizontal">
<TextBlock Text="Character conversion:" Margin="0,3,0,0"/>
<ComboBox Name="charConvComboBox" Width="120" Margin="4,0,0,0"
ItemsSource="{Binding CharConvItems}" DisplayMemberPath="Name"
SelectionChanged="CharConvComboBox_SelectionChanged"/>
<CheckBox Content="ASCII-only dump" Margin="16,4,0,0" IsChecked="{Binding AsciiOnlyDump}"/>
<!-- Bind the checkbox directly to the window's Topmost property. -->
<CheckBox Content="Always on top" Margin="16,4,0,0" IsChecked="{Binding Path=Topmost}"/>
</StackPanel>
</Grid>
</Window>