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

Dependencies:   Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG

Dependents:   F746_AudioOutQSPI F746_AudioPlayerSD DISCO-F746NG_test001 F746_SD_WavPlayer ... more

Revision:
9:c379410bda15
Parent:
4:cbf7ed9092a3
--- a/Label.cpp	Thu Apr 21 01:12:59 2016 +0000
+++ b/Label.cpp	Sun Apr 24 11:49:42 2016 +0000
@@ -1,7 +1,7 @@
 //-----------------------------------------------------------
 //  Label class
 //
-//  2016/04/07, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/04/24, Copyright (c) 2016 MIKAMI, Naoki
 //-----------------------------------------------------------
 
 #include "Label.hpp"
@@ -35,4 +35,16 @@
         lcd_.SetTextColor(textColor);
         DrawString(PosX(X_), Y_, str);
     }
+
+    uint16_t Label::PosX(uint16_t x)
+    {
+        if (MODE_ == LEFT) return x;
+        else
+        {
+            if (MODE_ == CENTER)
+                return x - length_*FONTS_->Width/2;
+            else
+                return x - length_*FONTS_->Width;
+        }
+    }
 }