Windows: Add Ctrl+P and Ctrl+Shift+P for delivery and member

This commit is contained in:
2024-01-20 15:47:20 +01:00
parent 1dc05e47cf
commit 9dc2e8a59a
2 changed files with 12 additions and 4 deletions

View File

@ -28,7 +28,10 @@ namespace Elwig.Windows {
private Member? Member = null; private Member? Member = null;
private readonly DispatcherTimer Timer; private readonly DispatcherTimer Timer;
private List<string> TextFilter = []; private List<string> TextFilter = [];
private readonly RoutedCommand CtrlF = new();
private readonly RoutedCommand CtrlF = new("CtrlF", typeof(DeliveryAdminWindow), [new KeyGesture(Key.F, ModifierKeys.Control)]);
private readonly RoutedCommand CtrlP = new("CtrlP", typeof(DeliveryAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control)]);
private readonly RoutedCommand CtrlShiftP = new("CtrlShiftP", typeof(DeliveryAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control | ModifierKeys.Shift)]);
private string? LastScaleError = null; private string? LastScaleError = null;
private string? ManualWeighingReason = null; private string? ManualWeighingReason = null;
@ -38,8 +41,9 @@ namespace Elwig.Windows {
public DeliveryAdminWindow(bool receipt = false) { public DeliveryAdminWindow(bool receipt = false) {
InitializeComponent(); InitializeComponent();
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput)); CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
CommandBindings.Add(new CommandBinding(CtrlP, Menu_Print_ShowDeliveryNote_Click));
CommandBindings.Add(new CommandBinding(CtrlShiftP, Menu_Print_PrintDeliveryNote_Click));
RequiredInputs = [ RequiredInputs = [
MgNrInput, MemberInput, MgNrInput, MemberInput,
LsNrInput, DateInput, BranchInput, LsNrInput, DateInput, BranchInput,

View File

@ -17,15 +17,19 @@ namespace Elwig.Windows {
public partial class MemberAdminWindow : AdministrationWindow { public partial class MemberAdminWindow : AdministrationWindow {
private List<string> TextFilter = []; private List<string> TextFilter = [];
private readonly RoutedCommand CtrlF = new();
private readonly (ComboBox, TextBox, TextBox)[] PhoneNrInputs; private readonly (ComboBox, TextBox, TextBox)[] PhoneNrInputs;
private readonly RoutedCommand CtrlF = new("CtrlF", typeof(MemberAdminWindow), [new KeyGesture(Key.F, ModifierKeys.Control)]);
private readonly RoutedCommand CtrlP = new("CtrlP", typeof(MemberAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control)]);
private readonly RoutedCommand CtrlShiftP = new("CtrlShiftP", typeof(MemberAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control | ModifierKeys.Shift)]);
private static ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes); private static ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
public MemberAdminWindow() { public MemberAdminWindow() {
InitializeComponent(); InitializeComponent();
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput)); CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
CommandBindings.Add(new CommandBinding(CtrlP, Menu_Show_MemberDataSheet_Click));
CommandBindings.Add(new CommandBinding(CtrlShiftP, Menu_Print_MemberDataSheet_Click));
ExemptInputs = [ ExemptInputs = [
SearchInput, ActiveMemberInput, MemberList, SearchInput, ActiveMemberInput, MemberList,
]; ];