1 QListView : QItemViewBase {
5 *qtClass { ^'QcListWidget' }
7 mouseDownEvent { arg x, y, modifiers, buttonNumber, clickCount;
8 // Override QView:mouseDownEvent:
9 // If Ctrl / Cmd is pressed, try to start the drag after this event
10 // is processed, so that current item can be changed before.
11 if( (modifiers & QKeyModifiers.control) > 0 ) {
12 AppClock.sched( 0, {this.beginDrag(x,y)} );
15 modifiers = QKeyModifiers.toCocoa(modifiers);
16 ^this.mouseDown( x, y, modifiers, buttonNumber, clickCount );
19 selectionMode_ { arg mode;
29 this.invokeMethod( \clearSelection );
30 this.setProperty( \currentRow, -1 );
31 this.setProperty( \focusPolicy, 0 );
33 this.setProperty( \selectionMode, m );
37 var modes = [\none, \single, \multi, \extended, \contiguous];
38 var m = this.getProperty( \selectionMode );
43 var v = this.getProperty( \currentRow );
44 if( v < 0 ) { ^nil } { ^v };
48 this.setProperty( \currentRow, val ? -1 );
51 background { ^this.palette.base; }
52 background_ { arg color; this.palette = this.palette.base_(color); }
55 ^this.palette.baseText;
58 stringColor_ { arg color;
59 this.palette = this.palette.baseText_(color);
63 ^this.palette.highlightText;
66 selectedStringColor_ { arg color;
67 this.palette = this.palette.highlightText_(color);
71 ^this.palette.highlight;
74 hiliteColor_ { arg color;
75 this.palette = this.palette.highlight_(color);
78 enterKeyAction_ { arg func;
79 this.manageMethodConnection( enterKeyAction, func, 'returnPressed()', 'enterKey' );
80 enterKeyAction = func;
84 enterKeyAction.value( this );
87 colors_ { arg colorArray;
89 this.setProperty( \colors, colorArray );
92 defaultGetDrag { ^this.value; }
93 defaultCanReceiveDrag { ^QView.currentDrag.isNumber; }
95 this.valueAction = QView.currentDrag;