![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
CQエレクトロニクス・セミナ「実習・マイコンを動かしながら学ぶディジタル・フィルタ」で使うプログラム.1次IIRフィルタの係数をターミナルから変更できる. http://seminar.cqpub.co.jp/ccm/ES18-0020
Dependencies: mbed Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG
F746_Gui_New/Label.hpp@0:47718d3154d9, 2017-10-09 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Mon Oct 09 02:36:11 2017 +0000
- Revision:
- 0:47718d3154d9
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:47718d3154d9 | 1 | //----------------------------------------------------------- |
MikamiUitOpen | 0:47718d3154d9 | 2 | // Label class -- Header |
MikamiUitOpen | 0:47718d3154d9 | 3 | // |
MikamiUitOpen | 0:47718d3154d9 | 4 | // 2016/10/02, Copyright (c) 2016 MIKAMI, Naoki |
MikamiUitOpen | 0:47718d3154d9 | 5 | //----------------------------------------------------------- |
MikamiUitOpen | 0:47718d3154d9 | 6 | |
MikamiUitOpen | 0:47718d3154d9 | 7 | #ifndef F746_LABEL_HPP |
MikamiUitOpen | 0:47718d3154d9 | 8 | #define F746_LABEL_HPP |
MikamiUitOpen | 0:47718d3154d9 | 9 | |
MikamiUitOpen | 0:47718d3154d9 | 10 | #include "GuiBase.hpp" |
MikamiUitOpen | 0:47718d3154d9 | 11 | |
MikamiUitOpen | 0:47718d3154d9 | 12 | namespace Mikami |
MikamiUitOpen | 0:47718d3154d9 | 13 | { |
MikamiUitOpen | 0:47718d3154d9 | 14 | class Label : public GuiBase |
MikamiUitOpen | 0:47718d3154d9 | 15 | { |
MikamiUitOpen | 0:47718d3154d9 | 16 | public: |
MikamiUitOpen | 0:47718d3154d9 | 17 | enum TextAlignMode { LEFT, CENTER, RIGHT }; |
MikamiUitOpen | 0:47718d3154d9 | 18 | // Constructor |
MikamiUitOpen | 0:47718d3154d9 | 19 | Label(uint16_t x, uint16_t y, const string str, |
MikamiUitOpen | 0:47718d3154d9 | 20 | TextAlignMode mode = LEFT, |
MikamiUitOpen | 0:47718d3154d9 | 21 | sFONT &fonts = Font12, |
MikamiUitOpen | 0:47718d3154d9 | 22 | uint32_t textColor = GuiBase::ENUM_TEXT, |
MikamiUitOpen | 0:47718d3154d9 | 23 | uint32_t backColor = GuiBase::ENUM_BACK); |
MikamiUitOpen | 0:47718d3154d9 | 24 | |
MikamiUitOpen | 0:47718d3154d9 | 25 | // Constructor without string |
MikamiUitOpen | 0:47718d3154d9 | 26 | Label(uint16_t x, uint16_t y, |
MikamiUitOpen | 0:47718d3154d9 | 27 | TextAlignMode mode = LEFT, |
MikamiUitOpen | 0:47718d3154d9 | 28 | sFONT &fonts = Font12, |
MikamiUitOpen | 0:47718d3154d9 | 29 | uint32_t textColor = GuiBase::ENUM_TEXT, |
MikamiUitOpen | 0:47718d3154d9 | 30 | uint32_t backColor = GuiBase::ENUM_BACK) |
MikamiUitOpen | 0:47718d3154d9 | 31 | : GuiBase(x, y, fonts, textColor, backColor), |
MikamiUitOpen | 0:47718d3154d9 | 32 | MODE_(mode), STR_(""), length_(0) {} |
MikamiUitOpen | 0:47718d3154d9 | 33 | |
MikamiUitOpen | 0:47718d3154d9 | 34 | void Draw() |
MikamiUitOpen | 0:47718d3154d9 | 35 | { Draw(STR_, TEXT_COLOR_); } |
MikamiUitOpen | 0:47718d3154d9 | 36 | |
MikamiUitOpen | 0:47718d3154d9 | 37 | void Draw(const string str) |
MikamiUitOpen | 0:47718d3154d9 | 38 | { Draw(str, TEXT_COLOR_); } |
MikamiUitOpen | 0:47718d3154d9 | 39 | |
MikamiUitOpen | 0:47718d3154d9 | 40 | void Draw(uint32_t textColor) |
MikamiUitOpen | 0:47718d3154d9 | 41 | { Draw(STR_, textColor); } |
MikamiUitOpen | 0:47718d3154d9 | 42 | |
MikamiUitOpen | 0:47718d3154d9 | 43 | void Draw(const string str, |
MikamiUitOpen | 0:47718d3154d9 | 44 | uint32_t textColor); |
MikamiUitOpen | 0:47718d3154d9 | 45 | |
MikamiUitOpen | 0:47718d3154d9 | 46 | private: |
MikamiUitOpen | 0:47718d3154d9 | 47 | const TextAlignMode MODE_; |
MikamiUitOpen | 0:47718d3154d9 | 48 | const string STR_; |
MikamiUitOpen | 0:47718d3154d9 | 49 | |
MikamiUitOpen | 0:47718d3154d9 | 50 | uint8_t length_; |
MikamiUitOpen | 0:47718d3154d9 | 51 | uint16_t PosX(uint16_t x); |
MikamiUitOpen | 0:47718d3154d9 | 52 | |
MikamiUitOpen | 0:47718d3154d9 | 53 | // disallow copy constructor and assignment operator |
MikamiUitOpen | 0:47718d3154d9 | 54 | Label(const Label&); |
MikamiUitOpen | 0:47718d3154d9 | 55 | Label& operator=(const Label&); |
MikamiUitOpen | 0:47718d3154d9 | 56 | }; |
MikamiUitOpen | 0:47718d3154d9 | 57 | } |
MikamiUitOpen | 0:47718d3154d9 | 58 | #endif // F746_LABEL_HPP |