00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PLUGIN_SLIDER_H
00024 #define PLUGIN_SLIDER_H
00025
00026 #include <QWidget>
00027 #include <QPainter>
00028 #include <QMouseEvent>
00029
00030 class PluginControlPort;
00031
00032 class PluginSlider : public QWidget
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 PluginSlider(PluginControlPort* port);
00038 ~PluginSlider(){};
00039
00040 void paint(QPainter *);
00041 void reset_default_value();
00042 void update_slider_position();
00043
00044 protected:
00045 void paintEvent(QPaintEvent *);
00046 void mousePressEvent(QMouseEvent *e);
00047 void mouseMoveEvent(QMouseEvent *e);
00048 void mouseReleaseEvent(QMouseEvent *e);
00049 void leaveEvent( QEvent* );
00050 void enterEvent( QEvent* );
00051 void wheelEvent(QWheelEvent* e );
00052
00053 private:
00054 PluginControlPort* m_port;
00055 float m_max;
00056 float m_min;
00057 float m_value;
00058 float m_stepvalue;
00059 int m_xpos;
00060 bool highlight;
00061 bool dragging;
00062
00063 void calculate_new_value(float mouseX);
00064
00065 signals:
00066 void sliderValueChanged(float value);
00067 };
00068
00069 #endif
00070
00071