1 QSlider : QAbstractStepValue {
6 *qtClass { ^"QcSlider" }
8 *new { arg parent, bounds;
9 ^super.new( parent, bounds ).initQSlider( bounds );
13 ^this.getProperty( \value );
17 this.setProperty( \value, argVal );
20 valueAction_ { arg val;
26 ^this.palette.buttonColor;
29 knobColor_ { arg color;
30 this.setProperty( \palette, this.palette.buttonColor_(color) );
33 initQSlider { arg bounds;
37 if( r.width > r.height ) {
38 this.orientation_( \horizontal );
40 this.orientation_( \vertical );
46 // FIXME for now we are using step instead
50 orientation_ { arg aSymbol;
51 orientation = aSymbol;
52 this.setProperty( \orientation, QOrientation(aSymbol) );
55 defaultKeyDownAction { arg char, modifiers, unicode, keycode;
56 var scale = this.getScale( modifiers );
58 $r, { this.valueAction = 1.0.rand },
59 $n, { this.valueAction = 0.0 },
60 $x, { this.valueAction = 1.0 },
61 $c, { this.valueAction = 0.5 },
64 16r5d, { this.increment(scale) },
65 16r1000013, { this.increment(scale) },
66 16r1000014, { this.increment(scale) },
67 16r5b, { this.decrement(scale) },
68 16r1000015, { this.decrement(scale) },
69 16r1000012, { this.decrement(scale) },
70 { ^this; } // if unhandled, let Qt process the event
75 ^true; // accept the event and stop its processing
78 defaultGetDrag { ^this.value; }
79 defaultCanReceiveDrag { ^QView.currentDrag.isNumber; }
81 this.valueAction = QView.currentDrag;