1 QSlider2D : QAbstractStepValue {
2 *qtClass { ^'QcSlider2D' }
4 *new { arg parent, bounds;
5 var me = super.new( parent, bounds );
6 me.connectMethod( 'randomize()', \randomize );
11 // FIXME for now we are using step instead
16 // FIXME for now we are using step instead
21 ^this.getProperty( \xValue );
25 this.setProperty( \xValue, aFloat );
28 activex_ { arg aFloat;
34 ^this.getProperty( \yValue );
38 this.setProperty( \yValue, aFloat );
41 activey_ { arg aFloat;
51 setXYActive { arg x, y;
56 incrementX { arg factor=1.0; this.invokeMethod( \incrementX, factor.asFloat ); }
57 decrementX { arg factor=1.0; this.invokeMethod( \decrementX, factor.asFloat ); }
58 incrementY { arg factor=1.0; this.invokeMethod( \incrementY, factor.asFloat ); }
59 decrementY { arg factor=1.0; this.invokeMethod( \decrementY, factor.asFloat ); }
62 this.setXYActive( 1.0.rand, 1.0.rand );
65 knobColor { ^this.getProperty(\knobColor) }
66 knobColor_ { arg color; this.setProperty(\knobColor, color) }
68 background { ^this.getProperty(\grooveColor) }
69 background_ { arg color; this.setProperty(\grooveColor, color) }
71 defaultGetDrag { ^Point(this.x,this.y); }
72 defaultCanReceiveDrag { ^(QView.currentDrag.class === Point); }
74 var pt = QView.currentDrag;
75 this.setXYActive( pt.x, pt.y );