ENH: Better Scrolling Over Multiline Fields (#4218)

* Improve scrolling over multiline fields

* Fix text control scrolling
This commit is contained in:
Ocraftyone 2024-02-27 09:03:59 -05:00 committed by GitHub
parent bf4d59a676
commit 047b889ba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -588,6 +588,14 @@ void TextCtrl::BUILD() {
EnterPressed enter(this);
propagate_value();
}), text_ctrl->GetId());
} else {
// Orca: adds logic that scrolls the parent if the text control doesn't have focus
text_ctrl->Bind(wxEVT_MOUSEWHEEL, [text_ctrl](wxMouseEvent& event) {
if (text_ctrl->HasFocus() && text_ctrl->GetScrollRange(wxVERTICAL) != 1)
event.Skip(); // don't consume the event so that the text control will scroll
else
text_ctrl->GetParent()->ScrollLines((event.GetWheelRotation() > 0 ? -1 : 1) * event.GetLinesPerAction());
});
}
text_ctrl->Bind(wxEVT_LEFT_DOWN, ([temp](wxEvent &event)