supernova: fixes for boost-1.49 and gcc-4.7
[supercollider.git] / SCClassLibrary / QtCollider / QSlider2D.sc
blob3fa061fccfcae1d3ba0c9070f32afecb0c7e61bf
1 QSlider2D : QAbstractStepValue {
2   *qtClass { ^"QcSlider2D" }
4   *new { arg parent, bounds;
5     var me = super.new( parent, bounds );
6     me.connectMethod( "randomize()", \randomize );
7     ^me;
8   }
10   pixelStepX {
11     // FIXME for now we are using step instead
12     ^this.step;
13   }
15   pixelStepY {
16     // FIXME for now we are using step instead
17     ^this.step;
18   }
20   x {
21     ^this.getProperty( \xValue );
22   }
24   x_ { arg aFloat;
25     this.setProperty( \xValue, aFloat );
26   }
28   activex_ { arg aFloat;
29     this.x_(aFloat);
30     this.doAction;
31   }
33   y {
34     ^this.getProperty( \yValue );
35   }
37   y_ { arg aFloat;
38     this.setProperty( \yValue, aFloat );
39   }
41   activey_ { arg aFloat;
42     this.y_(aFloat);
43     this.doAction;
44   }
46   setXY { arg x, y;
47     this.x_(x);
48     this.y_(y);
49   }
51   setXYActive { arg x, y;
52     this.setXY(x,y);
53     this.doAction;
54   }
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 ); }
61   randomize {
62     this.setXYActive( 1.0.rand, 1.0.rand );
63   }
65   knobColor {
66     ^this.palette.buttonText;
67   }
69   knobColor_ { arg color;
70     this.palette = this.palette.buttonText_(color);
71   }
73   background {
74     ^this.getProperty(\grooveColor);
75   }
77   background_ { arg color;
78     this.setProperty(\grooveColor, color);
79   }
81   defaultGetDrag { ^Point(this.x,this.y); }
82   defaultCanReceiveDrag { ^(QView.currentDrag.class === Point); }
83   defaultReceiveDrag {
84     var pt = QView.currentDrag;
85     this.setXYActive( pt.x, pt.y );
86   }