1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-09-10 13:54:52 +00:00
6502bench/SourceGen/WpfGui/EditLabel.xaml
Andy McFadden 5dd7576529 Label rework, part 2
Continue development of non-unique labels.  The actual labels are
still unique, because we append a uniquifier tag, which gets added
and removed behind the scenes.  We're currently using the six-digit
hex file offset because this is only used for internal address
symbols.

The label editor and most of the formatters have been updated.  We
can't yet assemble code that includes non-unique labels, but older
stuff hasn't been broken.

This removes the "disable label localization" property, since that's
fundamentally incompatible with what we're doing, and adds a non-
unique label prefix setting so you can put '@' or ':' in front of
your should-be-local labels.

Also, fixed a field name typo.
2019-11-12 17:44:51 -08:00

79 lines
3.9 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.EditLabel"
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="Edit Label"
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
Loaded="Window_Loaded"
ContentRendered="Window_ContentRendered">
<Window.Resources>
<system:String x:Key="str_NonUniqueLocalFmt">_Non-unique local ('{0}')</system:String>
</Window.Resources>
<Grid Margin="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2">
<TextBlock Text="Enter label:"/>
<TextBox Name="labelTextBox" Margin="0,2,0,0" FontFamily="{StaticResource GeneralMonoFont}"
Text="{Binding LabelText, UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Name="maxLengthLabel" Text="• Must be 2-32 characters long (or blank to remove)"
Margin="0,7,0,0"/>
<TextBlock Name="firstLetterLabel" Text="• Must start with a letter or underscore"/>
<TextBlock Name="validCharsLabel" Text="• Valid characters are ASCII letters, numbers, and underscore"/>
<TextBlock Name="notDuplicateLabel" Text="• Must not be a duplicate of an existing label"/>
</StackPanel>
<GroupBox Grid.Column="0" Grid.Row="1" Header="Label Type" Padding="2,4" Margin="0,12,0,0">
<StackPanel>
<RadioButton Content="{Binding NonUniqueButtonLabel, FallbackValue=_Non-unique local (\'!\')}"
IsChecked="{Binding IsNonUniqueChecked}" IsEnabled="{Binding IsNonUniqueEnabled}"/>
<RadioButton Content="_Local (if possible)" Margin="0,4,0,0"
IsChecked="{Binding IsLocalChecked}" IsEnabled="{Binding IsLocalEnabled}"/>
<RadioButton Content="_Global" Margin="0,4,0,0"
IsChecked="{Binding IsGlobalChecked}" IsEnabled="{Binding IsGlobalEnabled}"/>
<RadioButton Content="Global and marked for _export" Margin="0,4,0,0"
IsChecked="{Binding IsExportedChecked}" IsEnabled="{Binding IsExportedEnabled}"/>
</StackPanel>
</GroupBox>
<DockPanel Grid.Column="1" Grid.Row="1" LastChildFill="False">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"
Margin="0,0,0,1">
<Button Content="OK" Width="70" IsDefault="True" Margin="8,0,0,0"
IsEnabled="{Binding IsValid}" Click="OkButton_Click"/>
<Button Content="Cancel" Width="70" IsCancel="True" Margin="4,0,0,0"/>
</StackPanel>
</DockPanel>
</Grid>
</Window>