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.
Fork of DMBasicGUI by
Diff: Application/Clickable.h
- Revision:
- 7:4ba7bd9d32ef
- Parent:
- 6:7917b0894655
- Child:
- 10:651861441108
--- a/Application/Clickable.h Thu Jan 08 11:14:56 2015 +0100
+++ b/Application/Clickable.h Thu Jan 08 19:28:22 2015 +0100
@@ -67,11 +67,26 @@
*/
bool handle(uint16_t x, uint16_t y, bool pressed);
+ /** Test if the button is held down (usable for repeated presses)
+ *
+ * @returns
+ * true if the button is pressed
+ * false otherwise
+ */
+ bool pressed() { return _pressed; }
+
+ void bounds(int& x0, int& y0, int&x1, int&y1) {
+ x0 = _win.xpmin;
+ y0 = _win.ypmin;
+ x1 = _win.xpmax;
+ y1 = _win.ypmax;
+ }
+
/** Draws the button (on a new framebuffer if one is specified)
* @param fb the frame buffer
*/
virtual void draw(COLOR_T* fb = 0) = 0;
-
+
protected:
bool _enabled, _pressed;
SWIM_WINDOW_T _win;
