From 871a28c10f6f3a44b812e2fc667af03266efc539 Mon Sep 17 00:00:00 2001 From: ericek111 Date: Tue, 1 Sep 2026 00:03:08 +0000 Subject: [PATCH] Take a clicked word into the box the cursor is in GrabIntoFocused puts text in whichever box has the cursor, whatever kind of value that box normally holds. It is what N1MM's digital window does on Ctrl+click, for the exchange element the contest has no box for. The entry window also says when a CQ has gone out, which the digital window needs to clear its grab list on: a run that starts again brings new callers. GrabList.N1mmDepth is the ten calls N1MM's grab window holds. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD --- src/Nonemm.App/Windows/EntryWindow.Macros.cs | 1 + src/Nonemm.App/Windows/EntryWindow.axaml.cs | 19 +++++++++++++++++++ src/Nonemm.Session/GrabList.cs | 3 +++ 3 files changed, 23 insertions(+) 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)