diff --git a/dgl/EventHandlers.hpp b/dgl/EventHandlers.hpp index fc1761a7..084a26f4 100644 --- a/dgl/EventHandlers.hpp +++ b/dgl/EventHandlers.hpp @@ -54,14 +54,14 @@ public: void setCallback(Callback* callback) noexcept; + bool mouseEvent(const Widget::MouseEvent& ev); + bool motionEvent(const Widget::MotionEvent& ev); + protected: State getState() const noexcept; virtual void stateChanged(State state, State oldState); - bool mouseEvent(const Widget::MouseEvent& ev); - bool motionEvent(const Widget::MotionEvent& ev); - private: struct PrivateData; PrivateData* const pData; diff --git a/dgl/src/EventHandlers.cpp b/dgl/src/EventHandlers.cpp index 87187d11..d306408a 100644 --- a/dgl/src/EventHandlers.cpp +++ b/dgl/src/EventHandlers.cpp @@ -208,23 +208,23 @@ void ButtonEventHandler::setCallback(Callback* const callback) noexcept pData->callback = callback; } -ButtonEventHandler::State ButtonEventHandler::getState() const noexcept +bool ButtonEventHandler::mouseEvent(const Widget::MouseEvent& ev) { - return static_cast(pData->state); + return pData->mouseEvent(ev); } -void ButtonEventHandler::stateChanged(State, State) +bool ButtonEventHandler::motionEvent(const Widget::MotionEvent& ev) { + return pData->motionEvent(ev); } -bool ButtonEventHandler::mouseEvent(const Widget::MouseEvent& ev) +ButtonEventHandler::State ButtonEventHandler::getState() const noexcept { - return pData->mouseEvent(ev); + return static_cast(pData->state); } -bool ButtonEventHandler::motionEvent(const Widget::MotionEvent& ev) +void ButtonEventHandler::stateChanged(State, State) { - return pData->motionEvent(ev); } // --------------------------------------------------------------------------------------------------------------------