mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-30 17:05:37 +08:00
mask entry dialog has a drop-down list of possible extensions.
This commit is contained in:
parent
2f2bbb3dc0
commit
f8fcf9fb21
@ -8,7 +8,7 @@
|
|||||||
WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
|
WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
|
||||||
<StackPanel Orientation="Vertical" Margin="10">
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
<TextBlock Text="{x:Static s:guiStrings.LabelEnterMask}"/>
|
<TextBlock Text="{x:Static s:guiStrings.LabelEnterMask}"/>
|
||||||
<TextBox Name="Mask"/>
|
<ComboBox Loaded="Mask_Loaded" Name="Mask" IsEditable="True"/>
|
||||||
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
<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.ButtonOK}" IsDefault="True" Margin="0,0,10,0" Click="Button_Click"/>
|
||||||
<Button Width="75" Height="25" Content="{x:Static s:guiStrings.ButtonCancel}" IsCancel="True"/>
|
<Button Width="75" Height="25" Content="{x:Static s:guiStrings.ButtonCancel}" IsCancel="True"/>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace GARbro.GUI
|
namespace GARbro.GUI
|
||||||
@ -12,16 +13,21 @@ namespace GARbro.GUI
|
|||||||
public EnterMaskDialog (IEnumerable<string> mask_list)
|
public EnterMaskDialog (IEnumerable<string> mask_list)
|
||||||
{
|
{
|
||||||
InitializeComponent ();
|
InitializeComponent ();
|
||||||
// Mask.ItemsSource = mask_list;
|
Mask.ItemsSource = mask_list;
|
||||||
Mask.Text = "*.*";
|
Mask.Text = "*.*";
|
||||||
Mask.SelectionStart = 2;
|
|
||||||
Mask.SelectionLength = 1;
|
|
||||||
FocusManager.SetFocusedElement (this, Mask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click (object sender, RoutedEventArgs e)
|
private void Button_Click (object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.DialogResult = true;
|
this.DialogResult = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Mask_Loaded (object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var text_box = (TextBox)Mask.Template.FindName ("PART_EditableTextBox", Mask);
|
||||||
|
FocusManager.SetFocusedElement (this, text_box);
|
||||||
|
text_box.SelectionStart = 2;
|
||||||
|
text_box.SelectionLength = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user