DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit add9eed8c0313a54337459b46b76a35a0359811d
parent 11837263c53025f1d0992b4c54b4ff573eccd0e6
Author: falkTX <falktx@falktx.com>
Date:   Sun, 30 May 2021 00:27:30 +0100

Make widget pass events into subwidgets

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdgl/src/Widget.cpp | 27+++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)

diff --git 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&)