Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TouchScreenGUIDemo
Diff: Widgets/Widget.h
- 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;
}