GUI parts for DISCO-F746NG. GuiBase, Button, ButtonGroup, Label, BlinkLabel, NumericLabel, SeekBar, SeekbarGroup

Dependents:   F746_SD_GraphicEqualizer_ren0620

Fork of F746_GUI by 不韋 呂

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 //  2016/04/07, Copyright (c) 2016 MIKAMI, Naoki
00006 //-----------------------------------------------------------
00007 
00008 #ifndef F746_BLINK_LABEL_HPP
00009 #define F746_BLINK_LABEL_HPP
00010 
00011 #include "Label.hpp"
00012 
00013 namespace Mikami
00014 {
00015     class BlinkLabel : public Label
00016     {
00017     public:
00018         // Constructor
00019         BlinkLabel(uint16_t x, uint16_t y, const string str,
00020                    TextAlignMode mode = LEFT,
00021                    sFONT &fonts = Font20,
00022                    uint32_t textColor = LCD_COLOR_RED,
00023                    uint32_t backColor = GuiBase::ENUM_BACK,
00024                    uint32_t on = 500, uint32_t off = 200)
00025             : Label(x, y, str, mode, fonts, textColor, backColor)
00026         {
00027             while (true)    // Blinking here
00028             {
00029                 wait_ms(on);
00030                 Draw(backColor);
00031                 wait_ms(off);
00032                 Draw(textColor);
00033             }
00034         }
00035 
00036     private:
00037         // disallow copy constructor and assignment operator
00038         BlinkLabel(const BlinkLabel&);
00039         BlinkLabel& operator=(const BlinkLabel&);
00040     };
00041 }
00042 #endif  // F746_BLINK_LABEL_HPP
00043