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:
Tue Apr 12 05:48:25 2016 +0000
Parent:
6:b8f197b0012c
Child:
8:8c5107c91d02
Commit message:
8

Changed in this revision

NumericLabel.hpp Show annotated file Show diff for this revision Revisions of this file
--- a/NumericLabel.hpp	Tue Apr 12 04:15:41 2016 +0000
+++ b/NumericLabel.hpp	Tue Apr 12 05:48:25 2016 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  NumericLabel class -- derived class of Label class
 //
-//  2016/04/08, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/04/12, Copyright (c) 2016 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #ifndef F746_NUMERIC_LABEL_HPP
@@ -35,12 +35,17 @@
         // Draw value
         void Draw(const char fmt[], T val)
         {
-            char str[81];
-            sprintf(str, fmt, val);
-            Label::Draw(str);
+            sprintf(str_, fmt, val);
+            Label::Draw(str_);
         }
 
+        // Draw previous value with specified color
+        void Draw(uint32_t color)
+        {   Label::Draw(str_, color); }
+
     private:
+        char str_[81];
+
         // disallow copy constructor and assignment operator
         NumericLabel(const NumericLabel&);
         NumericLabel& operator=(const NumericLabel&);