Foundation classes for a basic GUI implementing simple widgets and events. (Fork for custom changes.)
Fork of SimpleGUI by
Diff: Events/Event.h
- Revision:
- 0:0a590815d51c
- Child:
- 12:63db16fea709
diff -r 000000000000 -r 0a590815d51c Events/Event.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Events/Event.h Fri Mar 25 13:47:04 2016 +0000 @@ -0,0 +1,21 @@ +#ifndef SIMPLEGUI_EVENT_H +#define SIMPLEGUI_EVENT_H + +#include "mbed.h" + + +typedef struct Event { + + // It would be nice to use e.g. classes to represent events. But getting class information + // out of a C++ class at runtime takes gymnastics which I can't be bothered with + // Instead it's up to YOU the user of this library to ensure that your event types + // are drawn from a central list so that they can be properly distinguished. Sorry. + uint8_t type; + // This should probably be some kind of union to cope with the different kinds of event we expect to handle + // For now I'm going to explicitly assume events relate to something on-screen + int screenX; + int screenY; + +} Event; + +#endif