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 readonly DispatcherTimer Timer;
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? ManualWeighingReason = null;
@ -38,8 +41,9 @@ namespace Elwig.Windows {
public DeliveryAdminWindow(bool receipt = false) {
InitializeComponent();
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
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 = [
MgNrInput, MemberInput,
LsNrInput, DateInput, BranchInput,