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:
Wed Nov 09 10:30:09 2016 +0000
Parent:
25:d1acf9d53f98
Child:
27:115219bcd9f5
Commit message:
27

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	Mon Nov 07 00:14:52 2016 +0000
+++ b/ButtonGroup.cpp	Wed Nov 09 10:30:09 2016 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  ButtonGroup class
 //
-//  2016/07/03, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/11/09, Copyright (c) 2016 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #include "ButtonGroup.hpp"
@@ -81,7 +81,7 @@
         return rtn;
     }
 
-    // Get touched number
+    // Get touched number, return value: true or false
     bool ButtonGroup::GetTouchedNumber(int &num)
     {
         bool rtn = false;
@@ -107,6 +107,24 @@
         return true;
     }
 
+    // Get touched number, return value: touched number
+    int ButtonGroup::GetTouchedNumber()
+    {
+        int num;
+        if (GetTouchedNumber(num))
+            return num;
+        else
+            return -1;
+    }
+
+    // Wait until touched and get touched number
+    int ButtonGroup::WaitTouchedAndGet()
+    {
+        int num;
+        while (!GetTouchedNumber(num)) {}
+        return num;
+    }
+
     // Activate and inactivate button(s)
     bool ButtonGroup::Activate(int num)
     {
--- a/ButtonGroup.hpp	Mon Nov 07 00:14:52 2016 +0000
+++ b/ButtonGroup.hpp	Wed Nov 09 10:30:09 2016 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  ButtonGroup class -- Header
 //
-//  2016/07/12, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/11/09, Copyright (c) 2016 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #ifndef F746_BUTTON_GROUP_HPP
@@ -52,8 +52,16 @@
         // Check touch detected for specified button
         bool Touched(int num);
 
-        // Get touched number
+        // Get touched number, return value: true or false
         bool GetTouchedNumber(int &num);
+        // Get touched number, return value: touched number
+        int GetTouchedNumber();
+
+        // Wait until touched
+        void WaitTouched(int num)
+        {   while (!Touched(num)) {} }
+        // Wait until touched and get touched number
+        int WaitTouchedAndGet();
 
         // Activate and inactivate button(s)
         bool Activate(int num);