Dialog for entering wildcard mask.

This commit is contained in:
morkt 2015-08-03 22:44:14 +04:00
parent 3a293baeea
commit 81773a8137
2 changed files with 44 additions and 0 deletions

17
EnterMaskDialog.xaml Normal file
View File

@ -0,0 +1,17 @@
<Window x:Class="GARbro.GUI.EnterMaskDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:ctl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
Title="{x:Static s:guiStrings.TextSelectFiles}" SizeToContent="WidthAndHeight" ShowInTaskbar="False"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
<StackPanel Orientation="Vertical" Margin="10">
<TextBlock Text="{x:Static s:guiStrings.LabelEnterMask}"/>
<TextBox Name="Mask"/>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Button Width="75" Height="25" Content="{x:Static s:guiStrings.ButtonOK}" IsDefault="True" Margin="0,0,10,0" Click="Button_Click"/>
<Button Width="75" Height="25" Content="{x:Static s:guiStrings.ButtonCancel}" IsCancel="True"/>
</StackPanel>
</StackPanel>
</Window>

27
EnterMaskDialog.xaml.cs Normal file
View File

@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for EnterMaskDialog.xaml
/// </summary>
public partial class EnterMaskDialog : Window
{
public EnterMaskDialog (IEnumerable<string> mask_list)
{
InitializeComponent ();
// Mask.ItemsSource = mask_list;
Mask.Text = "*.*";
Mask.SelectionStart = 2;
Mask.SelectionLength = 1;
FocusManager.SetFocusedElement (this, Mask);
}
private void Button_Click (object sender, RoutedEventArgs e)
{
this.DialogResult = true;
}
}
}