Demo to control 4 LEDs

Dependencies:   BSP_DISCO_F469NI mbed

Revision:
0:e06404fdff2f
Child:
1:a6d179a9ffbb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Widgets/Widget.h	Wed Oct 11 22:26:45 2017 +0000
@@ -0,0 +1,53 @@
+/*
+ * Widget.h
+ * 
+ * Copyright 2017 Faberge@TsarTeam
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * 
+ */
+
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include "LCD_F469.h"
+#include "TS_F469.h"
+
+class Widget
+{    
+    private:
+    
+    protected:
+        Widget(uint16_t x, uint16_t y, uint16_t width, uint16_t height, 
+            color_t backClr, color_t textClr = LCD_COLOR_WHITE) :
+            xPos(x), yPos(y), xDim(width), yDim(height), 
+            backColor(backClr), textColor(textClr) {}
+        
+        uint16_t xPos;
+        uint16_t yPos;
+        uint16_t xDim;
+        uint16_t yDim;
+        
+        color_t backColor;
+        color_t textColor;
+        
+        static Display LCD;
+        static TouchScreen TS;
+        
+    public:
+        virtual ~Widget() = 0;
+        bool isTouched();
+        virtual void draw(color_t clr) {};
+        virtual uint16_t update();
+        
+};
+
+#endif
\ No newline at end of file