2019-08-25 21:14:44 +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.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<Window x:Class="SourceGen.WpfGui.EditLocalVariableTable"
|
|
|
|
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"
|
2019-08-26 23:58:53 +00:00
|
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
2019-08-25 21:14:44 +00:00
|
|
|
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
|
|
|
mc:Ignorable="d"
|
|
|
|
Title="Edit Local Variable Table"
|
|
|
|
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
|
|
|
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
2020-08-28 00:09:18 +00:00
|
|
|
Loaded="Window_Loaded"
|
|
|
|
PreviewKeyDown="Window_KeyEventHandler">
|
2019-08-26 23:58:53 +00:00
|
|
|
|
|
|
|
<Window.Resources>
|
|
|
|
<system:String x:Key="str_ConfirmDelete">Are you sure you want to delete the entire table?</system:String>
|
|
|
|
<system:String x:Key="str_ConfirmDeleteCaption">Confirm Deletion</system:String>
|
2019-09-19 22:53:23 +00:00
|
|
|
<system:String x:Key="str_TableHeaderFmt">Symbols defined in table at {0}:</system:String>
|
2019-08-26 23:58:53 +00:00
|
|
|
</Window.Resources>
|
|
|
|
|
2019-08-25 21:14:44 +00:00
|
|
|
<Grid Margin="8">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
2019-09-19 22:53:23 +00:00
|
|
|
<TextBlock Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,4,0,0"
|
|
|
|
Text="{Binding TableHeaderText, FallbackValue=Symbols defined in table at +######:}"/>
|
2019-08-25 21:14:44 +00:00
|
|
|
|
2019-10-02 01:20:51 +00:00
|
|
|
<DataGrid Name="symbolsList" Grid.Column="0" Grid.Row="1" Margin="0,4,4,0"
|
|
|
|
Width="582" Height="300"
|
2019-08-25 21:14:44 +00:00
|
|
|
ItemsSource="{Binding Variables}"
|
2019-10-02 01:20:51 +00:00
|
|
|
IsReadOnly="True"
|
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
GridLinesVisibility="Vertical"
|
|
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
HeadersVisibility="Column"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
SelectionMode="Single"
|
|
|
|
SelectionChanged="SymbolsList_SelectionChanged"
|
|
|
|
Sorting="SymbolsList_Sorting"
|
|
|
|
MouseDoubleClick="SymbolsList_MouseDoubleClick">
|
|
|
|
<DataGrid.Resources>
|
|
|
|
<!-- make the no-focus color the same as the in-focus color -->
|
|
|
|
<!-- thanks: https://stackoverflow.com/a/13053511/294248 -->
|
|
|
|
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}"
|
|
|
|
Color="{x:Static SystemColors.HighlightColor}"/>
|
|
|
|
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}"
|
|
|
|
Color="{x:Static SystemColors.HighlightTextColor}"/>
|
|
|
|
</DataGrid.Resources>
|
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTextColumn Header="Name" Width="118" Binding="{Binding Label}"/>
|
|
|
|
<DataGridTextColumn Header="Value" Width="72" Binding="{Binding Value}"/>
|
|
|
|
<DataGridTextColumn Header="Type" Width="45" Binding="{Binding Type}"/>
|
|
|
|
<DataGridTextColumn Header="Width" Width="45" Binding="{Binding Width}"/>
|
|
|
|
<DataGridTextColumn Header="Comment" Width="300" Binding="{Binding Comment}"/>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
2019-08-25 21:14:44 +00:00
|
|
|
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="1">
|
|
|
|
<Button Name="newSymbolButton" Width="120" Margin="4" Content="_New Symbol..."
|
|
|
|
Click="NewSymbolButton_Click"/>
|
|
|
|
<Button Name="editSymbolButton" Width="120" Margin="4,4" Content="_Edit Symbol..."
|
|
|
|
Click="EditSymbolButton_Click"/>
|
|
|
|
<Button Name="removeSymbolButton" Width="120" Margin="4,4" Content="_Remove"
|
|
|
|
Click="RemoveSymbolButton_Click"/>
|
|
|
|
</StackPanel>
|
|
|
|
|
2019-08-26 00:25:15 +00:00
|
|
|
<CheckBox Grid.Column="0" Grid.Row="2" Margin="0,4" IsChecked="{Binding ClearPrevious}"
|
2019-08-25 21:14:44 +00:00
|
|
|
Content="Clear values from previous tables"/>
|
|
|
|
|
|
|
|
<DockPanel Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Margin="0,8,0,0" LastChildFill="False">
|
2019-09-01 23:40:54 +00:00
|
|
|
<Button DockPanel.Dock="Left" Content="Delete Table" Width="120"
|
|
|
|
IsEnabled="{Binding IsNotNewTable}" Click="DeleteTableButton_Click"/>
|
|
|
|
<Button DockPanel.Dock="Left" Content="Move Table" Width="120" Margin="8,0,0,0"
|
|
|
|
IsEnabled="{Binding IsNotNewTable}" Click="MoveTableButton_Click"/>
|
2019-08-25 21:14:44 +00:00
|
|
|
<Button DockPanel.Dock="Right" Content="Cancel" Width="70" Margin="8,0,0,0" IsCancel="True"/>
|
|
|
|
<Button DockPanel.Dock="Right" Grid.Column="1" Content="OK" Width="70"
|
|
|
|
IsDefault="True" Click="OkButton_Click"/>
|
|
|
|
</DockPanel>
|
|
|
|
</Grid>
|
|
|
|
</Window>
|