Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Diff: Widgets/Widget.h
- Revision:
- 7:303850a4b30c
- Parent:
- 5:b7ce5721a0b5
- Child:
- 8:a460cabc85ac
diff -r b1ddfe0eb88e -r 303850a4b30c Widgets/Widget.h --- a/Widgets/Widget.h Mon Mar 28 12:59:37 2016 +0000 +++ b/Widgets/Widget.h Sun Apr 10 16:48:44 2016 +0000 @@ -12,7 +12,7 @@ public: - Widget(GraphicsDisplay* display) : _display(display), _fg(Black), _bg(White), _x(0), _y(0), _width(0), _height(0) {} + Widget(GraphicsDisplay& display) : _display(display), _fg(White), _bg(Black), _x(0), _y(0), _width(0), _height(0) {} virtual bool isEventTarget(Event e) { return e.screenX >= _x && e.screenX <= (_x+_width) && e.screenY >= _y && e.screenY <= (_y+_height); @@ -64,7 +64,7 @@ protected: - GraphicsDisplay* _display; + GraphicsDisplay& _display; uint16_t _fg, _bg; int _x,_y,_width,_height; bool _hidden;