2019-07-05 21:53:45 +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.EditDefSymbol"
|
2019-07-05 21:53:45 +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"
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
2019-07-20 20:28:10 +00:00
|
|
|
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
2019-07-05 21:53:45 +00:00
|
|
|
mc:Ignorable="d"
|
|
|
|
Title="Edit Symbol"
|
2019-10-27 19:26:34 +00:00
|
|
|
SizeToContent="Height" Width="360" ResizeMode="NoResize"
|
2019-07-05 21:53:45 +00:00
|
|
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
2019-09-15 00:48:54 +00:00
|
|
|
Loaded="Window_Loaded"
|
|
|
|
ContentRendered="Window_ContentRendered">
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
|
|
|
|
<Window.Resources>
|
2019-10-15 23:37:14 +00:00
|
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
|
|
|
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
<system:String x:Key="str_WidthLimitFmt">• Decimal or hex value, 1-{0}</system:String>
|
2021-10-18 01:02:29 +00:00
|
|
|
<system:String x:Key="str_ProjectConstant">_Constant</system:String>
|
|
|
|
<system:String x:Key="str_VariableConstant">Stack-Relative _Offset</system:String>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
</Window.Resources>
|
|
|
|
|
2019-07-05 21:53:45 +00:00
|
|
|
<Grid Margin="8">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
2019-08-26 00:25:15 +00:00
|
|
|
<RowDefinition Height="Auto"/>
|
2019-10-15 23:37:14 +00:00
|
|
|
<RowDefinition Height="Auto"/>
|
2019-07-05 21:53:45 +00:00
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Grid.Column="0" Grid.Row="0" Margin="0,0,8,0">Symbol type:</TextBlock>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Margin="0,1,0,12"
|
|
|
|
IsEnabled="{Binding NotReadOnlyValueAndType}">
|
2021-10-18 01:02:29 +00:00
|
|
|
<RadioButton Content="_Address" GroupName="Type" Margin="0,0,0,0" IsChecked="{Binding IsAddress}"/>
|
2019-10-15 23:37:14 +00:00
|
|
|
<RadioButton Content="{Binding ConstantLabel, FallbackValue=Constant}" Margin="8,0,0,0"
|
|
|
|
GroupName="Type" IsChecked="{Binding IsConstant}"/>
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<TextBlock Grid.Column="0" Grid.Row="1" Text="Label:"/>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="1" Margin="0,0,0,16">
|
2019-08-26 00:25:15 +00:00
|
|
|
<TextBox Name="labelTextBox" Margin="0,1,0,0" Text="{Binding Label, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"/>
|
2019-07-05 21:53:45 +00:00
|
|
|
<TextBlock Name="labelNotesLabel" Text="• 2+ alphanumerics, starting with letter" Margin="0,4,0,0"/>
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Name="projectLabelUniqueLabel" Text="• Unique among project symbols" Margin="0,4,0,0"
|
|
|
|
Visibility="{Binding IsNotVariable, Converter={StaticResource BoolToVis}}"/>
|
|
|
|
<TextBlock Name="labelUniqueLabel" Text="• Unique" Margin="0,4,0,0"
|
|
|
|
Visibility="{Binding IsVariable, Converter={StaticResource BoolToVis}}"/>
|
2019-07-05 21:53:45 +00:00
|
|
|
</StackPanel>
|
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Grid.Column="0" Grid.Row="2" Text="Value:"/>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="2" VerticalAlignment="Top" Margin="0,0,0,16">
|
2020-04-23 17:42:54 +00:00
|
|
|
<TextBox Name="valueTextBox" Margin="0,1,0,0" Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}"
|
Instruction operand editor rework, part 2
Implemented local variable editing. Operands that have a local
variable reference, or are eligible to have one, can now be edited
directly from the instruction operand edit dialog.
Also, updated the code list double-click handler so that, if you
double-click on the opcode of an instruction that uses a local
variable reference, the selection and view will jump to the place
where that variable was defined.
Also, tweaked the way the References window refers to references
to an address that didn't use a symbol at that address. Updated
the explanation in the manual, which was a bit confusing.
Also, fixed some odds and ends in the manual.
Also, fixed a nasty infinite recursion bug (issue #47).
2019-09-08 01:57:22 +00:00
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
|
|
IsReadOnly="{Binding ReadOnlyValueAndType}"/>
|
2021-07-20 20:08:19 +00:00
|
|
|
<TextBlock Name="varValueRangeLabel" Text="• Value between 0-255, <= 256 with width" Margin="0,4,0,0"
|
2019-10-15 23:37:14 +00:00
|
|
|
Visibility="{Binding IsVariable, Converter={StaticResource BoolToVis}}"/>
|
2019-10-27 19:26:34 +00:00
|
|
|
<TextBlock Name="addrValueRangeLabel" Text="• Address between 00/0000 - ff/ffff, incl. width" Margin="0,4,0,0"
|
|
|
|
Visibility="{Binding IsNotVariable, Converter={StaticResource BoolToVis}}"/>
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Name="varValueUniqueLabel" Text="• Values in table must not overlap" Margin="0,4,0,0"
|
|
|
|
Visibility="{Binding IsVariable, Converter={StaticResource BoolToVis}}"/>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
<TextBlock Name="valueNotesLabel" Text="• Decimal, hex ($), or binary (%)" Margin="0,4,0,0"/>
|
2019-07-05 21:53:45 +00:00
|
|
|
</StackPanel>
|
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Grid.Column="0" Grid.Row="3" Text="Width:"/>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="3" Margin="0,0,0,16">
|
2019-08-26 00:25:15 +00:00
|
|
|
<TextBox Margin="0,1,0,0" Text="{Binding VarWidth, UpdateSourceTrigger=PropertyChanged}"
|
2019-10-15 23:37:14 +00:00
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
|
|
IsEnabled="{Binding IsAddress}"/>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
<TextBlock Name="widthNotesLabel" Margin="0,4,0,0"
|
|
|
|
Text="{Binding WidthLimitLabel, FallbackValue=• Decimal or hex value\, 1-ZZZZZ}"/>
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Name="widthOptionalLabel" Text="• Optional for Address, ignored for Constant" Margin="0,4,0,0"
|
|
|
|
Visibility="{Binding IsNotVariable, Converter={StaticResource BoolToVis}}"/>
|
2019-08-26 00:25:15 +00:00
|
|
|
</StackPanel>
|
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Grid.Column="0" Grid.Row="4" Text="Comment:" Margin="0,0,8,0"/>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="4" Margin="0,0,0,16">
|
2020-04-23 17:42:54 +00:00
|
|
|
<TextBox Name="commentTextBox" Margin="0,1,0,0" Text="{Binding Comment, UpdateSourceTrigger=PropertyChanged}"
|
2019-09-19 01:11:48 +00:00
|
|
|
FontFamily="{StaticResource GeneralMonoFont}" ScrollViewer.CanContentScroll="True"/>
|
Allow explicit widths in project/platform symbols, part 1
The ability to give explicit widths to local variables worked out
pretty well, so we're going to try adding the same thing to project
and platform symbols.
The first step is to allow widths to be specified in platform files,
and set with the project symbol editor. The DefSymbol editor is
also used for local variables, so a bit of dancing is required.
For platform/project symbols the width is optional, and is totally
ignored for constants. (For variables, constants are used for the
StackRel args, so the width is meaningful and required.)
We also now show the symbol's type (address or constant) and width
in the listing. This gets really distracting when overused, so we
only show it when the width is explicitly set. The default width
is 1, which most things will be, so users can make an aesthetic
choice there. (The place where widths make very little sense is when
the symbol represents a code entry point, rather than a data item.)
The maximum width of a local variable is now 256, but it's not
allowed to overlap with other variables or run of the end of the
direct page. The maximum width of a platform/project symbol is
65536, with bank-wrap behavior TBD.
The local variable table editor now refers to stack-relative
constants as such, rather than simply "constant", to make it clear
that it's not just defining an 8-bit constant.
Widths have been added to a handful of Apple II platform defs.
2019-10-01 21:58:24 +00:00
|
|
|
<TextBlock Text="• Optional" Margin="0,4,0,0"/>
|
2019-07-05 21:53:45 +00:00
|
|
|
</StackPanel>
|
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Grid.Column="0" Grid.Row="5"
|
|
|
|
Visibility="{Binding IsNotVariable, Converter={StaticResource BoolToVis}}"
|
|
|
|
Text="Access:"/>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="5" Margin="0,0,0,4"
|
|
|
|
Visibility="{Binding IsNotVariable, Converter={StaticResource BoolToVis}}">
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,1,0,0"
|
|
|
|
IsEnabled="{Binding IsAddress}">
|
|
|
|
<CheckBox Content="Read" Margin="0,0,0,0" IsChecked="{Binding IsReadChecked}"/>
|
|
|
|
<CheckBox Content="Write" Margin="24,0,0,0" IsChecked="{Binding IsWriteChecked}"/>
|
2019-07-05 21:53:45 +00:00
|
|
|
</StackPanel>
|
2019-10-15 23:37:14 +00:00
|
|
|
<TextBlock Name="checkReadWriteLabel" Text="• Check one or both for Address" Margin="0,4,0,0"/>
|
|
|
|
</StackPanel>
|
2019-07-05 21:53:45 +00:00
|
|
|
|
2019-10-15 23:37:14 +00:00
|
|
|
<StackPanel Grid.Column="1" Grid.Row="6" Margin="0,16,0,0"
|
2019-07-05 21:53:45 +00:00
|
|
|
Orientation="Horizontal" HorizontalAlignment="Right">
|
|
|
|
<Button Content="OK" Width="70" IsDefault="True" IsEnabled="{Binding IsValid}"
|
|
|
|
Click="OkButton_Click"/>
|
|
|
|
<Button Content="Cancel" Width="70" IsCancel="True" Margin="8,0,0,0"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Window>
|