Browse Source

Make some event handlers methods public

Signed-off-by: falkTX <falktx@falktx.com>
pull/292/head
falkTX 4 years ago
parent
commit
995b94a44b
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 10 additions and 10 deletions
  1. +3
    -3
      dgl/EventHandlers.hpp
  2. +7
    -7
      dgl/src/EventHandlers.cpp

+ 3
- 3
dgl/EventHandlers.hpp View File

@@ -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;


+ 7
- 7
dgl/src/EventHandlers.cpp View File

@@ -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<State>(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<State>(pData->state);
}

bool ButtonEventHandler::motionEvent(const Widget::MotionEvent& ev)
void ButtonEventHandler::stateChanged(State, State)
{
return pData->motionEvent(ev);
}

// --------------------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save