From ca384e485956059d5d427fbe07a7b2277c43680e Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 9 Nov 2015 21:47:15 +0100 Subject: Refactor ProgressBar. --- plugingui/progressbar.h | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'plugingui/progressbar.h') diff --git a/plugingui/progressbar.h b/plugingui/progressbar.h index 9d08a9e..e5e567d 100644 --- a/plugingui/progressbar.h +++ b/plugingui/progressbar.h @@ -24,48 +24,47 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_PROGRESSBAR_H__ -#define __DRUMGIZMO_PROGRESSBAR_H__ +#pragma once #include "widget.h" -#include - #include "guievent.h" #include "painter.h" namespace GUI { +enum class ProgressBarState +{ + Red, + Green, + Blue, + Off +}; + class ProgressBar : public Widget { public: - ProgressBar(Widget *parent); + ProgressBar(Widget *parent); + ~ProgressBar(); - float progress(); - void setProgress(float progress); + float progress(); + void setProgress(float progress); - typedef enum { - red, - green, - blue, - off - } state_t; - void setState(state_t state); + void setState(ProgressBarState state); - //protected: - virtual void repaintEvent(RepaintEvent *e); +protected: + // From Widget: + virtual void repaintEvent(RepaintEvent *e) override; private: - state_t state; + ProgressBarState state; - Painter::Bar bar_bg; + Painter::Bar bar_bg; - Painter::Bar bar_green; - Painter::Bar bar_blue; - Painter::Bar bar_red; - - float _progress; -}; + Painter::Bar bar_green; + Painter::Bar bar_blue; + Painter::Bar bar_red; + float _progress; }; -#endif/*__DRUMGIZMO_PROGRESSBAR_H__*/ +} // GUI:: -- cgit v1.2.3