Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Events/EventDispatcher.cpp
- Committer:
- duncanFrance
- Date:
- 2016-05-08
- Revision:
- 12:63db16fea709
- Parent:
- 0:0a590815d51c
- Child:
- 15:e69fd74d42e4
File content as of revision 12:63db16fea709:
#include "EventDispatcher.h" EventDispatcher::EventDispatcher() { } void EventDispatcher::attachListener(EventListener* l) { _listeners.append(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); } } }