ENH: Better Scrolling Over Multiline Fields (#4218)
* Improve scrolling over multiline fields * Fix text control scrolling
This commit is contained in:
parent
bf4d59a676
commit
047b889ba6
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue