[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] SF.net SVN: supercollider:[8216] trunk/build



Revision: 8216
          http://supercollider.svn.sourceforge.net/supercollider/?rev=8216&view=rev
Author:   jmfuo
Date:     2008-12-20 10:59:05 +0000 (Sat, 20 Dec 2008)

Log Message:
-----------
made subview bounds calculation more efficient

Modified Paths:
--------------
    trunk/build/Help/GUI/EZListView.html
    trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc

Modified: trunk/build/Help/GUI/EZListView.html
===================================================================
--- trunk/build/Help/GUI/EZListView.html	2008-12-19 21:36:32 UTC (rev 8215)
+++ trunk/build/Help/GUI/EZListView.html	2008-12-20 10:59:05 UTC (rev 8216)
@@ -19,26 +19,28 @@
 p.p10 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #000000}
 p.p11 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #606060}
 p.p12 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
-p.p13 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
-p.p14 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
-p.p15 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
-p.p16 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica; min-height: 17.0px}
-p.p17 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco}
-p.p18 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica; min-height: 14.0px}
-p.p19 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica; color: #001ee6}
+p.p13 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #a41c14}
+p.p14 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco}
+p.p15 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
+p.p16 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
+p.p17 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica; min-height: 17.0px}
+p.p18 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
+p.p19 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica; min-height: 14.0px}
+p.p20 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica; color: #0b2bde}
 span.s1 {font: 18.0px Helvetica}
