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 );
83 knobColor { ^this.getProperty(\knobColor) }
84 knobColor_ { arg color; this.setProperty(\knobColor, color) }
86 background { ^this.getProperty(\grooveColor) }
87 background_ { arg color; this.setProperty(\grooveColor, color) }
89 defaultGetDrag { ^Point(this.lo,this.hi); }
90 defaultCanReceiveDrag { ^(QView.currentDrag.class === Point); }
92 var pt = QView.currentDrag;
93 this.setSpanActive( pt.x, pt.y );