-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added mountain and valley fold settings - Fixed .net compatibilty bugs - Added borders on saved svg images
- Loading branch information
1 parent
aaf9782
commit 5cfc31f
Showing
12 changed files
with
285 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Window xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Class="Flagstone_Tessellation___Molecule_construction.Settings" | ||
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:Flagstone_Tessellation___Molecule_construction" | ||
mc:Ignorable="d" | ||
Title="OriFlagTess :: Settings" ResizeMode="NoResize" SizeToContent="WidthAndHeight" | ||
WindowStartupLocation="CenterScreen"> | ||
<Grid x:Name="settingsGrid"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="60" /> | ||
</Grid.RowDefinitions> | ||
<GroupBox Header="Settings" Grid.Row="0" Grid.Column="0" Margin="10,10,10,0" Padding="10,10,10,10"> | ||
<Grid x:Name="parametersGrid" Margin="10,10,10,10"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="40" /> | ||
<RowDefinition Height="40" /> | ||
</Grid.RowDefinitions> | ||
<Label Content="MountainFold" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right"/> | ||
<ComboBox x:Name="mountainFoldComboBox" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Height="30" Width="200" FontWeight="Bold" FontSize="16" SelectionChanged="mountainFoldComboBox_SelectionChanged"/> | ||
<Label Content="ValleyFold" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right"/> | ||
<ComboBox x:Name="valleyFoldComboBox" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Height="30" Width="200" FontWeight="Bold" FontSize="16" SelectionChanged="valleyFoldComboBox_SelectionChanged"/> | ||
<xctk:ColorPicker x:Name="mountainFoldColorPicker" Grid.Row="0" Grid.Column="2" Height="30" Margin="10,0,0,0" SelectedColorChanged="mountainFoldColorPicker_SelectedColorChanged"/> | ||
<xctk:ColorPicker x:Name="valleyFoldColorPicker" Grid.Row="1" Grid.Column="2" Height="30" Margin="10,0,0,0" SelectedColorChanged="valleyFoldColorPicker_SelectedColorChanged"/> | ||
</Grid> | ||
</GroupBox> | ||
<Button x:Name="OK" Grid.Row="2" Grid.ColumnSpan="2" Width="75" Height="40" Content="OK" HorizontalAlignment="Center" ToolTip="Close settings" Click="OK_Click"/> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace Flagstone_Tessellation___Molecule_construction | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Settings.xaml | ||
/// </summary> | ||
public partial class Settings : Window | ||
{ | ||
public Settings() | ||
{ | ||
InitializeComponent(); | ||
this.mountainFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25 }); | ||
this.mountainFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25, StrokeDashArray = Utils.toDashArrayPattern(1) }); | ||
this.mountainFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25, StrokeDashArray = Utils.toDashArrayPattern(2) }); | ||
this.mountainFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25, StrokeDashArray = Utils.toDashArrayPattern(3) }); | ||
this.valleyFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25 }); | ||
this.valleyFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25, StrokeDashArray = Utils.toDashArrayPattern(1) }); | ||
this.valleyFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25, StrokeDashArray = Utils.toDashArrayPattern(2) }); | ||
this.valleyFoldComboBox.Items.Add(new Line { X1 = 1, X2 = 200, Y1 = 10, Y2 = 10, Stroke = Brushes.Black, StrokeThickness = 1, Height = 25, StrokeDashArray = Utils.toDashArrayPattern(3) }); | ||
this.mountainFoldComboBox.SelectedIndex = int.Parse(System.Configuration.ConfigurationManager.AppSettings["mountainFold"]); | ||
this.valleyFoldComboBox.SelectedIndex = int.Parse(System.Configuration.ConfigurationManager.AppSettings["valleyFold"]); | ||
var mountainFoldHtmlColor = System.Configuration.ConfigurationManager.AppSettings["mountainFoldColor"]; | ||
this.mountainFoldColorPicker.SelectedColor = ((SolidColorBrush)new BrushConverter().ConvertFromString(mountainFoldHtmlColor)).Color; | ||
var valleyFoldHtmlColor = System.Configuration.ConfigurationManager.AppSettings["valleyFoldColor"]; | ||
this.valleyFoldColorPicker.SelectedColor = ((SolidColorBrush)new BrushConverter().ConvertFromString(valleyFoldHtmlColor)).Color; | ||
} | ||
|
||
private void OK_Click(object sender, RoutedEventArgs e) | ||
{ | ||
this.Close(); | ||
} | ||
|
||
private void mountainFoldComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | ||
config.AppSettings.Settings["mountainFold"].Value = "" + this.mountainFoldComboBox.SelectedIndex; | ||
config.Save(ConfigurationSaveMode.Modified); | ||
ConfigurationManager.RefreshSection("appSettings"); | ||
} | ||
|
||
private void valleyFoldComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | ||
config.AppSettings.Settings["valleyFold"].Value = "" + this.valleyFoldComboBox.SelectedIndex; | ||
config.Save(ConfigurationSaveMode.Modified); | ||
ConfigurationManager.RefreshSection("appSettings"); | ||
} | ||
|
||
private void mountainFoldColorPicker_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e) | ||
{ | ||
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | ||
config.AppSettings.Settings["mountainFoldColor"].Value = "" + this.mountainFoldColorPicker.SelectedColor.ToString(); | ||
config.Save(ConfigurationSaveMode.Modified); | ||
ConfigurationManager.RefreshSection("appSettings"); | ||
} | ||
|
||
private void valleyFoldColorPicker_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e) | ||
{ | ||
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | ||
config.AppSettings.Settings["valleyFoldColor"].Value = "" + this.valleyFoldColorPicker.SelectedColor.ToString(); | ||
config.Save(ConfigurationSaveMode.Modified); | ||
ConfigurationManager.RefreshSection("appSettings"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.