# HG changeset patch # User spq@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1214934215 0 # Node ID e84dccee1bb707f94a70dfd34ef227772f0ce0a5 # Parent 2082bf27a3b82a4db3ed8a95d48be33e69ee9bfb * add myself to authors * fix missing break in guimanager * when an event occurs over an guichan window the event is marked as consumedByGuichan, but the event is still distributed to all event listeners, those can check via event.isConsumedByGuichan... diff -r 2082bf27a3b8 -r e84dccee1bb7 doc/AUTHORS --- a/doc/AUTHORS Mon Jun 30 16:59:25 2008 +0000 +++ b/doc/AUTHORS Tue Jul 01 17:43:35 2008 +0000 @@ -40,4 +40,4 @@ vtchill >> manning.jesse@gmail.com zahlman >> karl.knechtel@utoronto.ca zbyte64 >> zbyte64@gmail.com - +spq >> spq@my-ct.de diff -r 2082bf27a3b8 -r e84dccee1bb7 engine/core/eventchannel/base/ec_inputevent.h --- a/engine/core/eventchannel/base/ec_inputevent.h Mon Jun 30 16:59:25 2008 +0000 +++ b/engine/core/eventchannel/base/ec_inputevent.h Tue Jul 01 17:43:35 2008 +0000 @@ -45,6 +45,7 @@ */ InputEvent(): Event(), + m_consumedbyguichan(false), m_isshiftpressed(false), m_iscontrolpressed(false), m_isaltpressed(false), @@ -73,6 +74,11 @@ */ virtual bool isShiftPressed() const { return m_isshiftpressed; } virtual void setShiftPressed(bool pressed) { m_isshiftpressed = pressed; } + + /** Marks events as consumed by guichan. + */ + virtual void consumedByGuichan() { m_consumedbyguichan = true; } + virtual bool isConsumedByGuichan() const { return m_consumedbyguichan; } virtual void consume() { Event::consume(); } virtual bool isConsumed() const { return Event::isConsumed(); } @@ -101,6 +107,7 @@ private: + bool m_consumedbyguichan; bool m_isshiftpressed; bool m_iscontrolpressed; bool m_isaltpressed; diff -r 2082bf27a3b8 -r e84dccee1bb7 engine/core/eventchannel/eventchannel.i --- a/engine/core/eventchannel/eventchannel.i Mon Jun 30 16:59:25 2008 +0000 +++ b/engine/core/eventchannel/eventchannel.i Tue Jul 01 17:43:35 2008 +0000 @@ -66,6 +66,7 @@ class InputEvent: public Event { public: + virtual bool isConsumedByGuichan() const; virtual bool isAltPressed() const; virtual bool isControlPressed() const; virtual bool isMetaPressed() const; diff -r 2082bf27a3b8 -r e84dccee1bb7 engine/core/eventchannel/eventmanager.cpp --- a/engine/core/eventchannel/eventmanager.cpp Mon Jun 30 16:59:25 2008 +0000 +++ b/engine/core/eventchannel/eventmanager.cpp Tue Jul 01 17:43:35 2008 +0000 @@ -408,6 +408,7 @@ break; case MouseEvent::ENTERED: (*i)->mouseEntered(evt); + break; case MouseEvent::EXITED: (*i)->mouseExited(evt); break; diff -r 2082bf27a3b8 -r e84dccee1bb7 engine/core/eventchannel/key/ec_keyevent.h --- a/engine/core/eventchannel/key/ec_keyevent.h Mon Jun 30 16:59:25 2008 +0000 +++ b/engine/core/eventchannel/key/ec_keyevent.h Tue Jul 01 17:43:35 2008 +0000 @@ -82,6 +82,8 @@ virtual void consume() { InputEvent::consume(); } virtual bool isConsumed() const { return InputEvent::isConsumed(); } + virtual void consumedByGuichan() { InputEvent::consumedByGuichan(); } + virtual bool isConsumedByGuichan() const { return InputEvent::isConsumedByGuichan(); } virtual IEventSource* getSource() { return InputEvent::getSource(); } virtual void setSource(IEventSource* source) { InputEvent::setSource(source); } virtual gcn::Widget* getSourceWidget() { return InputEvent::getSourceWidget(); } diff -r 2082bf27a3b8 -r e84dccee1bb7 engine/core/eventchannel/mouse/ec_mouseevent.h --- a/engine/core/eventchannel/mouse/ec_mouseevent.h Mon Jun 30 16:59:25 2008 +0000 +++ b/engine/core/eventchannel/mouse/ec_mouseevent.h Tue Jul 01 17:43:35 2008 +0000 @@ -125,6 +125,8 @@ virtual void consume() { InputEvent::consume(); } virtual bool isConsumed() const { return InputEvent::isConsumed(); } + virtual void consumedByGuichan() { InputEvent::consumedByGuichan(); } + virtual bool isConsumedByGuichan() const { return InputEvent::isConsumedByGuichan(); } virtual IEventSource* getSource() { return InputEvent::getSource(); } virtual void setSource(IEventSource* source) { InputEvent::setSource(source); } virtual gcn::Widget* getSourceWidget() { return InputEvent::getSourceWidget(); } diff -r 2082bf27a3b8 -r e84dccee1bb7 engine/core/gui/guimanager.cpp --- a/engine/core/gui/guimanager.cpp Mon Jun 30 16:59:25 2008 +0000 +++ b/engine/core/gui/guimanager.cpp Tue Jul 01 17:43:35 2008 +0000 @@ -201,20 +201,20 @@ void GUIManager::evaluateKeyEventConsumption(KeyEvent& evt) { gcn::Widget* w = m_focushandler->getFocused(); if (w) { - evt.consume(); + evt.consumedByGuichan(); } } void GUIManager::evaluateMouseEventConsumption(MouseEvent& evt) { gcn::Widget* w = m_gcn_topcontainer->getWidgetAt(evt.getX(), evt.getY()); if (w && w->isVisible()) { - // evt.consume(); + evt.consumedByGuichan(); } } void GUIManager::mousePressed(MouseEvent& evt) { evaluateMouseEventConsumption(evt); - if (!evt.isConsumed()) { + if (!evt.isConsumedByGuichan()) { m_focushandler->focusNone(); } }