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 ************************************************************************/
25 #include "QcAbstractStepValue.h"
26 #include "../QcHelper.h"
30 class QcSlider2D
: public QWidget
, public QcHelper
, public QcAbstractStepValue
33 Q_PROPERTY( float xValue READ xValue WRITE setXValue
)
34 Q_PROPERTY( float yValue READ yValue WRITE setYValue
)
35 Q_PROPERTY( float shiftScale READ dummyFloat WRITE setShiftScale
);
36 Q_PROPERTY( float ctrlScale READ dummyFloat WRITE setCtrlScale
);
37 Q_PROPERTY( float altScale READ dummyFloat WRITE setAltScale
);
38 Q_PROPERTY( float step READ dummyFloat WRITE setStep
)
42 float xValue() const { return _x
; }
43 float yValue() const { return _y
; }
44 void setXValue( float x
) { setValue( QPointF( x
, _y
), false ); }
45 void setYValue( float y
) { setValue( QPointF( _x
, y
), false ); }
46 void setStep( float f
) { _step
= f
;}
47 QSize
sizeHint() const { return QSize(150,150); }
48 QSize
minimumSizeHint() const { return QSize(30,30); }
50 void incrementX( double factor
= 1.f
);
51 void decrementX( double factor
= 1.f
);
52 void incrementY( double factor
= 1.f
);
53 void decrementY( double factor
= 1.f
);
59 QPointF
valueFromPos( const QPoint pos
);
60 void setValue( const QPointF val
, bool doAction
= true );
61 void mouseMoveEvent ( QMouseEvent
* );
62 void mousePressEvent ( QMouseEvent
* );
63 void keyPressEvent ( QKeyEvent
* );
64 void paintEvent ( QPaintEvent
* );