GUI parts for DISCO-F746NG. GuiBase, Button, ButtonGroup, ResetButton, Label, BlinkLabel, NumericLabel, SeekBar, SeekbarGroup
Dependencies: Array_Matrix BSP_DISCO_F746NG
Fork of F746_GUI by
BlinkLabel.hpp@6:b8f197b0012c, 2016-04-12 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Tue Apr 12 04:15:41 2016 +0000
- Revision:
- 6:b8f197b0012c
- Parent:
- 4:cbf7ed9092a3
- Child:
- 22:fa0181712d9c
7
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 4:cbf7ed9092a3 | 1 | //----------------------------------------------------------- |
MikamiUitOpen | 4:cbf7ed9092a3 | 2 | // BlinkLabel class -- derived class of Label class |
MikamiUitOpen | 6:b8f197b0012c | 3 | // For displaying error message |
MikamiUitOpen | 4:cbf7ed9092a3 | 4 | // |
MikamiUitOpen | 4:cbf7ed9092a3 | 5 | // 2016/04/07, Copyright (c) 2016 MIKAMI, Naoki |
MikamiUitOpen | 4:cbf7ed9092a3 | 6 | //----------------------------------------------------------- |
MikamiUitOpen | 4:cbf7ed9092a3 | 7 | |
MikamiUitOpen | 4:cbf7ed9092a3 | 8 | #ifndef F746_BLINK_LABEL_HPP |
MikamiUitOpen | 4:cbf7ed9092a3 | 9 | #define F746_BLINK_LABEL_HPP |
MikamiUitOpen | 4:cbf7ed9092a3 | 10 | |
MikamiUitOpen | 4:cbf7ed9092a3 | 11 | #include "Label.hpp" |
MikamiUitOpen | 4:cbf7ed9092a3 | 12 | |
MikamiUitOpen | 4:cbf7ed9092a3 | 13 | namespace Mikami |
MikamiUitOpen | 4:cbf7ed9092a3 | 14 | { |
MikamiUitOpen | 4:cbf7ed9092a3 | 15 | class BlinkLabel : public Label |
MikamiUitOpen | 4:cbf7ed9092a3 | 16 | { |
MikamiUitOpen | 4:cbf7ed9092a3 | 17 | public: |
MikamiUitOpen | 4:cbf7ed9092a3 | 18 | // Constructor |
MikamiUitOpen | 4:cbf7ed9092a3 | 19 | BlinkLabel(uint16_t x, uint16_t y, const string str, |
MikamiUitOpen | 4:cbf7ed9092a3 | 20 | TextAlignMode mode = LEFT, |
MikamiUitOpen | 4:cbf7ed9092a3 | 21 | sFONT &fonts = Font20, |
MikamiUitOpen | 4:cbf7ed9092a3 | 22 | uint32_t textColor = LCD_COLOR_RED, |
MikamiUitOpen | 4:cbf7ed9092a3 | 23 | uint32_t backColor = GuiBase::ENUM_BACK, |
MikamiUitOpen | 4:cbf7ed9092a3 | 24 | uint32_t on = 500, uint32_t off = 200) |
MikamiUitOpen | 4:cbf7ed9092a3 | 25 | : Label(x, y, str, mode, fonts, textColor, backColor) |
MikamiUitOpen | 4:cbf7ed9092a3 | 26 | { |
MikamiUitOpen | 4:cbf7ed9092a3 | 27 | while (true) // Blinking here |
MikamiUitOpen | 4:cbf7ed9092a3 | 28 | { |
MikamiUitOpen | 4:cbf7ed9092a3 | 29 | wait_ms(on); |
MikamiUitOpen | 4:cbf7ed9092a3 | 30 | Draw(backColor); |
MikamiUitOpen | 4:cbf7ed9092a3 | 31 | wait_ms(off); |
MikamiUitOpen | 4:cbf7ed9092a3 | 32 | Draw(textColor); |
MikamiUitOpen | 4:cbf7ed9092a3 | 33 | } |
MikamiUitOpen | 4:cbf7ed9092a3 | 34 | } |
MikamiUitOpen | 4:cbf7ed9092a3 | 35 | |
MikamiUitOpen | 4:cbf7ed9092a3 | 36 | private: |
MikamiUitOpen | 4:cbf7ed9092a3 | 37 | // disallow copy constructor and assignment operator |
MikamiUitOpen | 4:cbf7ed9092a3 | 38 | BlinkLabel(const BlinkLabel&); |
MikamiUitOpen | 4:cbf7ed9092a3 | 39 | BlinkLabel& operator=(const BlinkLabel&); |
MikamiUitOpen | 4:cbf7ed9092a3 | 40 | }; |
MikamiUitOpen | 4:cbf7ed9092a3 | 41 | } |
MikamiUitOpen | 4:cbf7ed9092a3 | 42 | #endif // F746_BLINK_LABEL_HPP |
MikamiUitOpen | 4:cbf7ed9092a3 | 43 |