2019-11-23 04:45:57 +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.EditVisualizationSet"
|
|
|
|
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-12-03 00:38:32 +00:00
|
|
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
2019-11-23 04:45:57 +00:00
|
|
|
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
|
|
|
mc:Ignorable="d"
|
|
|
|
Title="Edit Visualization Set"
|
2019-12-04 23:50:19 +00:00
|
|
|
Width="600" Height="400" ResizeMode="NoResize"
|
2019-11-23 04:45:57 +00:00
|
|
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
2019-12-03 00:38:32 +00:00
|
|
|
Closing="Window_Closing">
|
|
|
|
|
|
|
|
<Window.Resources>
|
|
|
|
<system:String x:Key="str_ConfirmDiscardChanges">Are you sure you wish to discard your changes?</system:String>
|
|
|
|
<system:String x:Key="str_ConfirmDiscardChangesCaption">Discard Changes?</system:String>
|
|
|
|
</Window.Resources>
|
2019-11-23 04:45:57 +00:00
|
|
|
|
|
|
|
<Grid Margin="8">
|
2019-11-25 22:27:38 +00:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
2019-11-23 04:45:57 +00:00
|
|
|
<Grid.RowDefinitions>
|
2019-12-04 23:50:19 +00:00
|
|
|
<RowDefinition Height="Auto"/>
|
2019-11-25 22:27:38 +00:00
|
|
|
<RowDefinition Height="*"/>
|
2019-11-23 04:45:57 +00:00
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
2019-12-04 23:50:19 +00:00
|
|
|
<TextBlock Grid.Row="0" Foreground="Red" Margin="0,0,0,4"
|
|
|
|
Visibility="{Binding ScriptWarningVisible}"
|
|
|
|
Text="NOTE: no extension scripts with visualization generators are loaded"/>
|
|
|
|
|
2019-12-05 02:05:17 +00:00
|
|
|
<DataGrid Name="visualizationGrid" Grid.Column="0" Grid.Row="1" Margin="0,4,4,0"
|
2019-11-25 22:27:38 +00:00
|
|
|
ItemsSource="{Binding VisualizationList}"
|
|
|
|
IsReadOnly="True"
|
|
|
|
FontFamily="{StaticResource GeneralMonoFont}"
|
|
|
|
SnapsToDevicePixels="True"
|
2019-12-03 22:34:45 +00:00
|
|
|
HorizontalGridLinesBrush="#FF7F7F7F"
|
2019-11-25 22:27:38 +00:00
|
|
|
VerticalGridLinesBrush="#FF7F7F7F"
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
HeadersVisibility="Column"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
SelectionMode="Single"
|
|
|
|
SelectionChanged="VisualizationList_SelectionChanged"
|
|
|
|
MouseDoubleClick="VisualizationList_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>
|
2019-12-03 22:34:45 +00:00
|
|
|
<!-- ItemsSource is a list of Visualization -->
|
2019-11-25 22:27:38 +00:00
|
|
|
<DataGrid.Columns>
|
2019-12-03 22:34:45 +00:00
|
|
|
<DataGridTemplateColumn Header="Img" Width="56">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Border BorderThickness="0" Background="{StaticResource BitmapBackground}">
|
2019-12-25 18:07:42 +00:00
|
|
|
<Grid>
|
|
|
|
<Image Source="{Binding CachedImage}" Width="48" Height="48"
|
|
|
|
RenderOptions.BitmapScalingMode="NearestNeighbor"/>
|
|
|
|
<Image Source="{Binding OverlayImage}" Width="48" Height="48"/>
|
|
|
|
</Grid>
|
2019-12-03 22:34:45 +00:00
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
2019-12-05 02:05:17 +00:00
|
|
|
<DataGridTextColumn Header="Tag" Width="176" Binding="{Binding Tag}"/>
|
|
|
|
<DataGridTextColumn Header="Visualization Generator" Width="210" Binding="{Binding VisGenIdent}"/>
|
2019-11-25 22:27:38 +00:00
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
2019-11-23 04:45:57 +00:00
|
|
|
|
2019-12-04 23:50:19 +00:00
|
|
|
<StackPanel Grid.Column="1" Grid.Row="1">
|
2019-12-23 00:56:57 +00:00
|
|
|
<Button Width="110" Height="36" Margin="4" Content="_New Bitmap..."
|
2019-12-18 00:40:27 +00:00
|
|
|
IsEnabled="{Binding HasVisPlugins}" Click="NewBitmapButton_Click"/>
|
|
|
|
<Button Width="110" Margin="4" Content="_New Bitmap
Animation..."
|
|
|
|
Click="NewBitmapAnimationButton_Click"/>
|
2019-12-04 23:50:19 +00:00
|
|
|
|
|
|
|
<Button Width="110" Margin="4,20,4,4" Content="_Edit..."
|
2019-12-03 00:38:32 +00:00
|
|
|
IsEnabled="{Binding IsEditEnabled}" Click="EditButton_Click"/>
|
2019-12-04 23:50:19 +00:00
|
|
|
<Button Width="110" Margin="4" Content="_Remove"
|
2019-12-03 00:38:32 +00:00
|
|
|
IsEnabled="{Binding IsRemoveEnabled}" Click="RemoveButton_Click"/>
|
2019-11-25 22:27:38 +00:00
|
|
|
|
2019-12-04 23:50:19 +00:00
|
|
|
<Button Width="110" Margin="4,20,4,4" Content="_Up"
|
2019-12-03 00:38:32 +00:00
|
|
|
IsEnabled="{Binding IsUpEnabled}" Click="UpButton_Click"/>
|
2019-12-04 23:50:19 +00:00
|
|
|
<Button Width="110" Margin="4,4" Content="_Down"
|
2019-12-03 00:38:32 +00:00
|
|
|
IsEnabled="{Binding IsDownEnabled}" Click="DownButton_Click"/>
|
2019-11-25 22:27:38 +00:00
|
|
|
</StackPanel>
|
|
|
|
|
2019-12-04 23:50:19 +00:00
|
|
|
<DockPanel Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Margin="0,8,0,0" LastChildFill="False">
|
2019-11-23 04:45:57 +00:00
|
|
|
<Button DockPanel.Dock="Right" Content="Cancel" Width="70" Margin="8,0,0,0" IsCancel="True"/>
|
2019-12-07 01:19:27 +00:00
|
|
|
<Button DockPanel.Dock="Right" Name="okButton" Grid.Column="1" Content="OK" Width="70"
|
2019-11-23 04:45:57 +00:00
|
|
|
IsDefault="True" Click="OkButton_Click"/>
|
|
|
|
</DockPanel>
|
|
|
|
</Grid>
|
|
|
|
</Window>
|