LT-22452 - fix mouse scrolling on date field in lex edit#754
Open
johnml1135 wants to merge 2 commits intomainfrom
Open
LT-22452 - fix mouse scrolling on date field in lex edit#754johnml1135 wants to merge 2 commits intomainfrom
johnml1135 wants to merge 2 commits intomainfrom
Conversation
NUnit Tests 1 files 1 suites 6m 6s ⏱️ Results for commit ba633e1. |
jasonleenaylor
requested changes
Mar 11, 2026
Contributor
jasonleenaylor
left a comment
There was a problem hiding this comment.
It looks like this test adds another test that pops up a window while it is running. I was hoping to get away from that, I'd rather not have a unit test for this if that is the case.
@jasonleenaylor reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: 1 of 3 files reviewed, all discussions resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA Explanation for LT-22452
Problem:
Mouse wheel scrolling does not work in the Lexicon Editor when the cursor is over the Date field (and potentially other non-ButtonLauncher controls in the DataTree).
Root Cause:
The Date field (
DateSlicein BasicTypeSlices.cs) wraps aRichTextBoxset toReadOnlywithBorderStyle.None.RichTextBoxinherits fromScrollableControland has internal scroll machinery that consumesWM_MOUSEWHEELmessages without propagating them to the parentDataTree. Win32 deliversWM_MOUSEWHEELto the focused window handle (theRichTextBox), so the message never reachesDataTreeand itsAutoScrollPositionproperty is never updated — the pane doesn't scroll.This is a general WinForms problem: any child control that internally handles
WM_MOUSEWHEEL(e.g.RichTextBox,ListView,TreeView) will swallow the mouse wheel and prevent its container from scrolling.Fix:
Added a
WheelRedirectorinner class toDataTreethat implementsIMessageFilter— a .NET/WinForms mechanism that intercepts Windows messages at the application message pump before they are dispatched to any window. This is the same pattern used in 7 other places in the FieldWorks codebase (e.g.FwFindReplaceDlg,SimpleRootSite,FwApp).When
WM_MOUSEWHEELis intercepted, the filter checks whether the cursor is over any liveDataTreeinstance. If so, it calculates the new scroll position using the sameAutoScrollPosition/AutoScrollMinSizeAPI thatDataTreeitself uses, applies it, and marks the message as handled. This ensures consistent scrolling regardless of which child control has focus.Changes:
WheelRedirectorinner class (~65 lines),Register()call in constructor,Unregister()call inDispose.Made changes.
This change is