1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

Add a simple clock window to guitest2.

This is driven by mousedown events right now, since there are no timers.
This commit is contained in:
Andreas Kling 2019-01-31 16:37:43 +01:00
parent 2dc9c86bad
commit e04ba0a83c
7 changed files with 113 additions and 10 deletions

View file

@ -23,7 +23,7 @@ void GObject::event(GEvent& event)
{
switch (event.type()) {
case GEvent::Timer:
return timerEvent(static_cast<GTimerEvent&>(event));
return timer_event(static_cast<GTimerEvent&>(event));
case GEvent::DeferredDestroy:
delete this;
break;
@ -50,7 +50,7 @@ void GObject::removeChild(GObject& object)
}
}
void GObject::timerEvent(GTimerEvent&)
void GObject::timer_event(GTimerEvent&)
{
}

View file

@ -30,7 +30,7 @@ public:
void delete_later();
private:
virtual void timerEvent(GTimerEvent&);
virtual void timer_event(GTimerEvent&);
GObject* m_parent { nullptr };

View file

@ -123,7 +123,7 @@ void GTextBox::keydown_event(GKeyEvent& event)
}
}
void GTextBox::timerEvent(GTimerEvent&)
void GTextBox::timer_event(GTimerEvent&)
{
// FIXME: Disable the timer when not focused.
if (!is_focused())

View file

@ -18,7 +18,7 @@ private:
virtual void paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
virtual void keydown_event(GKeyEvent&) override;
virtual void timerEvent(GTimerEvent&) override;
virtual void timer_event(GTimerEvent&) override;
virtual bool accepts_focus() const override { return true; }
void handle_backspace();