1 QSlider : QAbstractStepValue {
5 *qtClass { ^'QcSlider' }
7 *new { arg parent, bounds;
8 ^super.new( parent, bounds ).initQSlider( bounds );
12 ^this.getProperty( \value );
16 this.setProperty( \value, argVal );
19 valueAction_ { arg val;
24 step { ^this.getProperty(\step) }
26 thumbSize { ^this.getProperty(\handleLength) }
27 thumbSize_ { arg pixels; this.setProperty(\handleLength, pixels) }
29 knobColor { ^this.getProperty(\knobColor) }
30 knobColor_ { arg color; this.setProperty(\knobColor, color) }
32 background { ^this.getProperty(\grooveColor) }
33 background_ { arg color; this.setProperty(\grooveColor, color) }
35 initQSlider { arg bounds;
39 if( r.width > r.height ) {
40 this.orientation_( \horizontal );
42 this.orientation_( \vertical );
47 pixelStep { ^this.getProperty(\pixelStep) }
49 orientation_ { arg aSymbol;
50 orientation = aSymbol;
51 this.setProperty( \orientation, QOrientation(aSymbol) );
54 defaultKeyDownAction { arg char, modifiers, unicode, keycode, key;
55 var scale = this.getScale( modifiers );
57 $r, { this.valueAction = 1.0.rand },
58 $n, { this.valueAction = 0.0 },
59 $x, { this.valueAction = 1.0 },
60 $c, { this.valueAction = 0.5 },
63 16r5d, { this.increment(scale) },
64 16r1000013, { this.increment(scale) },
65 16r1000014, { this.increment(scale) },
66 16r5b, { this.decrement(scale) },
67 16r1000015, { this.decrement(scale) },
68 16r1000012, { this.decrement(scale) },
69 { ^this; } // if unhandled, let Qt process the event
74 ^true; // accept the event and stop its processing
77 defaultGetDrag { ^this.value; }
78 defaultCanReceiveDrag { ^QView.currentDrag.isNumber; }
80 this.valueAction = QView.currentDrag;