Removing an old, cherished, yet pointless caveat "This documentation is
[supercollider.git] / Help / GUI / Cocoa-GUI / SCEnvelopeView.html
blobe1d03bedc9404bdd999a830166dffb33891021a3
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #001bec}
15 p.p6 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; min-height: 12.0px}
16 p.p7 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica}
17 p.p8 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica; min-height: 14.0px}
18 p.p9 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica}
19 p.p10 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica; min-height: 14.0px}
20 p.p11 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
21 p.p12 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco}
22 p.p13 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
23 p.p14 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica; min-height: 17.0px}
24 p.p15 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Monaco; min-height: 16.0px}
25 p.p16 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #406c0f}
26 p.p17 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #9a2a1b}
27 p.p18 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #001db9}
28 span.s1 {font: 18.0px Helvetica}
29 span.s2 {color: #000000}
30 span.s3 {text-decoration: underline}
31 span.s4 {color: #6f7178}
32 span.s5 {font: 9.0px Monaco}
33 span.s6 {color: #001db9}
34 span.s7 {color: #606060}
35 span.s8 {color: #6f7284}
36 span.s9 {color: #6d7086}
37 span.s10 {color: #6e7185}
38 span.s11 {color: #5e689f}
39 span.s12 {color: #1b46d8}
40 span.s13 {color: #3151cd}
41 span.s14 {font: 12.0px Monaco}
42 span.s15 {color: #2853d2}
43 span.s16 {color: #2d4fd2}
44 span.s17 {color: #6f7181}
45 span.s18 {color: #6c6f88}
46 span.s19 {font: 14.0px Helvetica}
47 span.s20 {font: 12.0px Helvetica}
48 span.Apple-tab-span {white-space:pre}
49 </style>
50 </head>
51 <body>
52 <p class="p1"><span class="s1"><b>SCEnvelopeView<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b>a configurable view with nodes and connections</b><span class="s1"><b><span class="Apple-tab-span"> </span></b></span></p>
53 <p class="p2"><br></p>
54 <p class="p1"><b>Inherits from: Object : SCView</b></p>
55 <p class="p3"><br></p>
56 <p class="p1">A view which can grapically display nodes at x/y coordinates, connection lines, cross-connections, node markers, and labels. All of the values for these are stored in arrays. While this view is typically used to make editable envelopes interfaces, it can be used to draw very complex interconnection graphs as well.</p>
57 <p class="p2"><br></p>
58 <p class="p4"><b>Some Important Issues Regarding SCEnvelopeView</b></p>
59 <p class="p2"><br></p>
60 <p class="p1">The instance variable <b>step</b> must be explicitly set for the <b>defautlKeyDownAction</b> to work.</p>
61 <p class="p2"><br></p>
62 <p class="p5"><span class="s2"><b>See also:</b> <a href="SCMultiSliderView.html"><span class="s3">SCMultiSliderView</span></a>, <a href="SCEnvelopeEdit.html"><span class="s3">SCEnvelopeEdit</span></a></span></p>
63 <p class="p2"><br></p>
64 <p class="p4"><b>Creation / Class Methods</b></p>
65 <p class="p6"><br></p>
66 <p class="p7"><b><span class="Apple-tab-span"> </span>*new (parent, bounds)</b></p>
67 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
68 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>parent </b>- The parent view.</p>
69 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>bounds </b>- An instance of <a href="../../Geometry/Rect.html"><span class="s4">Rect</span></a>, or a <a href="../../Geometry/Point.html"><span class="s4">Point</span></a> indicating width@height.</p>
70 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
71 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s5">(</span></p>
72 <p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>w = <span class="s6">Window</span>(<span class="s7">"envelope"</span>, <span class="s6">Rect</span>(150 , <span class="s6">Window</span>.screenBounds.height-250, 250, 100)).front;</p>
73 <p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>b = <span class="s6">EnvelopeView</span>(w, <span class="s6">Rect</span>(10, 10, 230, 70))</p>
74 <p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.resize_(5)</p>
75 <p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.action_({<span class="s6">arg</span> b; [b.index,b.value].postln})</p>
76 <p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.value_([[0.0, 0.15, 0.5, 1.0],[0.1,1.0,0.7,0.0]])</p>
77 <p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.curves_([5,5,-5]);</p>
78 <p class="p12"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>)<span class="Apple-tab-span"> </span></p>
79 <p class="p6"><br></p>
80 <p class="p13"><b>Accessing Instance and Class Variables</b></p>
81 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
82 <p class="p7"><b><span class="Apple-tab-span"> </span>editable</b></p>
83 <p class="p7"><b><span class="Apple-tab-span"> </span>editable_ (val)</b></p>
84 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
85 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Determines if the any node is editable.</p>
86 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>val </b>- An instance of <a href="../../Core/Boolean.html"><span class="s8">Boolean</span></a>.</p>
87 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
88 <p class="p7"><b><span class="Apple-tab-span"> </span>setEditable (index, boolean)</b></p>
89 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
90 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Determines if the the node at index is editable.</p>
91 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>index </b>-an integer.</p>
92 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>boolean </b>- An instance of <a href="../../Core/Boolean.html"><span class="s8">Boolean</span></a>.</p>
93 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
94 <p class="p7"><b><span class="Apple-tab-span"> </span>step</b></p>
95 <p class="p7"><b><span class="Apple-tab-span"> </span>step_ (stepSize)</b></p>
96 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
97 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Quantizes the values to the nearest multiple of stepSize.</p>
98 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>stepSize </b>- An instance of <a href="../../Math/Float.html"><span class="s9">Float</span></a>.</p>
99 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
100 <p class="p7"><b><span class="Apple-tab-span"> </span>value</b></p>
101 <p class="p7"><b><span class="Apple-tab-span"> </span>value_ (val)</b></p>
102 <p class="p8"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></p>
103 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Gets/sets the property, \value, by calling get/setProperty(\value, <b>val</b>). The setter also sets <b>size</b> to the size of <b>val</b>. This will not do the <b>action</b> of the slider.</p>
104 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>val </b>- An instance of <a href="../../Collections/Array.html"><span class="s10">Array</span></a>. The values mus be between 0 and 1. The form of the array must be:</p>
105 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
106 <p class="p12"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[ [ x1, x2, x3, ... ], [ y1, y2, y3, ... ] ]</p>
107 <p class="p8"><br></p>
108 <p class="p7"><b><span class="Apple-tab-span"> </span>valueAction_ (val)</b></p>
109 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
110 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Sets the property, \value, by calling (\value, <b>val</b>). Also sets <b>size</b> to the size of <b>val. </b>Does the sliders <b>action</b>.</p>
111 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>val </b>- An instance of <a href="../../Collections/Array.html"><span class="s10">Array</span></a>. The values mus be between 0 and 1 . The form of the array must be:</p>
112 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
113 <p class="p12"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[ [ x1, x2, x3, ... ], [ y1, y2, y3, ... ] ]</p>
114 <p class="p14"><br></p>
115 <p class="p7"><b><span class="Apple-tab-span"> </span>index</b></p>
116 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
117 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Gets theselected index. -1 if none selected.</p>
118 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>inx </b>- an integer.</p>
119 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
120 <p class="p7"><b><span class="Apple-tab-span"> </span>lastIndex</b></p>
121 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
122 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Returns the index last selected.</p>
123 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
124 <p class="p7"><b><span class="Apple-tab-span"> </span>selectIndex (index)</b></p>
125 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
126 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Selects the node at index, and refreshes the view.<span class="Apple-converted-space"> </span></p>
127 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>index </b>- An integer.</p>
128 <p class="p7"><b><span class="Apple-tab-span"> </span>x</b></p>
129 <p class="p7"><b><span class="Apple-tab-span"> </span>y</b></p>
130 <p class="p7"><b><span class="Apple-tab-span"> </span>x_ (ax)</b></p>
131 <p class="p7"><b><span class="Apple-tab-span"> </span>y_ (ay)</b></p>
132 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
133 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Get/set the x or y value at the selected <b>index</b>.</p>
134 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>ay </b>- An instance of <a href="../../Math/Float.html"><span class="s11">Float</span></a>, between 0 and 1</p>
135 <p class="p8"><br></p>
136 <p class="p7"><b><span class="Apple-tab-span"> </span>currentvalue</b></p>
137 <p class="p7"><b><span class="Apple-tab-span"> </span>currentvalue_ (iny)</b></p>
138 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
139 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Gets/sets the y - value at the current <b>index</b>.</p>
140 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>iny </b>- A float between 0 and 1.</p>
141 <p class="p6"><br></p>
142 <p class="p7"><b><span class="Apple-tab-span"> </span>setString (index, astring)</b></p>
143 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
144 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Draw the string inside the thumb at index. Make sure that ths stroke color contrasts the fill color.</p>
145 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>index </b>- An integer.</p>
146 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>astring </b>- An instance of <a href="../../Collections/String.html"><span class="s11">String</span></a>.</p>
147 <p class="p6"><br></p>
148 <p class="p7"><b><span class="Apple-tab-span"> </span>strings_ (astrings)</b></p>
149 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
150 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Draw a string inside the thumb at the corresponding index in the array. Make sure that ths stroke color contrasts the fill color.</p>
151 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>astrings </b>- An <a href="../../Collections/Array.html"><span class="s11">Array</span></a> of <a href="../../Collections/String.html"><span class="s11">String</span></a>s;</p>
152 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
153 <p class="p7"><span class="Apple-tab-span"> </span><b>curves</b></p>
154 <p class="p7"><span class="Apple-tab-span"> </span><b>curves_(incurves)</b></p>
155 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Set a shape to draw the connection between points. The shapes defined by <a href="../../Control/Env.html"><span class="s12">Env</span></a> are accepted.</p>
156 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>incurves</b> - An<span class="Apple-converted-space">  </span><a href="../../Collections/Array.html"><span class="s11">Array</span></a> of Symbols, An<span class="Apple-converted-space">  </span><a href="../../Collections/Array.html"><span class="s11">Array</span></a> of <a href="../../Math/SimpleNumber.html"><span class="s13">SimpleNumber</span></a>s, a <a href="../../Core/Symbol.html"><span class="s13">Symbol</span></a> or a <a href="../../Math/SimpleNumber.html"><span class="s13">SimpleNumber</span></a></p>
157 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
158 <p class="p7"><span class="Apple-tab-span"> </span><b>setEnv_(env)</b></p>
159 <p class="p7"><span class="s14"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span>Set an <a href="../../Control/Env.html"><span class="s13">Env</span></a> to be shown in the view.</p>
160 <p class="p15"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
161 <p class="p7"><b><span class="Apple-tab-span"> </span>grid</b></p>
162 <p class="p7"><b><span class="Apple-tab-span"> </span>grid_(point)</b></p>
163 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Set a grid using a <a href="../../Geometry/Point.html"><span class="s15">Point</span></a>. x and y correspond to times and levels respectively. Specify a value of 0.0 if you do not want that axis to be drawn.</p>
164 <p class="p15"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
165 <p class="p7"><b><span class="Apple-tab-span"> </span>gridOn</b></p>
166 <p class="p7"><b><span class="Apple-tab-span"> </span>gridOn_(flag)</b></p>
167 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Show a grid.<span class="Apple-converted-space"> </span></p>
168 <p class="p7"><span class="s14"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><b>flag</b><span class="s14"> </span>- a false or true</p>
169 <p class="p8"><br></p>
170 <p class="p7"><b><span class="Apple-tab-span"> </span>gridColor</b></p>
171 <p class="p7"><b><span class="Apple-tab-span"> </span>gridColor_</b></p>
172 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Set the <a href="../GUI-Tools/Color.html"><span class="s16">Color</span></a> of the grid.</p>
173 <p class="p15"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
174 <p class="p7"><b><span class="Apple-tab-span"> </span>connect (from, aconnections)</b></p>
175 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
176 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Replaces the connections which were drawn at init time, and then draws new ones from the index, <b>from,</b> to the each of the <b>aconnections </b>indexes .</p>
177 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>from </b>- An integer. The index form which the lines originate.</p>
178 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>aconnections </b>- An Array of numbers. The indexes to which the lines are drawn.</p>
179 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
180 <p class="p7"><b><span class="Apple-tab-span"> </span>metaAction_(arg1)</b></p>
181 <p class="p7"><b><span class="Apple-tab-span"> </span>metaAction</b></p>
182 <p class="p8"><b><span class="Apple-tab-span"> </span></b><span class="Apple-tab-span"> </span></p>
183 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Gets/sets a function to be evaluate on Ctrl-click</p>
184 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>arg1 - </b>An instance of <a href="../../Core/Kernel/Function.html"><span class="s17">Function</span></a>. Default value is nil.</p>
185 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
186 <p class="p13"><b>Customizing Appearance</b></p>
187 <p class="p8"><span class="Apple-tab-span"> </span></p>
188 <p class="p7"><b><span class="Apple-tab-span"> </span>strokeColor_ (acolor)</b></p>
189 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
190 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The line and text color of the view.</p>
191 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>acolor </b>- An instance of <a href="../GUI-Tools/Color.html"><span class="s18">Color</span></a>.</p>
192 <p class="p6"><br></p>
193 <p class="p7"><b><span class="Apple-tab-span"> </span>colors_ (strokec, fillc)</b></p>
194 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
195 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Sets the stroke and fill colors of the view.</p>
196 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>strokec </b>- An instance of <a href="../GUI-Tools/Color.html"><span class="s18">Color</span></a>.</p>
197 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>fillc </b>- An instance of <a href="../GUI-Tools/Color.html"><span class="s18">Color</span></a>.</p>
198 <p class="p6"><br></p>
199 <p class="p7"><b><span class="Apple-tab-span"> </span>drawLines (abool)</b></p>
200 <p class="p7"><b><span class="Apple-tab-span"> </span>drawLines_ (abool)</b></p>
201 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
202 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Draws connecting lines between the nodes.</p>
203 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>abool </b>- An instance of <a href="../../Core/Boolean.html"><span class="s10">Boolean</span></a>. default is false.</p>
204 <p class="p6"><br></p>
205 <p class="p7"><b><span class="Apple-tab-span"> </span>drawRects_ (abool)</b></p>
206 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
207 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Draws rectangles (thumbs) at the nodes .</p>
208 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>abool </b>- An instance of <a href="../../Core/Boolean.html"><span class="s10">Boolean</span></a>. default is true.</p>
209 <p class="p10"><br></p>
210 <p class="p7"><b><span class="Apple-tab-span"> </span>fillColor_ (color)</b></p>
211 <p class="p7"><b><span class="Apple-tab-span"> </span>setFillColor (index, color)</b></p>
212 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
213 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The line and text color of the all the nodex (and their text), or of a specific node at indes.</p>
214 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>index </b>- An integer.</p>
215 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>color </b>- An instance of <a href="../GUI-Tools/Color.html"><span class="s11">Color</span></a>.</p>
216 <p class="p8"><br></p>
217 <p class="p7"><b><span class="Apple-tab-span"> </span>thumbWidth_ (width)</b></p>
218 <p class="p7"><b><span class="Apple-tab-span"> </span>thumbHeight_ (height)</b></p>
219 <p class="p7"><b><span class="Apple-tab-span"> </span>thumbSize_ (size)</b></p>
220 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
221 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Set the width, height, or size(both) of all th thumbs.</p>
222 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>width, height, size </b>- The number of pixels.</p>
223 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
224 <p class="p7"><b><span class="Apple-tab-span"> </span>setThumbWidth (index, width)</b></p>
225 <p class="p7"><b><span class="Apple-tab-span"> </span>setThumbHeight (index, height)</b></p>
226 <p class="p7"><b><span class="Apple-tab-span"> </span>setThumbSize (index, size)</b></p>
227 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
228 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Set the thumb width, height, or size(both) at a certain index.</p>
229 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>index </b>- An integer.</p>
230 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>width, height, size </b>- The number of pixels.</p>
231 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
232 <p class="p7"><b><span class="Apple-tab-span"> </span>selectionColor_ (acolor)</b></p>
233 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
234 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Set the color a thumb has when selected.</p>
235 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>acolor </b>- An instance of <a href="../GUI-Tools/Color.html"><span class="s11">Color</span></a>.</p>
236 <p class="p6"><br></p>
237 <p class="p13"><b>Subclassing and Internal Methods</b></p>
238 <p class="p7"><span class="s19"><span class="Apple-tab-span"> </span></span>The following methods are usually not used directly or are called by a primitive. Programmers can still call or override these as needed.</p>
239 <p class="p6"><br></p>
240 <p class="p7"><b><span class="Apple-tab-span"> </span>defaultKeyDownAction (char, modifiers, unicode)</b></p>
241 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
242 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The default keydown actions are:</p>
243 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
244 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>key</b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>action</b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>comment</b></p>
245 <p class="p7"><span class="Apple-tab-span"> </span>shift+unicode 16rF703, <span class="Apple-tab-span"> </span>increment x by <b>step</b><span class="Apple-tab-span"> </span>shift + right arrow</p>
246 <p class="p7"><span class="Apple-tab-span"> </span>shift+unicode 16rF702, <span class="Apple-tab-span"> </span>decrement x by <b>step</b><span class="Apple-tab-span"> </span>shift + left arrow<span class="Apple-tab-span"> </span></p>
247 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>unicode 16rF703, <span class="Apple-tab-span"> </span>select next index<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>right arrow</p>
248 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>unicode 16rF702, <span class="Apple-tab-span"> </span>select previous index<span class="Apple-tab-span"> </span>left arrow<span class="Apple-tab-span"> </span></p>
249 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>unicode 16rF700, <span class="Apple-tab-span"> </span>increment y by <b>step</b><span class="Apple-tab-span"> </span>up arrow</p>
250 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>unicode 16rF701, <span class="Apple-tab-span"> </span>decrement y by <b>step</b><span class="Apple-tab-span"> </span>down arrow</p>
251 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
252 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>note: <b>step</b> must be explicitly set fro this to work.</p>
253 <p class="p6"><br></p>
254 <p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
255 <p class="p7"><b><span class="Apple-tab-span"> </span>defaultGetDrag</b></p>
256 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
257 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Returns this.value.</p>
258 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
259 <p class="p7"><span class="Apple-tab-span"> </span><b>defaultCanReceiveDrag</b></p>
260 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
261 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The method called by default when attempting to place a drag in this object. Will recieve any drag, but the drag should be an array of values of the form:</p>
262 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
263 <p class="p12"><span class="s20"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span>[ [ x1, x2, x3, ... ], [ y1, y2, y3, ... ] ]</p>
264 <p class="p8"><span class="s5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span></p>
265 <p class="p7"><span class="Apple-tab-span"> </span><b>defaultReceiveDrag</b></p>
266 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
267 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The default method called when a drag has been received. Performs <b>value_()</b> <b>and reference_()</b> using <b>currentDrag</b> as an argument. Does not perform the <b>action</b>.</p>
268 <p class="p6"><br></p>
269 <p class="p7"><b><span class="Apple-tab-span"> </span>properties</b></p>
270 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
271 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>A list of properties to which this view responds. See <a href="SCView.html"><span class="s4">SCView</span></a>.</p>
272 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
273 <p class="p16"><span class="s2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[ </span>\bounds<span class="s2">, </span>\visible<span class="s2">, </span>\enabled<span class="s2">, </span>\canFocus<span class="s2">, </span>\resize<span class="s2">, </span>\background<span class="s2">, </span>\minWidth<span class="s2">, </span>\maxWidth<span class="s2">, </span>\minHeight<span class="s2">, </span>\maxHeight<span class="s2">, </span>\value<span class="s2">, </span>\thumbSize<span class="s2">, </span>\fillColor<span class="s2">, </span>\strokeColor<span class="s2">, </span>\xOffset<span class="s2">, </span>\x<span class="s2">, </span>\y<span class="s2">, </span>\showIndex<span class="s2">, </span>\drawLines<span class="s2">, </span>\drawRects<span class="s2">, </span>\selectionSize<span class="s2">, </span>\startIndex<span class="s2">, </span>\thumbWidth<span class="s2">, </span>\absoluteX<span class="s2">, </span>\isFilled<span class="s2">, </span>\step<span class="s2"> ]</span></p>
274 <p class="p8"><br></p>
275 <p class="p7"><b><span class="Apple-tab-span"> </span>size_(arg1)</b></p>
276 <p class="p7"><b><span class="Apple-tab-span"> </span>size</b></p>
277 <p class="p8"><b><span class="Apple-tab-span"> </span></b><span class="Apple-tab-span"> </span></p>
278 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>called by <b>value_</b></p>
279 <p class="p6"><br></p>
280 <p class="p7"><b><span class="Apple-tab-span"> </span>items_(arg1)</b></p>
281 <p class="p7"><b><span class="Apple-tab-span"> </span>items</b></p>
282 <p class="p8"><b><span class="Apple-tab-span"> </span></b><span class="Apple-tab-span"> </span></p>
283 <p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Returns an Array</p>
284 <p class="p6"><br></p>
285 <p class="p6"><br></p>
286 <p class="p7"><b><span class="Apple-tab-span"> </span>doMetaAction</b></p>
287 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
288 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Not normally called directly (called by the primitive).</p>
289 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
290 <p class="p7"><b><span class="Apple-tab-span"> </span>select (index)</b></p>
291 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
292 <p class="p7"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Selects the node at index, without refreshing the view</p>
293 <p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>index </b>- An integer.</p>
294 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
295 <p class="p6"><br></p>
296 <p class="p7"><b><span class="Apple-tab-span"> </span>addValue (xval, yval)</b></p>
297 <p class="p7"><b><span class="Apple-tab-span"> </span>fixedSelection_ (bool)</b></p>
298 <p class="p8"><span class="Apple-tab-span"> </span></p>
299 <p class="p7"><b><span class="Apple-tab-span"> </span>allConnections_(arg1)</b></p>
300 <p class="p7"><b><span class="Apple-tab-span"> </span>allConnections</b></p>
301 <p class="p8"><b><span class="Apple-tab-span"> </span></b></p>
302 <p class="p7"><b><span class="Apple-tab-span"> </span>doMetaAction</b></p>
303 <p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
304 <p class="p6"><br></p>
305 <p class="p13"><b>Examples</b></p>
306 <p class="p14"><br></p>
307 <p class="p17">// use as envelope view</p>
308 <p class="p11">(</p>
309 <p class="p17">//use shift-click to keep a node selected</p>
310 <p class="p11">w = <span class="s6">Window</span>(<span class="s7">"envelope"</span>, <span class="s6">Rect</span>(150 , <span class="s6">Window</span>.screenBounds.height-250, 250, 100)).front;</p>
311 <p class="p11">w.view.decorator = <span class="s6">FlowLayout</span>(w.view.bounds);</p>
312 <p class="p3"><br></p>
313 <p class="p11">b = <span class="s6">EnvelopeView</span>(w, <span class="s6">Rect</span>(0, 0, 230, 80))</p>
314 <p class="p11"><span class="Apple-tab-span"> </span>.drawLines_(<span class="s6">true</span>)</p>
315 <p class="p11"><span class="Apple-tab-span"> </span>.selectionColor_(<span class="s6">Color</span>.red)</p>
316 <p class="p11"><span class="Apple-tab-span"> </span>.drawRects_(<span class="s6">true</span>)</p>
317 <p class="p11"><span class="Apple-tab-span"> </span>.resize_(5)</p>
318 <p class="p11"><span class="Apple-tab-span"> </span>.step_(0.05)</p>
319 <p class="p11"><span class="Apple-tab-span"> </span>.action_({<span class="s6">arg</span> b; [b.index,b.value].postln})</p>
320 <p class="p11"><span class="Apple-tab-span"> </span>.thumbSize_(5)</p>
321 <p class="p11"><span class="Apple-tab-span"> </span>.value_([[0.0, 0.1, 0.5, 1.0],[0.1,1.0,0.8,0.0]]);</p>
322 <p class="p3"><br></p>
323 <p class="p11">w.front;</p>
324 <p class="p11">)</p>
325 <p class="p3"><br></p>
326 <p class="p17">// show grid</p>
327 <p class="p11">b.gridOn_(<span class="s6">true</span>);</p>
328 <p class="p3"><br></p>
329 <p class="p17">// show Env</p>
330 <p class="p11">b.setEnv(<span class="s6">Env</span>.asr(0.5,1, 0.2));</p>
331 <p class="p3"><br></p>
332 <p class="p17">// make the first point unmoveable</p>
333 <p class="p3"><br></p>
334 <p class="p11">(</p>
335 <p class="p11">b.setEditable(0,<span class="s6">false</span>);</p>
336 <p class="p11">)</p>
337 <p class="p3"><br></p>
338 <p class="p17">// use shift click to select/unselect the points</p>
339 <p class="p3"><br></p>
340 <p class="p11">(</p>
341 <p class="p11">w = <span class="s6">Window</span>(<span class="s7">"envelope"</span>, <span class="s6">Rect</span>(150 , <span class="s6">Window</span>.screenBounds.height-250, 400, 150)).front;</p>
342 <p class="p11">w.view.decorator = <span class="s6">FlowLayout</span>(w.view.bounds);</p>
343 <p class="p3"><br></p>
344 <p class="p11">b = <span class="s6">EnvelopeView</span>(w, <span class="s6">Rect</span>(0, 0, 350, 100))</p>
345 <p class="p11"><span class="Apple-tab-span"> </span>.thumbSize_(5)</p>
346 <p class="p11"><span class="Apple-tab-span"> </span>.drawLines_(<span class="s6">true</span>)</p>
347 <p class="p11"><span class="Apple-tab-span"> </span>.fillColor_(<span class="s6">Color</span>.green)</p>
348 <p class="p11"><span class="Apple-tab-span"> </span>.selectionColor_(<span class="s6">Color</span>.red)</p>
349 <p class="p11"><span class="Apple-tab-span"> </span>.drawRects_(<span class="s6">true</span>)</p>
350 <p class="p11"><span class="Apple-tab-span"> </span>.value_([(0.0, 0.1 .. 1.0), (0.0, 0.1 .. 1.0)])</p>
351 <p class="p11"><span class="Apple-tab-span"> </span>.setEditable(0,<span class="s6">false</span>);</p>
352 <p class="p3"><br></p>
353 <p class="p3"><br></p>
354 <p class="p11">)</p>
355 <p class="p3"><br></p>
356 <p class="p11">(</p>
357 <p class="p18"><span class="s2">r = </span>Routine<span class="s2">({</span></p>
358 <p class="p11"><span class="Apple-tab-span"> </span><span class="s6">var</span> j = 0;</p>
359 <p class="p11"><span class="Apple-tab-span"> </span>20.do({ <span class="s6">arg</span> i;</p>
360 <p class="p11"><span class="Apple-tab-span"> </span>b.select((b.size -1).rand.abs);</p>
361 <p class="p3"><br></p>
362 <p class="p11"><span class="Apple-tab-span"> </span>0.1.wait;</p>
363 <p class="p11"><span class="Apple-tab-span"> </span>b.x_(1.0.rand.abs);</p>
364 <p class="p11"><span class="Apple-tab-span"> </span>b.y_(1.0.rand.abs);</p>
365 <p class="p11"><span class="Apple-tab-span"> </span>});</p>
366 <p class="p11"><span class="Apple-tab-span"> </span>b.select(-1);</p>
367 <p class="p3"><br></p>
368 <p class="p11"><span class="Apple-tab-span"> </span>});</p>
369 <p class="p11"><span class="Apple-tab-span"> </span><span class="s6">AppClock</span>.play(r);</p>
370 <p class="p11">)<span class="Apple-tab-span"> </span></p>
371 <p class="p3"><br></p>
372 <p class="p3"><br></p>
373 <p class="p17">//show boxes with a string in it:</p>
374 <p class="p11">(</p>
375 <p class="p11">a = <span class="s6">Window</span>(<span class="s7">"text-boxes"</span>, <span class="s6">Rect</span>(200 , 450, 450, 450));</p>
376 <p class="p11">a.view.decorator = <span class="s6">FlowLayout</span>(a.view.bounds);</p>
377 <p class="p3"><br></p>
378 <p class="p11">b = <span class="s6">EnvelopeView</span>(a, <span class="s6">Rect</span>(0, 0, 440, 440))</p>
379 <p class="p11"><span class="Apple-tab-span"> </span>.thumbWidth_(60.0)</p>
380 <p class="p11"><span class="Apple-tab-span"> </span>.thumbHeight_(15.0)</p>
381 <p class="p11"><span class="Apple-tab-span"> </span>.drawLines_(<span class="s6">true</span>)</p>
382 <p class="p11"><span class="Apple-tab-span"> </span>.drawRects_(<span class="s6">true</span>)</p>
383 <p class="p11"><span class="Apple-tab-span"> </span>.selectionColor_(<span class="s6">Color</span>.red)</p>
384 <p class="p11"><span class="Apple-tab-span"> </span>.value_([[0.1, 0.4, 0.5, 0.3], [0.1, 0.2, 0.9, 0.7]]);</p>
385 <p class="p11">4.do({<span class="s6">arg</span> i;</p>
386 <p class="p11"><span class="Apple-tab-span"> </span>b.setString(i, [<span class="s7">"this"</span>, <span class="s7">"is"</span>, <span class="s7">"so much"</span>, <span class="s7">"fun"</span>].at(i));</p>
387 <p class="p11"><span class="Apple-tab-span"> </span>b.setFillColor(i,[<span class="s6">Color</span>.yellow, <span class="s6">Color</span>.white, <span class="s6">Color</span>.green].choose);</p>
388 <p class="p11">});</p>
389 <p class="p11">a.front;</p>
390 <p class="p11">)</p>
391 <p class="p3"><br></p>
392 <p class="p11">(</p>
393 <p class="p17"><span class="s2">b.connect(3, [2.0,0.0,1.0]); </span>// the text objects can be connected</p>
394 <p class="p11">b.connect(0,[2.0,3.0,1.0]);</p>
395 <p class="p11">)</p>
396 </body>
397 </html>