From add9eed8c0313a54337459b46b76a35a0359811d Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 30 May 2021 00:27:57 +0100 Subject: [PATCH] Make widget pass events into subwidgets Signed-off-by: falkTX --- dgl/src/Widget.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/dgl/src/Widget.cpp b/dgl/src/Widget.cpp index 0a393572..e6e41d5a 100644 --- a/dgl/src/Widget.cpp +++ b/dgl/src/Widget.cpp @@ -162,34 +162,37 @@ void Widget::setId(uint id) noexcept pData->id = id; } -bool Widget::onKeyboard(const KeyboardEvent&) +bool Widget::onKeyboard(const KeyboardEvent& ev) { - return false; + return pData->giveKeyboardEventForSubWidgets(ev); } -bool Widget::onSpecial(const SpecialEvent&) +bool Widget::onSpecial(const SpecialEvent& ev) { - return false; + return pData->giveSpecialEventForSubWidgets(ev); } -bool Widget::onCharacterInput(const CharacterInputEvent&) +bool Widget::onCharacterInput(const CharacterInputEvent& ev) { - return false; + return pData->giveCharacterInputEventForSubWidgets(ev); } -bool Widget::onMouse(const MouseEvent&) +bool Widget::onMouse(const MouseEvent& ev) { - return false; + MouseEvent rev = ev; + return pData->giveMouseEventForSubWidgets(rev); } -bool Widget::onMotion(const MotionEvent&) +bool Widget::onMotion(const MotionEvent& ev) { - return false; + MotionEvent rev = ev; + return pData->giveMotionEventForSubWidgets(rev); } -bool Widget::onScroll(const ScrollEvent&) +bool Widget::onScroll(const ScrollEvent& ev) { - return false; + ScrollEvent rev = ev; + return pData->giveScrollEventForSubWidgets(rev); } void Widget::onResize(const ResizeEvent&)