2020-06-24 00:21:18 +00:00
|
|
|
<!--
|
|
|
|
Copyright 2020 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.Omf.WpfGui.OmfViewer"
|
|
|
|
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:local="clr-namespace:SourceGen.Tools.Omf.WpfGui"
|
2020-06-28 18:56:51 +00:00
|
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
2020-06-24 00:21:18 +00:00
|
|
|
mc:Ignorable="d"
|
|
|
|
Title="OMF File Viewer"
|
|
|
|
SizeToContent="Height" Width="600" ResizeMode="NoResize"
|
|
|
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
|
|
|
|
|
|
|
|
<Window.Resources>
|
|
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
2020-06-28 18:56:51 +00:00
|
|
|
|
|
|
|
<system:String x:Key="str_OmfFileUnknownStr">a ??? file</system:String>
|
|
|
|
<system:String x:Key="str_OmfFileLoadStr">a Load file</system:String>
|
|
|
|
<system:String x:Key="str_OmfFileObjectStr">an Object file</system:String>
|
|
|
|
<system:String x:Key="str_OmfFileLibraryStr">a Library file</system:String>
|
|
|
|
<system:String x:Key="str_OmfFileIndeterminateStr">a file of indeterminate type</system:String>
|
|
|
|
|
|
|
|
<system:String x:Key="str_OmfFileSummaryFmt">This is {0}, with {1} segment</system:String>
|
|
|
|
<system:String x:Key="str_OmfFileSummaryPlFmt">This is {0}, with {1} segments</system:String>
|
|
|
|
<system:String x:Key="str_OmfFileNot">This is not an Apple II OMF file</system:String>
|
2020-06-30 01:29:18 +00:00
|
|
|
|
|
|
|
<system:String x:Key="str_OmfLoaderFail">Unable to prepare data file for project.</system:String>
|
|
|
|
<system:String x:Key="str_OmfConvertSuccessful">Data file and project created.</system:String>
|
2020-06-24 00:21:18 +00:00
|
|
|
</Window.Resources>
|
|
|
|
|
|
|
|
<Grid Margin="8">
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
2020-07-20 20:47:19 +00:00
|
|
|
<RowDefinition Height="Auto"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
<DockPanel Grid.Row="0">
|
|
|
|
<TextBlock DockPanel.Dock="Left" Text="File:" Margin="0,1,0,0"/>
|
2020-06-26 23:58:42 +00:00
|
|
|
<TextBox DockPanel.Dock="Left" IsReadOnly="True" Margin="8,0,0,0" Text="{Binding PathName}"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
</DockPanel>
|
|
|
|
|
2020-06-28 18:56:51 +00:00
|
|
|
<TextBlock Grid.Row="1" Text="{Binding FileSummaryStr, FallbackValue=This be blah with N segments}" Margin="0,8,0,0"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
|
2020-06-26 23:58:42 +00:00
|
|
|
<DataGrid Name="segmentList" Grid.Row="2" Height="210" Margin="0,8,0,0"
|
2020-06-24 00:21:18 +00:00
|
|
|
IsReadOnly="True"
|
|
|
|
ItemsSource="{Binding SegmentListItems}"
|
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
GridLinesVisibility="Vertical"
|
|
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
HeadersVisibility="Column"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
SelectionMode="Single"
|
|
|
|
MouseDoubleClick="SegmentList_MouseDoubleClick">
|
|
|
|
<DataGrid.Resources>
|
|
|
|
<!-- make the no-focus color the same as the in-focus color -->
|
|
|
|
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}"
|
2020-06-26 00:30:44 +00:00
|
|
|
Color="{x:Static SystemColors.HighlightColor}"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}"
|
2020-06-26 00:30:44 +00:00
|
|
|
Color="{x:Static SystemColors.HighlightTextColor}"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
</DataGrid.Resources>
|
|
|
|
<DataGrid.Columns>
|
2020-06-26 00:30:44 +00:00
|
|
|
<DataGridTextColumn Header="SEGNUM" Width="50" Binding="{Binding SegNum}"/>
|
2020-06-26 23:58:42 +00:00
|
|
|
<DataGridTextColumn Header="VER" Width="40" Binding="{Binding Version}"/>
|
|
|
|
<DataGridTextColumn Header="KIND" Width="100" Binding="{Binding Kind}"/>
|
|
|
|
<DataGridTextColumn Header="LOADNAME" Width="80" Binding="{Binding LoadName}"/>
|
|
|
|
<DataGridTextColumn Header="SEGNAME" Width="130" Binding="{Binding SegName}"/>
|
|
|
|
<DataGridTextColumn Header="LENGTH" Width="80" Binding="{Binding Length}"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
2020-06-28 01:06:26 +00:00
|
|
|
<TextBlock Grid.Row="3" Text="Notes and error messages:" Margin="0,8,0,0"/>
|
2020-06-26 00:30:44 +00:00
|
|
|
<TextBox Grid.Row="4" Margin="0,4,0,0" Height="60"
|
2020-06-26 23:58:42 +00:00
|
|
|
Text="{Binding MessageStrings}"
|
2020-06-24 00:21:18 +00:00
|
|
|
IsReadOnly="True" VerticalScrollBarVisibility="Auto">
|
|
|
|
</TextBox>
|
|
|
|
|
2020-07-20 20:47:19 +00:00
|
|
|
<GroupBox Grid.Row="5" Header="Generate SourceGen Project" Padding="2,0" Margin="0,8,0,0">
|
|
|
|
<StackPanel>
|
|
|
|
<CheckBox Content="Offset segment start by $0100" Margin="0,4,0,0"
|
|
|
|
IsChecked="{Binding OffsetSegmentStart}"/>
|
|
|
|
<CheckBox Content="Add comments and notes for each segment" Margin="0,4,0,0"
|
|
|
|
IsChecked="{Binding AddNotes}"/>
|
|
|
|
<Button Content="Generate" Width="100" Margin="0,8" HorizontalAlignment="Left"
|
|
|
|
IsEnabled="{Binding IsLoadFile}" Click="GenerateProject_Click"/>
|
|
|
|
</StackPanel>
|
|
|
|
</GroupBox>
|
|
|
|
|
|
|
|
<DockPanel Grid.Row="6" LastChildFill="False" Margin="0,16,0,0">
|
|
|
|
<Button DockPanel.Dock="Right" Content="Close" Width="70" IsCancel="True"/>
|
2020-06-24 00:21:18 +00:00
|
|
|
</DockPanel>
|
|
|
|
</Grid>
|
|
|
|
</Window>
|