Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Events/EventListener.h@8:a460cabc85ac, 2016-04-11 (annotated)
- Committer:
- duncanFrance
- Date:
- Mon Apr 11 16:54:02 2016 +0000
- Revision:
- 8:a460cabc85ac
- Parent:
- 1:48796b602c86
- Child:
- 12:63db16fea709
Added GUI for common defaults
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
duncanFrance | 0:0a590815d51c | 1 | #ifndef SIMPLEGUI_EVENT_TARGET_H |
duncanFrance | 0:0a590815d51c | 2 | #define SIMPLEGUI_EVENT_TARGET_H |
duncanFrance | 0:0a590815d51c | 3 | |
duncanFrance | 0:0a590815d51c | 4 | // Need a forward declaration of EventListener here |
duncanFrance | 0:0a590815d51c | 5 | class EventListener; |
duncanFrance | 0:0a590815d51c | 6 | |
duncanFrance | 0:0a590815d51c | 7 | #include "EventHandler.h" |
duncanFrance | 0:0a590815d51c | 8 | |
duncanFrance | 0:0a590815d51c | 9 | class EventListener { |
duncanFrance | 0:0a590815d51c | 10 | |
duncanFrance | 0:0a590815d51c | 11 | public: |
duncanFrance | 0:0a590815d51c | 12 | |
duncanFrance | 0:0a590815d51c | 13 | EventListener(); |
duncanFrance | 0:0a590815d51c | 14 | |
duncanFrance | 1:48796b602c86 | 15 | virtual bool isEventTarget(Event e); |
duncanFrance | 0:0a590815d51c | 16 | void handleEvent(Event e); |
duncanFrance | 0:0a590815d51c | 17 | void setEventHandler(uint8_t type, EventHandler handler); |
duncanFrance | 8:a460cabc85ac | 18 | /** |
duncanFrance | 8:a460cabc85ac | 19 | * Returns the number of remaining handlers |
duncanFrance | 8:a460cabc85ac | 20 | **/ |
duncanFrance | 8:a460cabc85ac | 21 | int unsetEventHandler(uint8_t type); |
duncanFrance | 0:0a590815d51c | 22 | |
duncanFrance | 0:0a590815d51c | 23 | private: |
duncanFrance | 0:0a590815d51c | 24 | |
duncanFrance | 8:a460cabc85ac | 25 | EventHandlerWrapper* _handlers; |
duncanFrance | 8:a460cabc85ac | 26 | int _numHandlers; |
duncanFrance | 0:0a590815d51c | 27 | |
duncanFrance | 0:0a590815d51c | 28 | }; |
duncanFrance | 0:0a590815d51c | 29 | |
duncanFrance | 0:0a590815d51c | 30 | #endif |