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.
Diff: widgets/EACompass.h
- Revision:
- 4:f8f7f4f9c58d
- Child:
- 7:6cf21b018420
diff -r 24fbf4dbd7e5 -r f8f7f4f9c58d widgets/EACompass.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/widgets/EACompass.h Mon Apr 26 21:37:54 2010 +0000
@@ -0,0 +1,46 @@
+// Copyright 2010 Richard Parker
+
+#ifndef MBED_EACOMPASS_H
+#define MBED_EACOMPASS_H
+
+#include "mbed.h"
+
+#include "EAWidget.h"
+
+class EALCD;
+
+/**
+ * Class to handle displaying a button on screen with hitbox.
+ * @author Richard Parker
+ */
+class EACompass: public EAWidget
+{
+public:
+ EACompass( short x = 0,
+ short y = 0,
+ unsigned short diameter = 0,
+ unsigned short angle = 0);
+
+ ~EACompass();
+
+ virtual void paint(EALCD& lcd);
+ void update(EALCD& lcd, float angle);
+
+ inline void setAngle(float angle) { _angle = angle; }
+ inline float angle() { return _angle; }
+
+ inline void setDiameter(unsigned short diameter) { _diameter = diameter; EAWidget::setWidth(diameter); EAWidget::setHeight(diameter);}
+ inline unsigned short diameter() { return _diameter; }
+
+ inline virtual void setWidth(unsigned short w) { setDiameter(w); }
+ inline virtual void setHeight(unsigned short h) { setDiameter(h); }
+
+private:
+ float _angle;
+ unsigned short _diameter;
+
+ void _drawPointer(EALCD& lcd);
+
+};
+
+#endif
\ No newline at end of file