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