1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

move to EventReceiver

This commit is contained in:
Laserlicht 2023-10-22 00:05:14 +02:00 committed by GitHub
parent 6939989026
commit 05a9f0fe39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 17 deletions

View File

@ -258,16 +258,6 @@ void CIntObject::redraw()
}
}
void CIntObject::clickPressed(const Point & cursorPosition, bool lastActivated)
{
AEventsReceiver::clickPressed(cursorPosition);
}
void CIntObject::clickReleased(const Point & cursorPosition, bool lastActivated)
{
AEventsReceiver::clickReleased(cursorPosition);
}
bool CIntObject::receiveEvent(const Point & position, int eventType) const
{
return pos.isInside(position);

View File

@ -98,11 +98,6 @@ public:
void showAll(Canvas & to) override;
//request complete redraw of this object
void redraw() override;
// events are overloaded
void clickPressed(const Point & cursorPosition, bool lastActivated) override;
void clickReleased(const Point & cursorPosition, bool lastActivated) override;
/// returns true if this element is a popup window
/// called only for windows
bool isPopupWindow() const override;

View File

@ -68,3 +68,13 @@ void AEventsReceiver::deactivateEvents(ui16 what)
// if (!(activeState & HOVER))
// hoveredState = false;
}
void AEventsReceiver::clickPressed(const Point & cursorPosition, bool lastActivated)
{
clickPressed(cursorPosition);
}
void AEventsReceiver::clickReleased(const Point & cursorPosition, bool lastActivated)
{
clickReleased(cursorPosition);
}

View File

@ -45,8 +45,8 @@ protected:
public:
virtual void clickPressed(const Point & cursorPosition) {}
virtual void clickReleased(const Point & cursorPosition) {}
virtual void clickPressed(const Point & cursorPosition, bool lastActivated) {}
virtual void clickReleased(const Point & cursorPosition, bool lastActivated) {}
virtual void clickPressed(const Point & cursorPosition, bool lastActivated);
virtual void clickReleased(const Point & cursorPosition, bool lastActivated);
virtual void clickCancel(const Point & cursorPosition) {}
virtual void showPopupWindow(const Point & cursorPosition) {}
virtual void clickDouble(const Point & cursorPosition) {}