1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:55:08 +00:00

CObject: Add custom_event() virtual.

This way you can just override custom_event() to catch CCustomEvent instead
of having to filter the entire event stream with event(). :^)
This commit is contained in:
Andreas Kling 2019-07-14 10:27:27 +02:00
parent 1ecb7462b7
commit a634fab3c4
2 changed files with 8 additions and 0 deletions

View file

@ -37,6 +37,8 @@ void CObject::event(CEvent& event)
case CEvent::Invalid:
ASSERT_NOT_REACHED();
break;
case CEvent::Custom:
return custom_event(static_cast<CCustomEvent&>(event));
default:
break;
}
@ -70,6 +72,10 @@ void CObject::child_event(CChildEvent&)
{
}
void CObject::custom_event(CCustomEvent&)
{
}
void CObject::start_timer(int ms)
{
if (m_timer_id) {