-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic settings window created covering file paths and level max/step. Does hardly any validation. App now remembers window location and size. Closes #5.
- Loading branch information
Showing
19 changed files
with
843 additions
and
79 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<UserControl x:Class="LarkatorGUI.DirectoryEntryBox" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:LarkatorGUI" | ||
mc:Ignorable="d" d:DesignWidth="240" | ||
Margin="0" Padding="0"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
<TextBox Grid.Column="0" MaxLines="1" Text="{Binding Path=Value, Mode=TwoWay}" ToolTip="{Binding Tooltip}" HorizontalContentAlignment="Right"/> | ||
<Button Grid.Column="1" Padding="8,2" Margin="2,0" Click="Browse_Click" ToolTip="Browse...">...</Button> | ||
</Grid> | ||
</UserControl> |
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,76 @@ | ||
using Avalon.Windows.Dialogs; | ||
using Microsoft.Win32; | ||
using System; | ||
using System.Collections.Generic; | ||
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.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace LarkatorGUI | ||
{ | ||
/// <summary> | ||
/// Interaction logic for FileEntryBox.xaml | ||
/// </summary> | ||
public partial class DirectoryEntryBox : UserControl | ||
{ | ||
public string Value | ||
{ | ||
get { return (string)GetValue(ValueProperty); } | ||
set { SetValue(ValueProperty, value); } | ||
} | ||
|
||
public string Title | ||
{ | ||
get { return (string)GetValue(TitleProperty); } | ||
set { SetValue(TitleProperty, value); } | ||
} | ||
|
||
public string Tooltip | ||
{ | ||
get { return (string)GetValue(TooltipProperty); } | ||
set { SetValue(TooltipProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty TooltipProperty = | ||
DependencyProperty.Register("Tooltip", typeof(string), typeof(DirectoryEntryBox), new PropertyMetadata("Enter path to the directory")); | ||
|
||
public static readonly DependencyProperty TitleProperty = | ||
DependencyProperty.Register("Title", typeof(string), typeof(DirectoryEntryBox), new PropertyMetadata("Select directory")); | ||
|
||
public static readonly DependencyProperty ValueProperty = | ||
DependencyProperty.Register("Value", typeof(string), typeof(DirectoryEntryBox), new PropertyMetadata("")); | ||
|
||
public DirectoryEntryBox() | ||
{ | ||
InitializeComponent(); | ||
|
||
DataContext = this; | ||
} | ||
|
||
private void Browse_Click(object sender, RoutedEventArgs e) | ||
{ | ||
var dialog = new FolderBrowserDialog() | ||
{ | ||
RootType = RootType.Path, | ||
ValidateResult = true, | ||
Title = Title, | ||
SelectedPath = Value, | ||
}; | ||
|
||
var result = dialog.ShowDialog(); | ||
if (result == true) | ||
{ | ||
Value = dialog.SelectedPath; | ||
} | ||
} | ||
} | ||
} |
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,17 @@ | ||
<UserControl x:Class="LarkatorGUI.FileEntryBox" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:LarkatorGUI" | ||
mc:Ignorable="d" d:DesignWidth="240" | ||
Margin="0" Padding="0"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
<TextBox Grid.Column="0" MaxLines="1" Text="{Binding Path=Value, Mode=TwoWay}" ToolTip="{Binding Tooltip}" HorizontalContentAlignment="Right"/> | ||
<Button Grid.Column="1" Padding="8,2" Margin="2,0" Click="Browse_Click" ToolTip="Browse...">...</Button> | ||
</Grid> | ||
</UserControl> |
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,99 @@ | ||
using Microsoft.Win32; | ||
using System; | ||
using System.Collections.Generic; | ||
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.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace LarkatorGUI | ||
{ | ||
/// <summary> | ||
/// Interaction logic for FileEntryBox.xaml | ||
/// </summary> | ||
public partial class FileEntryBox : UserControl | ||
{ | ||
|
||
public string Value | ||
{ | ||
get { return (string)GetValue(ValueProperty); } | ||
set { SetValue(ValueProperty, value); } | ||
} | ||
|
||
public string DefaultExt | ||
{ | ||
get { return (string)GetValue(DefaultExtProperty); } | ||
set { SetValue(DefaultExtProperty, value); } | ||
} | ||
|
||
public string Filter | ||
{ | ||
get { return (string)GetValue(FilterProperty); } | ||
set { SetValue(FilterProperty, value); } | ||
} | ||
|
||
public string Title | ||
{ | ||
get { return (string)GetValue(TitleProperty); } | ||
set { SetValue(TitleProperty, value); } | ||
} | ||
|
||
public string Tooltip | ||
{ | ||
get { return (string)GetValue(TooltipProperty); } | ||
set { SetValue(TooltipProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty TooltipProperty = | ||
DependencyProperty.Register("Tooltip", typeof(string), typeof(FileEntryBox), new PropertyMetadata("Enter path to the file")); | ||
|
||
public static readonly DependencyProperty TitleProperty = | ||
DependencyProperty.Register("Title", typeof(string), typeof(FileEntryBox), new PropertyMetadata("Select file")); | ||
|
||
public static readonly DependencyProperty FilterProperty = | ||
DependencyProperty.Register("Filter", typeof(string), typeof(FileEntryBox), new PropertyMetadata("All files|*.*")); | ||
|
||
public static readonly DependencyProperty DefaultExtProperty = | ||
DependencyProperty.Register("DefaultExt", typeof(string), typeof(FileEntryBox), new PropertyMetadata("")); | ||
|
||
public static readonly DependencyProperty ValueProperty = | ||
DependencyProperty.Register("Value", typeof(string), typeof(FileEntryBox), new PropertyMetadata("")); | ||
|
||
public FileEntryBox() | ||
{ | ||
InitializeComponent(); | ||
|
||
DataContext = this; | ||
} | ||
|
||
private void Browse_Click(object sender, RoutedEventArgs e) | ||
{ | ||
var dialog = new OpenFileDialog() | ||
{ | ||
AddExtension = true, | ||
CheckFileExists = true, | ||
CheckPathExists = true, | ||
DefaultExt = DefaultExt, | ||
DereferenceLinks = true, | ||
Filter = Filter, | ||
Multiselect = false, | ||
Title = Title, | ||
FileName = Value, | ||
}; | ||
|
||
var result = dialog.ShowDialog(); | ||
if (result == true) | ||
{ | ||
Value = dialog.FileName; | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.