1 /************************************************************************
3 * Copyright 2010 Jakob Leben (jakob.leben@gmail.com)
5 * This file is part of SuperCollider Qt GUI.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ************************************************************************/
22 #ifndef QC_RANGE_SLIDER
23 #define QC_RANGE_SLIDER
25 #include "QcAbstractStepValue.h"
26 #include "../QcHelper.h"
27 #include "../style/style.hpp"
32 public QWidget
, QcHelper
, QcAbstractStepValue
, QtCollider::Style::Client
35 Q_PROPERTY( Qt::Orientation orientation
36 READ orientation WRITE setOrientation
);
37 Q_PROPERTY( double loValue READ loValue WRITE setLoValue
)
38 Q_PROPERTY( double hiValue READ hiValue WRITE setHiValue
)
39 Q_PROPERTY( double shiftScale READ dummyFloat WRITE setShiftScale
);
40 Q_PROPERTY( double ctrlScale READ dummyFloat WRITE setCtrlScale
);
41 Q_PROPERTY( double altScale READ dummyFloat WRITE setAltScale
);
42 Q_PROPERTY( double step READ dummyFloat WRITE setStep
)
43 Q_PROPERTY( QColor grooveColor READ grooveColor WRITE setGrooveColor
);
44 Q_PROPERTY( QColor focusColor READ focusColor WRITE setFocusColor
);
45 Q_PROPERTY( QColor knobColor READ knobColor WRITE setKnobColor
);
58 Qt::Orientation
orientation() const { return _ort
; }
59 void setOrientation( Qt::Orientation o
);
60 double loValue() const { return _lo
; }
61 void setLoValue( double );
62 double hiValue() const { return _hi
; }
63 void setHiValue( double );
64 void setRange( double val
, double range
);
65 void setStep( double f
) { _step
= f
; }
66 QSize
sizeHint() const;
67 QSize
minimumSizeHint() const;
69 const QColor
& knobColor() const
70 { return _knobColor
.isValid() ? _knobColor
: palette().color(QPalette::ButtonText
); }
71 void setKnobColor(const QColor
&c
) { _knobColor
= c
; update(); }
74 void increment( double factor
);
75 void decrement( double factor
);
83 double valueFromPos( const QPoint
& pos
);
84 void moveBy( double );
87 void mouseMoveEvent ( QMouseEvent
* );
88 void mousePressEvent ( QMouseEvent
* );
89 void mouseReleaseEvent ( QMouseEvent
* );
90 void keyPressEvent ( QKeyEvent
* );
91 void paintEvent ( QPaintEvent
* );
98 double dragVal
, dragRange
;