GUI parts for DISCO-F746NG. GuiBase, Button, ButtonGroup, Label, BlinkLabel, NumericLabel, SeekBar, SeekbarGroup
Dependents: F746_SD_GraphicEqualizer_ren0620
Fork of F746_GUI by
Diff: Label.cpp
- 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;
+ }
+ }
}
