GUI parts for DISCO-F746NG. GuiBase, Button, ButtonGroup, Label, BlinkLabel, NumericLabel, SeekBar, SeekbarGroup

Dependents:   F746_SD_GraphicEqualizer_ren0620

Fork of F746_GUI by 不韋 呂

Files at this revision

API Documentation at this revision

Comitter:
edamame22
Date:
Wed Jun 22 03:49:51 2016 +0000
Parent:
12:687ec6183385
Commit message:
push area extended.

Changed in this revision

Button.cpp Show annotated file Show diff for this revision Revisions of this file
Button.hpp Show annotated file Show diff for this revision Revisions of this file
ButtonGroup.cpp Show annotated file Show diff for this revision Revisions of this file
ButtonGroup.hpp Show annotated file Show diff for this revision Revisions of this file
diff -r 687ec6183385 -r 95544440b46c Button.cpp
--- a/Button.cpp	Sat Apr 30 06:33:32 2016 +0000
+++ b/Button.cpp	Wed Jun 22 03:49:51 2016 +0000
@@ -47,7 +47,8 @@
         {
             uint16_t x = state_.touchX[n];
             uint16_t y = state_.touchY[n];
-            if ( (X_ <= x) && (x <= X_+W_) &&
+            
+            if ( (X_ <= x) && (x <= X_+W_+X_expend) &&
                  (Y_ <= y) && (y <= Y_+H_) ) return true;
         }
         return false;
diff -r 687ec6183385 -r 95544440b46c Button.hpp
--- a/Button.hpp	Sat Apr 30 06:33:32 2016 +0000
+++ b/Button.hpp	Wed Jun 22 03:49:51 2016 +0000
@@ -17,7 +17,7 @@
     public:
         // Constructor
         Button(uint16_t x, uint16_t y,
-               uint16_t width, uint16_t height,
+               uint16_t width, uint16_t height, uint16_t x_Expand,
                const string str = "", sFONT &fonts = Font12,
                uint32_t textColor         = GuiBase::ENUM_TEXT,
                uint32_t backColor         = GuiBase::ENUM_BACK,
@@ -29,7 +29,7 @@
                         textColor, backColor, createdColor,
                         touchedColor, inactiveColor,
                         inactiveTextColor),
-                W_(width), H_(height), STR_(str), active_(true)
+                W_(width), H_(height), X_expend(x_Expand), STR_(str), active_(true)
         {   Draw(); }
 
         // Draw button
@@ -53,7 +53,7 @@
         static void SetMultiTouch(bool tf) { multiTouch_ = tf; }
 
     private:       
-        const uint16_t W_, H_;
+        const uint16_t W_, H_, X_expend;
         const string STR_;
         bool active_;
 
diff -r 687ec6183385 -r 95544440b46c ButtonGroup.cpp
--- a/ButtonGroup.cpp	Sat Apr 30 06:33:32 2016 +0000
+++ b/ButtonGroup.cpp	Wed Jun 22 03:49:51 2016 +0000
@@ -15,6 +15,7 @@
             uint16_t number, const string str[],
             uint16_t spaceX, uint16_t spaceY,
             uint16_t column, int touched,
+            bool expended,
             sFONT &fonts,
             uint32_t textColor, uint32_t backColor,
             uint32_t createdColor, uint32_t touchedColor,
@@ -30,8 +31,9 @@
             div_t u1 = div(n, column);
             uint16_t x = x0 + u1.rem*(width + spaceX);
             uint16_t y = y0 + u1.quot*(height + spaceY);
+            uint16_t xpend_detectArea = (expended? width*6 : 0);
             buttons_[n] =
-                new Button(x, y, width, height, str[n], fonts,
+                new Button(x, y, width, height, xpend_detectArea, str[n], fonts,
                            TEXT_COLOR_, BACK_COLOR_,
                            CREATED_COLOR_, TOUCHED_COLOR_,
                            INACTIVE_COLOR_, INACTIVE_TEXT_COLOR_);
diff -r 687ec6183385 -r 95544440b46c ButtonGroup.hpp
--- a/ButtonGroup.hpp	Sat Apr 30 06:33:32 2016 +0000
+++ b/ButtonGroup.hpp	Wed Jun 22 03:49:51 2016 +0000
@@ -21,6 +21,7 @@
                     uint16_t spaceX = 0, uint16_t spaceY = 0,
                     uint16_t column = 1,
                     int touched = -1,   // number for button initially touched-color
+                    bool expanded = false,
                     sFONT &fonts = Font12,
                     uint32_t textColor         = GuiBase::ENUM_TEXT,
                     uint32_t backColor         = GuiBase::ENUM_BACK,