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.hpp
- Revision:
- 9:c379410bda15
- Parent:
- 4:cbf7ed9092a3
--- a/Label.hpp Thu Apr 21 01:12:59 2016 +0000
+++ b/Label.hpp Sun Apr 24 11:49:42 2016 +0000
@@ -1,7 +1,7 @@
//-----------------------------------------------------------
// Label class -- Header
//
-// 2016/04/07, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/04/24, Copyright (c) 2016 MIKAMI, Naoki
//-----------------------------------------------------------
#ifndef F746_LABEL_HPP
@@ -14,7 +14,7 @@
class Label : public GuiBase
{
public:
- enum TextAlignMode { LEFT, CENTER };
+ enum TextAlignMode { LEFT, CENTER, RIGHT };
// Constructor
Label(uint16_t x, uint16_t y, const string str,
TextAlignMode mode = LEFT,
@@ -48,11 +48,8 @@
const string STR_;
uint8_t length_;
-
- uint16_t PosX(uint16_t x)
- { return (MODE_ == LEFT) ?
- x : x - length_*FONTS_->Width/2; }
-
+ uint16_t PosX(uint16_t x);
+
// disallow copy constructor and assignment operator
Label(const Label&);
Label& operator=(const Label&);
