Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Events/EventDispatcher.cpp
- Committer:
- duncanFrance
- Date:
- 2016-05-21
- Revision:
- 15:e69fd74d42e4
- Parent:
- 12:63db16fea709
- Child:
- 18:d849f3ada858
File content as of revision 15:e69fd74d42e4:
#include "EventDispatcher.h" EventDispatcher::EventDispatcher() { } void EventDispatcher::attachListener(EventListener* l) { _listeners.appendOnce(l); } void EventDispatcher::detachListener(EventListener* l) { _listeners.remove(l); } void EventDispatcher::dispatchEvent(Event e) { EventListener* l; _listeners.reset(); while((l=_listeners.next()) != NULL) { if(l->isEventTarget(e)) { l->handleEvent(e); } } }