annotate widgets/Thumbwheel.h @ 136:a859b87162ca

* beginnings of drag up/down in layers as appropriate
author Chris Cannam
date Mon, 21 Aug 2006 16:26:35 +0000
parents 9e6b3e239b9d
children 793df5f0c6cb
rev   line source
Chris@132 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@132 2
Chris@132 3 /*
Chris@132 4 Sonic Visualiser
Chris@132 5 An audio file viewer and annotation editor.
Chris@132 6 Centre for Digital Music, Queen Mary, University of London.
Chris@132 7 This file copyright 2006 Chris Cannam.
Chris@132 8
Chris@132 9 This program is free software; you can redistribute it and/or
Chris@132 10 modify it under the terms of the GNU General Public License as
Chris@132 11 published by the Free Software Foundation; either version 2 of the
Chris@132 12 License, or (at your option) any later version. See the file
Chris@132 13 COPYING included with this distribution for more information.
Chris@132 14 */
Chris@132 15
Chris@132 16 #ifndef _THUMBWHEEL_H_
Chris@132 17 #define _THUMBWHEEL_H_
Chris@132 18
Chris@132 19 #include <QWidget>
Chris@132 20
Chris@132 21 class Thumbwheel : public QWidget
Chris@132 22 {
Chris@132 23 Q_OBJECT
Chris@132 24
Chris@132 25 public:
Chris@133 26 Thumbwheel(Qt::Orientation orientation, QWidget *parent = 0);
Chris@132 27 virtual ~Thumbwheel();
Chris@132 28
Chris@133 29 int getMinimumValue() const;
Chris@133 30 int getMaximumValue() const;
Chris@133 31 int getDefaultValue() const;
Chris@132 32 float getSpeed() const;
Chris@132 33 bool getTracking() const;
Chris@132 34 bool getShowScale() const;
Chris@132 35 int getValue() const;
Chris@132 36
Chris@132 37 virtual void mousePressEvent(QMouseEvent *e);
Chris@132 38 virtual void mouseDoubleClickEvent(QMouseEvent *e);
Chris@132 39 virtual void mouseMoveEvent(QMouseEvent *e);
Chris@132 40 virtual void mouseReleaseEvent(QMouseEvent *e);
Chris@132 41 virtual void wheelEvent(QWheelEvent *e);
Chris@132 42 virtual void paintEvent(QPaintEvent *e);
Chris@132 43
Chris@132 44 QSize sizeHint() const;
Chris@132 45
Chris@132 46 signals:
Chris@132 47 void valueChanged(int);
Chris@132 48
Chris@133 49 public slots:
Chris@133 50 void setMinimumValue(int min);
Chris@133 51 void setMaximumValue(int max);
Chris@133 52 void setDefaultValue(int deft);
Chris@133 53 void setSpeed(float speed);
Chris@133 54 void setTracking(bool tracking);
Chris@133 55 void setShowScale(bool show);
Chris@133 56 void setValue(int value);
Chris@133 57 void resetToDefault();
Chris@133 58
Chris@132 59 private:
Chris@132 60 int m_min;
Chris@132 61 int m_max;
Chris@132 62 int m_default;
Chris@132 63 int m_value;
Chris@132 64 Qt::Orientation m_orientation;
Chris@132 65 float m_speed;
Chris@132 66 bool m_tracking;
Chris@132 67 bool m_showScale;
Chris@132 68 bool m_clicked;
Chris@133 69 bool m_atDefault;
Chris@132 70 QPoint m_clickPos;
Chris@132 71 int m_clickValue;
Chris@132 72 };
Chris@132 73
Chris@132 74 #endif