1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-12 06:06:12 +00:00
6502bench/SourceGen/WpfGui/EditInstructionOperand.xaml
Andy McFadden 7bbe5692bd Add C64 encodings to instruction and data operand editors
Both dialogs got a couple extra radio buttons for selection of
single character operands.  The data operand editor got a combo box
that lets you specify how it scans for viable strings.

Various string scanning methods were made more generic.  This got a
little strange with auto-detection of low/high ASCII, but that was
mostly a matter of keeping the previous code around as a special
case.

Made C64 Screen Code DCI strings a thing that works.
2019-08-15 17:53:12 -07:00

98 lines
5.3 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.WpfGui.EditInstructionOperand"
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.WpfGui"
mc:Ignorable="d"
Title="Edit Instruction Operand"
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
Loaded="Window_Loaded"
ContentRendered="Window_ContentRendered">
<StackPanel Margin="8">
<TextBlock Text="Select operand format:"/>
<RadioButton Name="defaultButton" GroupName="Format" Content="Default" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="hexButton" GroupName="Format" Content="Hexadecimal" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="decimalButton" GroupName="Format" Content="Decimal" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="binaryButton" GroupName="Format" Content="Binary" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="asciiButton" GroupName="Format" Content="ASCII (low or high) character" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="petsciiButton" GroupName="Format" Content="C64 PETSCII character" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="screenCodeButton" GroupName="Format" Content="C64 Screen character" Margin="0,2,0,0"
Checked="MainGroup_CheckedChanged"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<RadioButton Name="symbolButton" Grid.Column="0" Grid.Row="0" Margin="0,2,0,0"
GroupName="Format" Content="Symbol"
Checked="MainGroup_CheckedChanged"/>
<TextBox Name="symbolTextBox" Grid.Column="1" Grid.Row="0" Margin="8,1,0,0"
FontFamily="{StaticResource GeneralMonoFont}" TextChanged="SymbolTextBox_TextChanged"/>
<StackPanel Name="symbolPartPanel" Grid.Column="1" Grid.Row="1" Orientation="Horizontal" Margin="8,4,0,0">
<RadioButton Name="lowButton" GroupName="Part" Content="Low"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="highButton" GroupName="Part" Content="High" Margin="8,0,0,0"
Checked="MainGroup_CheckedChanged"/>
<RadioButton Name="bankButton" GroupName="Part" Content="Bank" Margin="8,0,0,0"
Checked="MainGroup_CheckedChanged"/>
</StackPanel>
</Grid>
<DockPanel Margin="0,8,0,0">
<TextBlock DockPanel.Dock="Left" Text="Preview:"/>
<TextBox Name="previewTextBox" DockPanel.Dock="Right" IsReadOnly="True" Margin="8,1,0,0"
FontFamily="{StaticResource GeneralMonoFont}"/>
</DockPanel>
<GroupBox Name="symbolShortcutsGroupBox" Header="Symbol Shortcuts" Margin="0,12,0,0">
<StackPanel>
<RadioButton Name="operandOnlyButton" GroupName="Shortcut" Margin="0,2,0,0"
Content="_Just set the operand (default)"/>
<RadioButton Name="labelInsteadButton" GroupName="Shortcut" Margin="0,2,0,0"
Content="_Create label at target address instead"/>
<RadioButton Name="operandAndLabelButton" GroupName="Shortcut" Margin="0,2,0,0"
Content="Set _operand AND create label at target address"/>
<RadioButton Name="operandAndProjButton" GroupName="Shortcut" Margin="0,2,0,0"
Content="Set operand AND create _project symbol"/>
</StackPanel>
</GroupBox>
<StackPanel 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>
</StackPanel>
</Window>