react to pressing Enter in text fields
This commit is contained in:
parent
1926ba883b
commit
2125844acb
@ -29,11 +29,11 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToolBar VerticalAlignment="Top" Grid.Row="0" Width="Auto" Grid.ColumnSpan="3" Height="Auto" Margin="0,0,0,0" HorizontalAlignment="Left">
|
||||
<Label Content="System:" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="system" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" Margin="0,0,0,3.286" MinWidth="120" VerticalContentAlignment="Center"/>
|
||||
<TextBox x:Name="system" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" Margin="0,0,0,3.286" MinWidth="120" VerticalContentAlignment="Center" KeyDown="Filter_KeyDown"/>
|
||||
<Label Content="Station:" Height="26.2857142857143" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="station" Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" MinWidth="120"/>
|
||||
<TextBox x:Name="station" Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" MinWidth="120" KeyDown="Filter_KeyDown"/>
|
||||
<Label Content="Faction:" Height="26.2857142857143" VerticalAlignment="Top"/>
|
||||
<TextBox x:Name="faction" Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" MinWidth="120"/>
|
||||
<TextBox x:Name="faction" Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" MinWidth="120" KeyDown="Filter_KeyDown"/>
|
||||
<Separator Height="26.2857142857143" Margin="0" VerticalAlignment="Top"/>
|
||||
<Button x:Name="AddFilter" Content="Add Objective" VerticalAlignment="Stretch" Click="AddFilter_Click" Margin="0,0,0,0.286" RenderTransformOrigin="0.5,0.505"/>
|
||||
</ToolBar>
|
||||
|
@ -119,7 +119,7 @@ namespace NonaBGS {
|
||||
RefreshObjectives();
|
||||
}
|
||||
|
||||
private void AddFilter_Click(object sender, RoutedEventArgs e) {
|
||||
private void AddObjective() {
|
||||
Objective objective = new Objective {
|
||||
System = system.Text,
|
||||
Faction = faction.Text,
|
||||
@ -136,6 +136,10 @@ namespace NonaBGS {
|
||||
}
|
||||
}
|
||||
|
||||
private void AddFilter_Click(object sender, RoutedEventArgs e) {
|
||||
AddObjective();
|
||||
}
|
||||
|
||||
private void GenerateDiscord_Click(object sender, RoutedEventArgs e) {
|
||||
NonaDiscordLog discord = new NonaDiscordLog();
|
||||
string report = discord.GenerateDiscordLog(Report);
|
||||
@ -188,5 +192,11 @@ namespace NonaBGS {
|
||||
Config.Global.UseEDDB = (bool)useeddb.IsChecked;
|
||||
SyncDatabases();
|
||||
}
|
||||
|
||||
private void Filter_KeyDown(object sender, KeyEventArgs e) {
|
||||
if (e.Key == Key.Enter) {
|
||||
AddObjective();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user