diff options
Diffstat (limited to 'Widgets/AbstractScreen.cpp')
-rw-r--r-- | Widgets/AbstractScreen.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Widgets/AbstractScreen.cpp b/Widgets/AbstractScreen.cpp index d9216de1e1..4f2536bbc1 100644 --- a/Widgets/AbstractScreen.cpp +++ b/Widgets/AbstractScreen.cpp @@ -13,7 +13,8 @@ AbstractScreen& AbstractScreen::the() } AbstractScreen::AbstractScreen(unsigned width, unsigned height) - : m_width(width) + : Object(nullptr) + , m_width(width) , m_height(height) { ASSERT(!s_the); @@ -24,6 +25,17 @@ AbstractScreen::~AbstractScreen() { } +void AbstractScreen::event(Event& event) +{ + if (event.type() == Event::MouseMove) { + auto& me = static_cast<MouseEvent&>(event); + printf("AbstractScreen::onMouseMove: %d, %d\n", me.x(), me.y()); + + auto result = m_rootWidget->hitTest(me.x(), me.y()); + printf("hit test for %d,%d found: %s{%p} %d,%d\n", me.x(), me.y(), result.widget->className(), result.widget, result.localX, result.localY); + } +} + void AbstractScreen::setRootWidget(Widget* widget) { // FIXME: Should we support switching root widgets? |