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
Label.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2016-04-05
- Revision:
- 2:d2f882d98f0a
- Parent:
- 1:d1655f3c8717
- Child:
- 4:cbf7ed9092a3
File content as of revision 2:d2f882d98f0a:
//----------------------------------------------------------- // Label class -- Header // // 2016/04/05, 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() { Draw(STR_, TEXT_COLOR_); } void Draw(const string str) { Draw(str, TEXT_COLOR_); } void Draw(uint32_t textColor) { Draw(STR_, textColor); } void Draw(const string str, uint32_t textColor); private: const TextAlignMode MODE_; const string STR_; 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