1 QRangeSlider : QAbstractStepValue {
2 *qtClass { ^"QcRangeSlider" }
4 *new { arg parent, bounds;
5 ^super.new( parent, bounds ).initQRangeSlider( bounds );
8 initQRangeSlider { arg bounds;
12 if( r.width > r.height ) {
13 this.orientation_( \horizontal );
15 this.orientation_( \vertical );
21 // FIXME for now we are using step instead
25 orientation_ { arg aSymbol;
26 this.setProperty( \orientation, QOrientation(aSymbol) );
30 ^this.getProperty( \loValue );
34 this.setProperty( \loValue, aFloat );
37 activeLo_ { arg aFloat;
43 ^this.getProperty( \hiValue );
47 this.setProperty( \hiValue, aFloat );
50 activeHi_ { arg aFloat;
60 this.hi_( this.lo + aFloat; )
63 activeRange_ { arg aFloat;
73 setSpanActive { arg lo, hi;
78 setDeviation { arg deviation, average;
79 this.lo_( average - deviation );
80 this.hi_( average + deviation );
84 ^this.palette.buttonText;
87 knobColor_ { arg color;
88 this.palette = this.palette.buttonText_(color);
92 ^this.getProperty(\grooveColor);
95 background_ { arg color;
96 this.setProperty(\grooveColor, color);
99 defaultGetDrag { ^Point(this.lo,this.hi); }
100 defaultCanReceiveDrag { ^(QView.currentDrag.class === Point); }
102 var pt = QView.currentDrag;
103 this.setSpanActive( pt.x, pt.y );