00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef IGSOQT_THUMBWHEEL_H
00023 #define IGSOQT_THUMBWHEEL_H
00024
00025 #include "Iguana/Studio/interface/config.h"
00026
00027 #include <qwidget.h>
00028 #include <qrangecontrol.h>
00029
00030 class QPixmap;
00031 class IgSoAnyThumbWheel;
00032
00033
00034
00035 class IGUANA_STUDIO_API IgSoQtThumbWheel : public QWidget, public QRangeControl
00036 {
00037 Q_OBJECT
00038
00039 public:
00040 enum Orientation { Horizontal, Vertical };
00041
00042 IgSoQtThumbWheel( QWidget * parent = 0, const char * name = 0 );
00043 IgSoQtThumbWheel( Orientation, QWidget * parent = 0, const char * name = 0 );
00044 ~IgSoQtThumbWheel(void);
00045
00046 void setOrientation( Orientation );
00047 Orientation orientation(void) const;
00048
00049 void setValue( float value );
00050 float value(void) const;
00051
00052 void setEnabled( bool enable );
00053 bool isEnabled(void) const;
00054
00055 enum boundaryHandling {
00056 CLAMP,
00057 MODULATE,
00058 ACCUMULATE
00059 };
00060 void setRangeBoundaryHandling( boundaryHandling handling );
00061 boundaryHandling getRangeBoundaryHandling(void) const;
00062
00063 QSize sizeHint(void) const;
00064
00065 signals:
00066 void wheelPressed(void);
00067 void wheelMoved(float value);
00068 void wheelReleased(void);
00069
00070 protected:
00071 void paintEvent(QPaintEvent *);
00072
00073 void mousePressEvent(QMouseEvent *);
00074 void mouseReleaseEvent(QMouseEvent *);
00075 void mouseMoveEvent(QMouseEvent *);
00076
00077 private:
00078 void constructor( Orientation );
00079
00080 IgSoQtThumbWheel( const IgSoQtThumbWheel & wheel );
00081 IgSoQtThumbWheel & operator = ( const IgSoQtThumbWheel & wheel );
00082
00083 enum State { Idle, Dragging, Disabled } state;
00084
00085 Orientation orient;
00086 float wheelValue, tempWheelValue;
00087 int mouseDownPos, mouseLastPos;
00088
00089 void initWheel( int diameter, int width );
00090
00091 IgSoAnyThumbWheel * wheel;
00092 QPixmap ** pixmaps;
00093 int numPixmaps;
00094 int currentPixmap;
00095
00096 };
00097
00098
00099
00100 #endif // ! IGSOQT_THUMBWHEEL_H