Téo DHIEN-FANE / F746_GUI

Dependencies:   Array_Matrix TS_DISCO_F746NG LCD_DISCO_F746NG BSP_DISCO_F746NG

Dependents:   dashboard_f1

Files at this revision

API Documentation at this revision

Comitter:
MikamiUitOpen
Date:
Thu Apr 07 00:08:19 2016 +0000
Parent:
2:d2f882d98f0a
Child:
4:cbf7ed9092a3
Commit message:
4

Changed in this revision

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
--- a/ButtonGroup.cpp	Tue Apr 05 13:23:17 2016 +0000
+++ b/ButtonGroup.cpp	Thu Apr 07 00:08:19 2016 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  ButtonGroup class
 //
-//  2016/03/31, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/04/07, Copyright (c) 2016 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #include "ButtonGroup.hpp"
@@ -36,8 +36,8 @@
                            CREATED_COLOR_, TOUCHED_COLOR_,
                            INACTIVE_COLOR_, INACTIVE_TEXT_COLOR_);
         }
-        // On created, set touched color
-        if (touched >= 0) DrawTouched(touched);
+        // On created, set touched color as needed
+        if (touched >= 0) TouchedColor(touched);
     }
 
     // Destructor
@@ -55,6 +55,13 @@
         return true;
     }
 
+    // Change to touched color
+    bool ButtonGroup::TouchedColor(int num)
+    {
+        if (prevNum_ != num) prevNum_ = num;
+        return Draw(num, TOUCHED_COLOR_, TEXT_COLOR_);
+    }
+
     // Erase button
     bool ButtonGroup::Erase(int num)
     {
@@ -114,4 +121,3 @@
         return true;
     }
 }
-
--- a/ButtonGroup.hpp	Tue Apr 05 13:23:17 2016 +0000
+++ b/ButtonGroup.hpp	Thu Apr 07 00:08:19 2016 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  ButtonGroup class -- Header
 //
-//  2016/03/31, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/04/07, Copyright (c) 2016 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #ifndef F746_BUTTON_GROUP_HPP
@@ -36,8 +36,8 @@
         bool Draw(int num, uint32_t color, uint32_t textColor);
         bool Draw(int num) { return Draw(num, CREATED_COLOR_, TEXT_COLOR_); }
 
-        // Draw with touched color
-        bool DrawTouched(int num) { return Draw(num, TOUCHED_COLOR_, TEXT_COLOR_); }
+        // Change to touched color
+        bool TouchedColor(int num);
 
         // Draw all buttons
         void DrawAll(uint32_t color, uint32_t textColor)