summaryrefslogtreecommitdiff
path: root/plugingui/slider.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/slider.h')
-rw-r--r--plugingui/slider.h47
1 files changed, 20 insertions, 27 deletions
diff --git a/plugingui/slider.h b/plugingui/slider.h
index f07ccff..01cbd54 100644
--- a/plugingui/slider.h
+++ b/plugingui/slider.h
@@ -24,8 +24,7 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_SLIDER_H__
-#define __DRUMGIZMO_SLIDER_H__
+#pragma once
#include "widget.h"
@@ -33,38 +32,32 @@ namespace GUI {
class Slider : public Widget {
public:
- Slider(Widget *parent);
+ Slider(Widget* parent);
- bool catchMouse() { return true; }
+ // From Widget:
+ bool catchMouse() override { return true; }
- void setValue(float value);
- float value();
+ void setValue(float value);
+ float value();
- void registerClickHandler(void (*handler)(void *), void *ptr);
+ Notifier<> clickNotifier;
- //protected:
- virtual void clicked() {}
-
- virtual void repaintEvent(RepaintEvent *e);
- virtual void buttonEvent(ButtonEvent *e);
- virtual void mouseMoveEvent(MouseMoveEvent *e);
+protected:
+ virtual void repaintEvent(RepaintEvent* repaintEvent) override;
+ virtual void buttonEvent(ButtonEvent* buttonEvent) override;
+ virtual void mouseMoveEvent(MouseMoveEvent* mouseMoveEvent) override;
private:
- typedef enum {
- up,
- down
- } state_t;
-
- float val;
- float maximum;
- float minimum;
+ enum class State {
+ up,
+ down
+ };
- state_t state;
-
- void (*handler)(void *);
- void *ptr;
-};
+ float currentValue;
+ float maximum;
+ float minimum;
+ State state;
};
-#endif/*__DRUMGIZMO_SLIDER_H__*/
+} // GUI::