el h / SimpleGUI

Fork of SimpleGUI by Duncan McIntyre

Revision:
1:48796b602c86
Parent:
0:0a590815d51c
Child:
5:b7ce5721a0b5
--- a/Widgets/Widget.h	Fri Mar 25 13:47:04 2016 +0000
+++ b/Widgets/Widget.h	Fri Mar 25 16:47:33 2016 +0000
@@ -14,7 +14,9 @@
     
         Widget(GraphicsDisplay* display) : _display(display), _fg(Black), _bg(White) {}
      
-        virtual bool isEventTarget(Event e);
+        virtual bool isEventTarget(Event e) {
+            return e.screenX >= _x && e.screenX <= (_x+_width) && e.screenY >= _y && e.screenY <= (_y+_height);
+        }
        
         virtual void setLocation(int x, int y) {
             _x = x;
@@ -46,7 +48,7 @@
             _fg = color;
         }
         
-        virtual void setBackgroun(uint16_t color) {
+        virtual void setBackground(uint16_t color) {
             _bg = color;
         }