2019-07-13 20:31:51 +00:00
|
|
|
<!--
|
|
|
|
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.
|
|
|
|
-->
|
|
|
|
|
2019-07-20 20:28:10 +00:00
|
|
|
<Window x:Class="SourceGen.WpfGui.FormatSplitAddress"
|
2019-07-13 20:31:51 +00:00
|
|
|
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"
|
2019-07-20 20:28:10 +00:00
|
|
|
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
2019-07-13 20:31:51 +00:00
|
|
|
mc:Ignorable="d"
|
|
|
|
Title="Format Split-Address Table"
|
|
|
|
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
|
|
|
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
|
|
|
Loaded="Window_Loaded">
|
|
|
|
|
|
|
|
<Window.Resources>
|
2019-07-13 22:50:11 +00:00
|
|
|
<system:String x:Key="str_SingleByte">Only one byte is selected!</system:String>
|
|
|
|
<system:String x:Key="str_SingleGroup">There are {0} bytes selected.</system:String>
|
|
|
|
<system:String x:Key="str_MultiGroup">There are {0} bytes selected, across {1} groups.</system:String>
|
|
|
|
|
|
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
</Window.Resources>
|
|
|
|
|
|
|
|
<Grid Margin="8">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
2019-07-13 22:50:11 +00:00
|
|
|
<TextBlock Name="selectionInfoLabel" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"
|
2019-07-13 20:31:51 +00:00
|
|
|
Text="{StaticResource str_MultiGroup}"/>
|
|
|
|
|
|
|
|
<StackPanel Grid.Column="0" Grid.Row="1" Margin="0,8,8,0">
|
|
|
|
<GroupBox Header="Address Characteristics">
|
|
|
|
<StackPanel>
|
|
|
|
<RadioButton Name="width16Radio" GroupName="Addr" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="16-bit" Checked="WidthRadio_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<RadioButton Name="width24Radio" GroupName="Addr" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="24-bit" Checked="WidthRadio_CheckedChanged"/>
|
|
|
|
<CheckBox Margin="0,4,0,0" Content="Adjusted for RTS/RTL (target - 1)"
|
|
|
|
IsChecked="{Binding AdjustedForReturn}"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
</StackPanel>
|
|
|
|
</GroupBox>
|
|
|
|
|
2019-07-13 22:50:11 +00:00
|
|
|
<GroupBox Header="Low Byte Source">
|
2019-07-13 20:31:51 +00:00
|
|
|
<StackPanel>
|
|
|
|
<RadioButton Name="lowFirstPartRadio" GroupName="Low" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="First part of selection"
|
|
|
|
Checked="LowByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<RadioButton Name="lowSecondPartRadio" GroupName="Low" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Second part of selection"
|
|
|
|
Checked="LowByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<RadioButton Name="lowThirdPartRadio" GroupName="Low" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Third part of selection"
|
|
|
|
IsEnabled="{Binding ElementName=width24Radio, Path=IsChecked}"
|
|
|
|
Checked="LowByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
</StackPanel>
|
|
|
|
</GroupBox>
|
|
|
|
|
2019-07-13 22:50:11 +00:00
|
|
|
<GroupBox Header="High Byte Source">
|
2019-07-13 20:31:51 +00:00
|
|
|
<StackPanel>
|
|
|
|
<RadioButton Name="highFirstPartRadio" GroupName="High" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="First part of selection"
|
|
|
|
Checked="HighByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<RadioButton Name="highSecondPartRadio" GroupName="High" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Second part of selection"
|
|
|
|
Checked="HighByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<RadioButton Name="highThirdPartRadio" GroupName="High" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Third part of selection"
|
|
|
|
IsEnabled="{Binding ElementName=width24Radio, Path=IsChecked}"
|
|
|
|
Checked="HighByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<RadioButton Name="highConstantRadio" GroupName="High" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Constant:" Checked="HighByte_CheckedChanged"/>
|
|
|
|
<TextBox Name="highConstantTextBox" Width="100" Margin="8,2,0,0"
|
|
|
|
TextChanged="HighConstantTextBox_TextChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</GroupBox>
|
|
|
|
|
2019-07-13 22:50:11 +00:00
|
|
|
<GroupBox Header="Bank Byte Source">
|
|
|
|
<StackPanel IsEnabled="{Binding ElementName=width24Radio, Path=IsChecked}">
|
2019-07-13 20:31:51 +00:00
|
|
|
<RadioButton Name="bankNthPartRadio" GroupName="Bank" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Nth part of selection"
|
|
|
|
Checked="BankByte_CheckedChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<RadioButton Name="bankConstantRadio" GroupName="Bank" Margin="0,4,0,0"
|
2019-07-13 22:50:11 +00:00
|
|
|
Content="Constant:"
|
|
|
|
Checked="BankByte_CheckedChanged"/>
|
|
|
|
<TextBox Name="bankConstantTextBox" Width="100" Margin="8,2,0,0"
|
|
|
|
TextChanged="BankConstantTextBox_TextChanged"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</GroupBox>
|
|
|
|
|
|
|
|
<GroupBox Header="Options">
|
|
|
|
<StackPanel>
|
2019-07-13 22:50:11 +00:00
|
|
|
<CheckBox Content="Add code entry hint if needed" Margin="0,4,0,0"
|
|
|
|
IsChecked="{Binding WantCodeHints}"/>
|
2019-07-13 20:31:51 +00:00
|
|
|
</StackPanel>
|
|
|
|
</GroupBox>
|
|
|
|
</StackPanel>
|
|
|
|
|
2019-07-13 22:50:11 +00:00
|
|
|
<Grid Grid.Column="1" Grid.Row="1" Margin="0,8,0,0">
|
|
|
|
<DockPanel>
|
|
|
|
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,0">
|
|
|
|
<Button Name="okButton" Content="OK" IsDefault="True" Width="70"
|
|
|
|
IsEnabled="{Binding IsValid}" Click="OkButton_Click"/>
|
|
|
|
<Button Name="cancelButton" Content="Cancel" IsCancel="True"
|
|
|
|
Width="70" Margin="4,0,0,0"/>
|
|
|
|
</StackPanel>
|
2019-07-13 20:31:51 +00:00
|
|
|
|
2019-07-13 22:50:11 +00:00
|
|
|
<GroupBox DockPanel.Dock="Top" Header="Generated Addresses">
|
|
|
|
<!-- We're currently auto-sizing everything outside this, so the width of
|
|
|
|
the columns determines the width of the window. Resizing the columns resizes
|
|
|
|
the window, even though the window isn't resizeable. "It's a feature." -->
|
|
|
|
<DataGrid Name="outputPreviewList"
|
|
|
|
Margin="0,2,0,0"
|
|
|
|
Height="318"
|
|
|
|
IsReadOnly="True"
|
|
|
|
ItemsSource="{Binding OutputPreviewList}"
|
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
GridLinesVisibility="Vertical"
|
|
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
HeadersVisibility="Column"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
SelectionMode="Single">
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTextColumn Header="Addr" Width="60" Binding="{Binding Addr}"/>
|
|
|
|
<DataGridTextColumn Header="Offset" Width="60" Binding="{Binding Offset}"/>
|
|
|
|
<DataGridTextColumn Header="Symbol" Width="180" Binding="{Binding Symbol}"/>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
</GroupBox>
|
|
|
|
</DockPanel>
|
|
|
|
|
|
|
|
<TextBlock Name="incompatibleSelectionLabel"
|
|
|
|
VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-20,0,0"
|
|
|
|
Text="Options incompatible with selection" FontSize="16" Foreground="Red"
|
|
|
|
Visibility="{Binding IncompatibleSelectionVisibility, Converter={StaticResource BoolToVis}}"/>
|
|
|
|
<TextBlock Name="invalidConstantLabel"
|
|
|
|
VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,20,0,0"
|
|
|
|
Text="Invalid constant" FontSize="16" Foreground="Red"
|
|
|
|
Visibility="{Binding InvalidConstantVisibility, Converter={StaticResource BoolToVis}}"/>
|
|
|
|
</Grid>
|
2019-07-13 20:31:51 +00:00
|
|
|
</Grid>
|
|
|
|
</Window>
|