Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Array_Matrix TS_DISCO_F746NG LCD_DISCO_F746NG BSP_DISCO_F746NG
Diff: Label.hpp
- Revision:
- 0:a2686ef737c2
- Child:
- 1:d1655f3c8717
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Label.hpp Thu Mar 31 07:28:42 2016 +0000
@@ -0,0 +1,41 @@
+//-----------------------------------------------------------
+// Label class -- Header
+//
+// 2016/03/28, Copyright (c) 2016 MIKAMI, Naoki
+//-----------------------------------------------------------
+
+#ifndef F746_LABEL_HPP
+#define F746_LABEL_HPP
+
+#include "GuiBase.hpp"
+
+namespace Mikami
+{
+ class Label : public GuiBase
+ {
+ public:
+ enum TextAlignMode { LEFT, CENTER };
+ // Constructor
+ Label(uint16_t x, uint16_t y, const string str,
+ TextAlignMode mode = LEFT,
+ sFONT &fonts = Font12,
+ uint32_t textColor = GuiBase::ENUM_TEXT,
+ uint32_t backColor = GuiBase::ENUM_BACK);
+
+ void Draw(const string str);
+
+ private:
+ const TextAlignMode MODE_;
+
+ uint8_t length_;
+
+ uint16_t PosX(uint16_t x)
+ { return (MODE_ == LEFT) ?
+ x : x - length_*FONTS_->Width/2; }
+
+ // disallow copy constructor and assignment operator
+ Label(const Label&);
+ Label& operator=(const Label&);
+ };
+}
+#endif // F746_LABEL_HPP