diff --git a/src/Nonemm.App/Windows/EntryWindow.Macros.cs b/src/Nonemm.App/Windows/EntryWindow.Macros.cs index 05ce5e4..2caaf9a 100644 --- a/src/Nonemm.App/Windows/EntryWindow.Macros.cs +++ b/src/Nonemm.App/Windows/EntryWindow.Macros.cs @@ -105,6 +105,7 @@ public sealed partial class EntryWindow if (index == Esm.CallCq) { session.Alternating?.CarryOn(); + CqSent?.Invoke(this, EventArgs.Empty); } else { diff --git a/src/Nonemm.App/Windows/EntryWindow.axaml.cs b/src/Nonemm.App/Windows/EntryWindow.axaml.cs index c769b64..8c44849 100644 --- a/src/Nonemm.App/Windows/EntryWindow.axaml.cs +++ b/src/Nonemm.App/Windows/EntryWindow.axaml.cs @@ -589,10 +589,29 @@ public sealed partial class EntryWindow : Window return true; } + /// The digital window's Ctrl+click: whatever was clicked goes in the box + /// the cursor is in, whatever kind of value the box normally holds. + internal void GrabIntoFocused(string text) + { + if (Logging is null || text.Length == 0) + { + return; + } + int field = Math.Clamp(Logging.Entry.Focus, 0, boxes.Count - 1); + Logging.Entry[field] = field == 0 ? text.ToUpperInvariant() : text; + SyncBoxes(); + boxes[field].Focus(); + Refresh(); + } + /// The digital window's right click, which N1MM makes the same as pressing /// Enter here. internal void PressEnter() => OnEnter(); + /// A CQ has gone out. The digital window clears its grab list on it, the + /// way N1MM does: a run that starts again brings new callers. + internal event EventHandler? CqSent; + private void MoveFocus(bool forward) { if (Logging is null || boxes.Count == 0) diff --git a/src/Nonemm.Session/GrabList.cs b/src/Nonemm.Session/GrabList.cs index f42bbe8..d16eafa 100644 --- a/src/Nonemm.Session/GrabList.cs +++ b/src/Nonemm.Session/GrabList.cs @@ -24,6 +24,9 @@ public enum GrabFilter /// calls nothing has ever heard of. public sealed class GrabList { + /// How many calls N1MM's grab window holds. + public const int N1mmDepth = 10; + private readonly List calls = []; public GrabList(int capacity = 30)