Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Revision:
4:27546fb8b670
Child:
7:303850a4b30c
diff -r cb004f59b715 -r 27546fb8b670 Widgets/BitmapWidget.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Widgets/BitmapWidget.cpp	Sun Mar 27 15:37:32 2016 +0000
@@ -0,0 +1,31 @@
+#include "BitmapWidget.h"
+
+BitmapWidget::BitmapWidget(GraphicsDisplay* display) : Widget(display), _monochrome(false)
+{
+}
+
+void BitmapWidget::setMonochrome(bool enabled)
+{
+    _monochrome = enabled;
+}
+
+bool BitmapWidget::isMonochrome()
+{
+    return _monochrome;
+}
+
+
+void BitmapWidget::setBitmap(unsigned char* bitmap)
+{
+    _bitmap = bitmap;
+}
+
+void BitmapWidget::draw()
+{
+
+    if(_monochrome) {
+        _display->Bitmap_FG_BG(_x, _y, _width, _height, _bitmap);
+    } else {
+        _display->Bitmap(_x, _y, _width, _height, _bitmap);
+    }
+}
\ No newline at end of file