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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BlinkLabel.hpp Source File

BlinkLabel.hpp

00001 //-----------------------------------------------------------
00002 //  BlinkLabel class -- derived class of Label class
00003 //      For displaying error message
00004 //
00005 //  2017/01/25, Copyright (c) 2017 MIKAMI, Naoki
00006 //-----------------------------------------------------------
00007 
00008 #ifndef F746_BLINK_LABEL_HPP
00009 #define F746_BLINK_LABEL_HPP
00010 
00011 #include "Label.hpp"
00012 #include "ResetButton.hpp"
00013 
00014 namespace Mikami
00015 {
00016     class BlinkLabel : public Label
00017     {
00018     public:
00019         // Constructor
00020         BlinkLabel(uint16_t x, uint16_t y, const string str,
00021                    TextAlignMode mode = LEFT,
00022                    sFONT &fonts = Font20,
00023                    uint32_t textColor = LCD_COLOR_RED,
00024                    uint32_t backColor = GuiBase::ENUM_BACK,
00025                    uint32_t on = 500, uint32_t off = 200)
00026             : Label(x, y, str, mode, fonts, textColor, backColor)
00027         {
00028             ResetButton reset;
00029             while (true)    // Blinking here
00030             {
00031                 wait_ms(on);
00032                 Draw(backColor);
00033                 wait_ms(off);
00034                 Draw(textColor);
00035                 reset.DoIfTouched();
00036             }
00037         }
00038 
00039     private:
00040         // disallow copy constructor and assignment operator
00041         BlinkLabel(const BlinkLabel&);
00042         BlinkLabel& operator=(const BlinkLabel&);
00043     };
00044 }
00045 #endif  // F746_BLINK_LABEL_HPP
00046