-span.s2 {color: #0000ff}
-span.s3 {color: #49507b}
-span.s4 {color: #0020f6}
+span.s2 {color: #0020f6}
+span.s3 {color: #4b5179}
+span.s4 {color: #0c2eee}
 span.s5 {font: 11.0px Monaco}
 span.s6 {color: #000000}
 span.s7 {color: #0000bf}
 span.s8 {color: #007300}
 span.s9 {color: #606060}
 span.s10 {color: #bf0000}
-span.s11 {color: #0018b8}
-span.s12 {font: 12.0px Helvetica; color: #001ee6}
-span.s13 {color: #1e3bd0}
+span.s11 {color: #356f14}
+span.s12 {color: #0922b2}
+span.s13 {font: 12.0px Helvetica}
+span.s14 {color: #2641c9}
 span.Apple-tab-span {white-space:pre}
 </style>
 </head>
@@ -88,40 +90,40 @@
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>labelWidth: 120</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>);</p>
 <p class="p12"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>)</p>
-<p class="p12"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p9"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></span>// or a more simple syntax:</p>
-<p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
+<p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p13"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></span>// or a more simple syntax:</p>
+<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w=<span class="s7">Window</span>.new.front;</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w.view.decorator = <span class="s7">FlowLayout</span>(w.view.bounds);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g = <span class="s7">EZListView</span>.new(w,200@230, <span class="s9">"List:"</span>);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>)</p>
-<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p9"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></span>// label on the left:</p>
-<p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p13"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></span>// label on the left:</p>
+<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w=<span class="s7">Window</span>.new.front;</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w.view.decorator = <span class="s7">FlowLayout</span>(w.view.bounds);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g = <span class="s7">EZListView</span>.new(w,200@230, <span class="s9">"A List Label:"</span>, labelPosition:<span class="s8">\left</span>);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>)</p>
-<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p9"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></span>// No labelView created;</p>
-<p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p13"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></span>// No labelView created;</p>
+<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w=<span class="s7">Window</span>.new.front;</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w.view.decorator = <span class="s7">FlowLayout</span>(w.view.bounds);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g = <span class="s7">EZListView</span>.new(w,200@230); <span class="s10">// no label</span></p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>)</p>
-<p class="p12"><br></p>
-<p class="p15"><b>Building and Changing the Menu</b></p>
-<p class="p16"><br></p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p5"><br></p>
+<p class="p16"><b>Building and Changing the Menu</b></p>
+<p class="p17"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>globalAction_(function)</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>globalAction</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
@@ -138,14 +140,14 @@
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>name </b>- An instance of  <a href="../Collections/String.html"><span class="s4">String</span></a> or <a href="../Core/Symbol.html"><span class="s4">Symbol</span></a>. The name of the menu item.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>action </b>- A n instanc of Function.</p>
 <p class="p7"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p17"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
+<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w=<span class="s7">Window</span>.new.front;</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w.view.decorator = <span class="s7">FlowLayout</span>(w.view.bounds);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g = <span class="s7">EZListView</span>.new(w,200@200, <span class="s9">"List:"</span>);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
 <p class="p5"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>insertItem (index, name, action)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
@@ -154,41 +156,41 @@
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>name </b>- An instance of  <a href="../Collections/String.html"><span class="s4">String</span></a> or <a href="../Core/Symbol.html"><span class="s4">Symbol</span></a>. The name of the menu item.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>action </b>- A n instanc of Function.</p>
 <p class="p7"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p17"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
+<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w=<span class="s7">Window</span>.new.front;</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w.view.decorator = <span class="s7">FlowLayout</span>(w.view.bounds);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g = <span class="s7">EZListView</span>.new(w,200@200, <span class="s9">"List:"</span>);</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item4</span>, {<span class="s9">"this is item 4"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item4</span>, {<span class="s9">"this is item 4"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
 <p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.insertItem(3, <span class="s8">\item3</span>, {<span class="s9">"this is item 3"</span>. postln});</p>
+<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.insertItem(3, <span class="s11">\item3</span>, {<span class="s9">"this is item 3"</span>. postln});</p>
 <p class="p5"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>removeItemAt (index)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Removes a menu item at positiion of index.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>index </b>- An integer. The index where to remove an item.</p>
 <p class="p7"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p17"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
+<p class="p14"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w=<span class="s7">Window</span>.new.front;</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>w.view.decorator = <span class="s7">FlowLayout</span>(w.view.bounds);</p>
 <p class="p10"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g = <span class="s7">EZListView</span>.new(w,200@200, <span class="s9">"List:"</span>);</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item4</span>, {<span class="s9">"this is item 4"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.insertItem(3, <span class="s8">\item3</span>, {<span class="s9">"this is item 3"</span>. postln});</p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item0</span>, {<span class="s9">"this is item 0"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item1</span>, {<span class="s9">"this is item 1"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item2</span>, {<span class="s9">"this is item 2"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.addItem(<span class="s8">\item4</span>, {<span class="s9">"this is item 4"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g.insertItem(3, <span class="s8">\item3</span>, {<span class="s9">"this is item 3"</span>. postln});</p>
+<p class="p15"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="s6">)</span></p>
 <p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p13"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g. removeItemAt(0);</p>
+<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>g. removeItemAt(0);</p>
 <p class="p5"><br></p>
 <p class="p5"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>remove</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span>removes both the label and the menu from the parent view.<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 <p class="p5"><br></p>
-<p class="p15"><b>Accessing Values</b></p>
+<p class="p16"><b>Accessing Values</b></p>
 <p class="p7"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>value</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>value_ (val)</b></p>
@@ -200,68 +202,68 @@
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets the value and performs the action at the index value and the global action.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>val </b>- An integer.</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>doAction</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Performs the action at the current index and the global action.</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p15"><b>Accessing GUI options</b></p>
-<p class="p16"><br></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p16"><b>Accessing GUI options</b></p>
+<p class="p17"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>label</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>label_(string)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets it the label. Will add the label view if none was initially created.</p>
-<p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>string </b>- An Instance of <a href="../Collections/String.html"><span class="s11">String</span></a>. </p>
+<p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>string </b>- An Instance of <a href="../Collections/String.html"><span class="s12">String</span></a>. </p>
 <p class="p7"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>visible</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>visible_(bool)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets it the component  views are visible.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>bool </b>- An Instance of <a href="../Core/Boolean.html"><span class="s4">Boolean</span></a>. Default is true;</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>enabled</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>enabled_(bool)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets it the menu  is enabled.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>bool </b>- An Instance of <a href="../Core/Boolean.html"><span class="s4">Boolean</span></a>. Default is true;</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>visible</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>visible_(bool)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets it the component  views are visible.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>bool </b>- An Instance of <a href="../Core/Boolean.html"><span class="s4">Boolean</span></a>. Default is true;</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>bounds</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>bounds_(rect)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets the bounds of view, and adjusts the components.</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>rect </b>- An Instance of <a href="../Geometry/Rect.html"><span class="s4">Rect</span></a> or <a href="../Geometry/Point.html"><span class="s4">Point</span></a>;</p>
-<p class="p18"><br></p>
+<p class="p19"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelPosition</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelPosition_(pos)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets the label position.<span class="Apple-converted-space">  </span>The width and height of the label return to the defaults: 80@xxxxxxxxxxx or this.width@20;</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>pos </b>- \left or \top</p>
-<p class="p18"><br></p>
+<p class="p19"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelWidth</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelWidth_(width)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
-<p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets the width of the label to <b>width</b>, and adjusts the menu.bounds. (the actual width of the label will be width-<b>gap</b>). Does nothing if <b>labelPosition</b>=top;</p>
+<p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets the width of the label to <b>width</b>, and adjusts the menu.bounds.. Does nothing if <b>labelPosition</b>=top;</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>width </b>- A number;</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelHeight</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelHeight_(height)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
-<p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets the height of the label to <b>height</b>, and adjusts the menu.bounds. (the actual width of the label will be height-<b>gap</b>). Does nothing if <b>labelPosition</b>=bottom;</p>
+<p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets the height of the label to <b>height</b>, and adjusts the menu.bounds. Does nothing if <b>labelPosition</b>=bottom;</p>
 <p class="p8"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>height </b>- A number;</p>
-<p class="p18"><br></p>
+<p class="p19"><br></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>gap</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>gap_(val)</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Sets/gets the width of the label to <b>width-val</b>, creating a gap. </p>
 <p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>val </b>- A number. default is 4.</p>
-<p class="p18"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
-<p class="p15"><b>Accessing GUI components</b></p>
+<p class="p19"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
+<p class="p16"><b>Accessing GUI components</b></p>
 <p class="p7"><span class="Apple-tab-span">	</span></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>view</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span>Returns the enclosing compositeView.</p>
@@ -273,7 +275,7 @@
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelView_(arg1)</b></p>
 <p class="p6"><b><span class="Apple-tab-span">	</span>labelView</b></p>
 <p class="p7"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
-<p class="p19"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>An <a href="SCStaticText.html"><span class="s12">SCStaticText</span></a><b> </b></span><span class="s13"> view</span></p>
+<p class="p20"><span class="s6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>An <a href="SCStaticText.html"><span class="s13">SCStaticText</span></a><b> </b></span><span class="s14"> view</span></p>
 <p class="p7"><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>
 <p class="p7"><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="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
 </body>

Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc	2008-12-19 21:36:32 UTC (rev 8215)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc	2008-12-20 10:59:05 UTC (rev 8216)
@@ -1,7 +1,7 @@
 EZListView{
-	var   <>globalAction, <>labelView, <items, <listView, <view, <gap, <labelPosition;
+	var   <>globalAction, <>labelView, <items, <listView, <view, <gap, <labelPosition, labelSize;
 	
-	*new { arg parentView, bounds= 160@160, label,items, globalAction, initVal=0, 
+	*new { arg parentView, bounds= 160@200, label,items, globalAction, initVal=0, 
 			initAction=false, labelWidth=80, labelHeight=20, labelPosition=\top, gap=4;
 			
 		^super.new.init(parentView, bounds, label, items, globalAction, initVal, 
@@ -10,36 +10,38 @@
 
 	init { arg parentView, bounds, label, argItems, argGlobalAction, initVal, 
 			initAction, labelWidth, labelHeight, arglabelPosition,  argGap;
-		var listBounds;
+		var labelBounds, listBounds;
+		
 		bounds=bounds.asRect;
 		labelPosition=arglabelPosition;
-		parentView.notNil.if{view = parentView }{view = FlowView.new()};
-		view=GUI.compositeView.new(view,bounds).relativeOrigin_(true);
-		
+		labelSize=labelWidth@labelHeight;
 		gap=argGap;
-				
+		
+		parentView.notNil.if{	
+			view=GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
+			}{
+				view = FlowView.new;
+				view.parent.bounds=Rect(200,Window.screenBounds.height-bounds.height-100,
+					bounds.width+4,bounds.height+4);
+			};
+		
+		# labelBounds,listBounds = this.prSubViewBounds(bounds, label.notNil);
+		
 		label.notNil.if{ //only add a label if desired
 			if (labelPosition==\top){
-				labelView = GUI.staticText.new(view, bounds.width @ labelHeight-gap);
+				labelView = GUI.staticText.new(view, labelBounds);
 				labelView.align = \left;
 				}{
-				labelView = GUI.staticText.new(view, labelWidth-gap @ bounds.height);
+				labelView = GUI.staticText.new(view, labelBounds);
 				labelView.align = \right;
 				};
 			labelView.string = label;
-		}{labelWidth=0; labelHeight=0};
+		};
 				
-		if (labelPosition==\top){
-		 	listBounds= Rect(0,labelHeight,bounds.width,  bounds.height-labelHeight);
-		 	}{
-		 	listBounds= Rect(labelWidth,0,bounds.width-labelWidth,  bounds.height);
-		 	};
-		
 		listView = GUI.listView.new(view, listBounds);
 		
 		this.items=argItems ? [];
 		
-		
 		globalAction=argGlobalAction;
 		
 		listView.action={arg obj;
@@ -89,23 +91,23 @@
 	doAction {items.at(this.value).value.value(this); globalAction.value}
 
 	label_{ arg string;
+	
 		labelView.isNil.if{
+			labelSize=80@20;
 			if(labelPosition==\top, {
-				labelView = GUI.staticText.new(view, view.bounds.width@ 20-gap);
-				this.labelWidth_(this.bounds.width);
-				this.labelHeight_(20);
+				labelView = GUI.staticText.new(view, view.bounds.width@ labelSize.y);
 				labelView.align = \left;
 			},{
-				labelView = GUI.staticText.new(view, 80-gap @ view.bounds.height);
-				this.labelWidth_(80);
-				this.labelHeight_(this.bounds.height);
+				labelView = GUI.staticText.new(view, labelSize.x @ view.bounds.height);
 				labelView.align = \right;
 			});
 			labelView.string = string;
 		}{
+		
 	 	labelView.string_(string)
 	 	};
 	 	
+	 	this.bounds_(view.bounds); //recalculate bounds
 	}
 	
 	label { arg label, items, globalAction;
@@ -121,89 +123,46 @@
 	remove { [listView, labelView].do(_.remove) }
 	
 	bounds{^view.bounds}
+	
 	bounds_{arg rect;
-		var labelWidth=0,labelHeight=0;
-		view.bounds=rect.asRect;
+		var labelBounds, listBounds;
+		view.bounds=rect;
+		# labelBounds,listBounds = this.prSubViewBounds(view.bounds, labelView.notNil);
 		
-		if (labelPosition==\top,{
-		
-			labelView.notNil.if{
-				labelHeight=labelView.bounds.height;
-				};
-			listView.bounds= Rect(
-					0,
-					labelHeight+gap,
-					view.bounds.width,  
-					view.bounds.height-labelHeight-gap
-					);
-		},{
-			labelView.notNil.if{
-				labelWidth= labelView.bounds.width;
-				};
-			listView.bounds= Rect(
-					labelWidth+gap,
-					0,
-					view.bounds.width-labelWidth-gap,  
-					view.bounds.height
-					);
-		});
-	}
+		labelView.notNil.if{labelView.bounds=labelBounds};
+		listView.bounds=listBounds;
 	
-	labelWidth{
-		^ if(labelView.notNil, {
-			if(labelPosition==\top,
-				{labelView.bounds.width}, 
-				{labelView.bounds.width+gap} 
-			)},
-			{"No labelView created".warn; 
-			nil})
 	}
 	
-	labelWidth_{arg width;
-		if(labelView.notNil, 
-			if(labelPosition==\top,
-				{"labelPosition is top, so label width is automatic".warn;},
-				{labelView.bounds=labelView.bounds.width_(width-gap);
-					listView.bounds= Rect(width,0,view.bounds.width-width,  view.bounds.height);
-				}),
-		{"No labelView created".warn;});
-	}
 	labelHeight{
-		^ if(labelView.notNil, {
-			if(labelPosition==\top,
-				{labelView.bounds.height+gap}, 
-				{labelView.bounds.height}
-			)}, 
-			{"No labelView created".warn; 
-			nil})
+		^ labelSize.y
 	}
 	
 	labelHeight_{arg height;
-		if(labelView.notNil, 
-			if(labelPosition==\top,
-				{labelView.bounds=labelView.bounds.height_(height-gap);
-					listView.bounds= Rect(0, height,view.bounds.width,view.bounds.height-height);
-				},
-				{"labelPosition is left, so label height is automatic".warn;}),
-
-		{"No labelView created".warn;});
+		labelSize.y=height;
+		this.bounds_(view.bounds); 	
 	}
+	labelWidth{
+		^ labelSize.x
+	}
 	
+	labelWidth_{arg width;
+		labelSize.x=width;
+		this.bounds_(view.bounds); 	
+	}
+	
 	labelPosition_{arg pos;
-		if (pos !=labelPosition,{
-			labelPosition=pos;
-			if (labelView.notNil,{
-				if(labelPosition==\top,{
-					 labelView.bounds= (view.bounds.width@20).asRect; 
-					this.bounds=view.bounds;
-					this.labelView.align_(\left);
-				},{
-					labelView.bounds=(80@xxxxxxxxxxxxxxxxxx).asRect; 
-					this.bounds=view.bounds;						this.labelView.align_(\right);
-				});
-			});
-		});
+		labelPosition=pos;
+		labelSize=80@20;
+		labelView.notNil.if{
+			(labelPosition==\top).if{
+			labelView.align=\left;
+			}{
+			labelView.align=\right;
+			};
+		};
 		
+		this.bounds_(view.bounds); 	
 	}
 	
 	gap_{arg val;
@@ -212,8 +171,35 @@
 		
 	}
 	
+	prSubViewBounds{arg rect, hasLabel=true;
+		var listBounds,labelBounds, tempGap;
+		tempGap=gap;	
+		hasLabel.not.if{tempGap=0; labelSize=0@0};
+		
+		if (labelPosition==\top,{
+			listBounds= Rect(
+					0,
+					labelSize.y+tempGap,
+					view.bounds.width,  
+					view.bounds.height-labelSize.y-tempGap
+					);
+			labelBounds=Rect(0,0,listBounds.width,labelSize.y);
+		},{
+			listBounds= Rect(
+					labelSize.x+tempGap,
+					0,
+					view.bounds.width-labelSize.x-tempGap,  
+					view.bounds.height
+					);
+			labelBounds=Rect(0,0, labelSize.x ,listBounds.height );
+		});
+		
+		^[labelBounds, listBounds]
+	}
 	
 	
+	
+	
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/