[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: quarks:[2675] AllGui
- To: sc-dev@xxxxxxxxxxxxxxxx
- Subject: [sc-dev] SF.net SVN: quarks:[2675] AllGui
- From: decampo@xxxxxxxxxxxxxxxxxxxxx
- Date: Sat, 28 Dec 2013 02:18:10 +0000
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:Subject:To:From:MIME-Version:Date; bh=eUtZebT87nuKczYwnBps8oDxFe6BIJk6csmk0MQ41pU=; b=eNsHsDxCrk8qN+5eF25Uv952GsuKv79XdWdO8Y2ELihcbO2Y7lpaysFTysFoq7J4NubKvthZQUDi4eUMDXSaiqu+I6GpkGZdt914IHlNb/ziW2rUXqF17j38QPSU6fZlmuLGivNgb68NvOmdExYyW4kv8Vf3f4uZDWvkl69NVJ0=;
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=Content-Transfer-Encoding:Content-Type:Subject:To:From:MIME-Version:Date; bh=eUtZebT87nuKczYwnBps8oDxFe6BIJk6csmk0MQ41pU=; b=bzLMyHqx7VqJZFEFz0V9+aPDsTP1SaFkxy8e5C9nLtErhsnnfhLW5n1IN+ZLzSMBIgAZP0OKyLFOwdgxetTOckRrRq8p8+12bGkd4QPLIkGBmXXk75q08aq1zGAW/VB+UpIVmjCTwZ6xLsb/L8kJnvc/VfCepkOCYeSBCtwTojA=;
- List-id: SuperCollider developers mailing list <sc-devel.create.ucsb.edu>
- Reply-to: sc-dev@xxxxxxxxxxxxxxxx
- Sender: owner-sc-dev@xxxxxxxxxxxxxxxx
Revision: 2675
http://sourceforge.net/p/quarks/code/2675
Author: decampo
Date: 2013-12-28 02:18:09 +0000 (Sat, 28 Dec 2013)
Log Message:
-----------
new help files and order
Modified Paths:
--------------
AllGui/HelpSource/Classes/AllGui.schelp
AllGui/HelpSource/Classes/GlobalsGui.schelp
Added Paths:
-----------
AllGui/Classes/
AllGui/Classes/AllGui.sc
AllGui/Classes/GlobalsGui.sc
Removed Paths:
-------------
AllGui/AllGui.sc
AllGui/GlobalsGui.sc
Deleted: AllGui/AllGui.sc
===================================================================
--- AllGui/AllGui.sc 2013-12-28 02:14:06 UTC (rev 2674)
+++ AllGui/AllGui.sc 2013-12-28 02:18:09 UTC (rev 2675)
@@ -1,123 +0,0 @@
-
-AllGui : JITGui {
- const <globalNames = #[ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
- 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ];
-
- classvar <inited = false, <labels, <countFuncs, <openFuncs;
-
- var <texts;
-
- *new { |numItems = 12, parent, bounds|
- this.init;
- ^super.new(nil, numItems, parent, bounds);
- }
-
- *countGlobals {
- var interp = thisProcess.interpreter;
- ^globalNames.count { |glob| interp.perform(glob).notNil };
- }
-
- *findProxySpace {
- var space = if (currentEnvironment.isKindOf(ProxySpace), currentEnvironment);
- if (space.notNil) { ^space };
-
- if (thisProcess.interpreter.p.isKindOf(ProxySpace), { space = thisProcess.interpreter.p });
- if (space.notNil) { ^space };
-
- ^ProxySpace.all.maxItem(_.size);
- }
-
- *init { |force = false|
-
- if (inited.not or: { force }) {
- inited = true;
-
- labels = List[];
- countFuncs = ();
- openFuncs = ();
-
- [
- [ \global, { this.countGlobals }, { |num| GlobalsGui(num).moveTo(600, 5); } ],
- [ \currEnvir, { currentEnvironment.size },
- { |num| EnvirGui(currentEnvironment, num)
- .moveTo(540, 400)
- .parent.name_("currentEnvironment") } ],
- [\servers, { Server.all.size }, { Server.all.do(_.makeWindow) } ],
-
- [ \Tdef, { Tdef.all.size }, { |num| TdefAllGui.new(num) } ],
- [ \Pdef, { Pdef.all.size }, { |num| PdefAllGui.new(num) } ],
- [ \Pdefn, { Pdefn.all.size }, { |num| PdefnAllGui.new(num) } ],
-
- [ \Ndef, { Ndef.all.sum(_.size) }, { |num| NdefMixer.new(Ndef.all.choose, num) } ],
- [ \proxyspace, { try { this.findProxySpace.envir.size } { ProxySpace.all.sum { |ps| ps.envir.size } } },
- { |num| ProxyMixer.new(this.findProxySpace, num) } ]
-
- ].do { |triple| this.add(*triple) };
-
- if (\MKtl.asClass.notNil) {
- this.add(\MKtl, { MKtl.all.size }, { |num| MKtlAllGui(num).moveTo(420, 5); });
- };
- };
-
- }
-
- *add { |name, countFunc, openFunc|
- this.init;
- if (labels.includes(name).not) { labels.add(name) };
- countFuncs.put(name, countFunc);
- openFuncs.put(name, openFunc);
- }
-
- *remove { |name|
- this.init;
- labels.remove(name);
- countFuncs.removeAt(name);
- openFuncs.removeAt(name);
- }
-
- setDefaults { |options|
- minSize = 170 @ (skin.buttonHeight * (numItems + 1));
- // at the top - works in osx
- defPos = if (parent.isNil) { 250@5 } { skin.margin };
- }
-
- winName { ^"AllGui" }
-
- makeViews {
- zone.resize_(2);
- texts = ();
-
- labels.do { |label|
- var numItemsBox, countView;
-
- Button(zone, Rect(0,0, 40, 20))
- .states_([["open"]])
- .action_({ openFuncs[label].value(numItemsBox.value.asInteger) })
- ;
-
- numItemsBox = EZNumber(zone, Rect(0,0, 20, 20), nil, [0, 32, \lin, 1], initVal: numItems);
-
- countView = EZText(zone, 110@20, label.asString, labelWidth: 75)
- .value_(0).enabled_(false);
-
- countView.view.resize_(2);
- countView.labelView.align_(\center);
- countView.textField.align_(\center);
- countView.labelView.resize_(2);
- countView.textField.resize_(3);
-
- texts.put(label, countView);
- };
- }
-
- getState {
- ^countFuncs.collect(_.value);
- }
-
- checkUpdate {
- var newState = this.getState;
- newState.keysValuesDo { |key, val|
- try { texts[key].value_(val) };
- };
- }
-}
\ No newline at end of file
Copied: AllGui/Classes/AllGui.sc (from rev 2667, AllGui/AllGui.sc)
===================================================================
--- AllGui/Classes/AllGui.sc (rev 0)
+++ AllGui/Classes/AllGui.sc 2013-12-28 02:18:09 UTC (rev 2675)
@@ -0,0 +1,123 @@
+
+AllGui : JITGui {
+ const <globalNames = #[ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ];
+
+ classvar <inited = false, <labels, <countFuncs, <openFuncs;
+
+ var <texts;
+
+ *new { |numItems = 12, parent, bounds|
+ this.init;
+ ^super.new(nil, numItems, parent, bounds);
+ }
+
+ *countGlobals {
+ var interp = thisProcess.interpreter;
+ ^globalNames.count { |glob| interp.perform(glob).notNil };
+ }
+
+ *findProxySpace {
+ var space = if (currentEnvironment.isKindOf(ProxySpace), currentEnvironment);
+ if (space.notNil) { ^space };
+
+ if (thisProcess.interpreter.p.isKindOf(ProxySpace), { space = thisProcess.interpreter.p });
+ if (space.notNil) { ^space };
+
+ ^ProxySpace.all.maxItem(_.size);
+ }
+
+ *init { |force = false|
+
+ if (inited.not or: { force }) {
+ inited = true;
+
+ labels = List[];
+ countFuncs = ();
+ openFuncs = ();
+
+ [
+ [ \global, { this.countGlobals }, { |num| GlobalsGui(num).moveTo(600, 5); } ],
+ [ \currEnvir, { currentEnvironment.size },
+ { |num| EnvirGui(currentEnvironment, num)
+ .moveTo(540, 400)
+ .parent.name_("currentEnvironment") } ],
+ [\servers, { Server.all.size }, { Server.all.do(_.makeWindow) } ],
+
+ [ \Tdef, { Tdef.all.size }, { |num| TdefAllGui.new(num) } ],
+ [ \Pdef, { Pdef.all.size }, { |num| PdefAllGui.new(num) } ],
+ [ \Pdefn, { Pdefn.all.size }, { |num| PdefnAllGui.new(num) } ],
+
+ [ \Ndef, { Ndef.all.sum(_.size) }, { |num| NdefMixer.new(Ndef.all.choose, num) } ],
+ [ \proxyspace, { try { this.findProxySpace.envir.size } { ProxySpace.all.sum { |ps| ps.envir.size } } },
+ { |num| ProxyMixer.new(this.findProxySpace, num) } ]
+
+ ].do { |triple| this.add(*triple) };
+
+ if (\MKtl.asClass.notNil) {
+ this.add(\MKtl, { MKtl.all.size }, { |num| MKtlAllGui(num).moveTo(420, 5); });
+ };
+ };
+
+ }
+
+ *add { |name, countFunc, openFunc|
+ this.init;
+ if (labels.includes(name).not) { labels.add(name) };
+ countFuncs.put(name, countFunc);
+ openFuncs.put(name, openFunc);
+ }
+
+ *remove { |name|
+ this.init;
+ labels.remove(name);
+ countFuncs.removeAt(name);
+ openFuncs.removeAt(name);
+ }
+
+ setDefaults { |options|
+ minSize = 170 @ (skin.buttonHeight * (numItems + 1));
+ // at the top - works in osx
+ defPos = if (parent.isNil) { 250@5 } { skin.margin };
+ }
+
+ winName { ^"AllGui" }
+
+ makeViews {
+ zone.resize_(2);
+ texts = ();
+
+ labels.do { |label|
+ var numItemsBox, countView;
+
+ Button(zone, Rect(0,0, 40, 20))
+ .states_([["open"]])
+ .action_({ openFuncs[label].value(numItemsBox.value.asInteger) })
+ ;
+
+ numItemsBox = EZNumber(zone, Rect(0,0, 20, 20), nil, [0, 32, \lin, 1], initVal: numItems);
+
+ countView = EZText(zone, 110@20, label.asString, labelWidth: 75)
+ .value_(0).enabled_(false);
+
+ countView.view.resize_(2);
+ countView.labelView.align_(\center);
+ countView.textField.align_(\center);
+ countView.labelView.resize_(2);
+ countView.textField.resize_(3);
+
+ texts.put(label, countView);
+ };
+ }
+
+ getState {
+ ^countFuncs.collect(_.value);
+ }
+
+ checkUpdate {
+ var newState = this.getState;
+ newState.keysValuesDo { |key, val|
+ try { texts[key].value_(val) };
+ };
+ }
+}
\ No newline at end of file
Copied: AllGui/Classes/GlobalsGui.sc (from rev 2667, AllGui/GlobalsGui.sc)
===================================================================
--- AllGui/Classes/GlobalsGui.sc (rev 0)
+++ AllGui/Classes/GlobalsGui.sc 2013-12-28 02:18:09 UTC (rev 2675)
@@ -0,0 +1,122 @@
+GlobalsGui : JITGui {
+ var <textViews, <cmdLineView, <codeDumpView;
+ var <editKeys = #[], keysRotation = 0;
+
+ classvar <names = #[
+ \a, \b, \c, \d, \e, \f, \g,
+ \h, \i, \j, \k, \l, \m, \n,
+ \o, \p, \q, \r, \s, \t, \u,
+ \v, \w, \x, \y, \z, \cmdLine, \codeDump ];
+
+ *new { |numItems = 12, parent, bounds|
+ // numItems not supported yet, should do scrolling
+ // ... for small screens ...
+ ^super.new(thisProcess.interpreter, numItems, parent, bounds);
+ }
+
+ // these methods should be overridden in subclasses:
+ setDefaults { |options|
+ if (parent.isNil) {
+ defPos = 10@260
+ } {
+ defPos = skin.margin;
+ };
+ minSize = 200 @ (numItems + 2 * skin.buttonHeight + 4);
+ }
+
+ makeViews {
+ var textwidth = zone.bounds.width - 20;
+ var textheight = skin.buttonHeight;
+
+ cmdLineView = EZText(zone, textwidth + 16 @ textheight, 'cmdLine', labelWidth: 64)
+ .enabled_(false);
+ codeDumpView = EZText(zone, textwidth + 16 @ textheight, 'codeDump', labelWidth: 64)
+ .enabled_(false);
+
+ cmdLineView.labelView.align_(\center);
+ cmdLineView.view.resize_(2);
+
+ textViews = numItems.collect { |i|
+ var text, labelWidth = 15, canEval = true;
+
+ text = EZText(zone, textwidth @ textheight, "",
+ { |tx|
+ object.perform(
+ text.labelView.string.asSymbol.asSetter,
+ tx.textField.string.interpret);
+ },
+ labelWidth: labelWidth
+ );
+ text.visible_(false);
+ text.view.resize_(2);
+ text.labelView.align_(\center);
+ text;
+ };
+
+ textViews = textViews;
+
+ /// make a scroller
+ zone.decorator.reset.shift(zone.bounds.width - 16, textheight * 2);
+ scroller = EZScroller(zone,
+ Rect(0, 0, 12, numItems * textheight),
+ numItems, numItems,
+ { |sc| keysRotation = sc.value.asInteger.max(0); }
+ ).visible_(false);
+
+ scroller.slider.resize_(3);
+
+ this.name_(this.getName);
+ }
+
+ getState {
+ var state = ();
+ names.do { |globvar|
+ state.put(globvar, object.instVarAt(globvar))
+ };
+ ^state;
+ }
+
+ getName { ^"Global_Vars" }
+ winName { ^this.getName }
+
+ checkUpdate {
+ var newKeys;
+ var newState = this.getState;
+ var allNewKeys = newState.keys.remove(\cmdLine).asArray.sort;
+ var overflow = (allNewKeys.size - numItems).max(0);
+
+ keysRotation = keysRotation.clip(0, overflow);
+
+ newKeys = allNewKeys.drop(keysRotation).keep(numItems);
+
+ if (prevState[\cmdLine] != newState[\cmdLine]) {
+ cmdLineView.value_(newState[\cmdLine]);
+ };
+ if (prevState[\codeDump] != newState[\codeDump]) {
+ cmdLineView.value_(newState[\codeDump]);
+ };
+
+ scroller
+ .numItems_(allNewKeys.size)
+ .visible_(overflow > 0)
+ .value_(keysRotation);
+
+ textViews.do { |textView, i|
+ var oldKey = editKeys[i];
+ var oldObj = textView.value;
+ var newKey = newKeys [i];
+ var newObj = newState[newKey];
+
+ if (newKey != oldKey) {
+ textView.visible_(newKey.notNil);
+ textView.labelView.string_(newKey.asString);
+ };
+ if (newObj != oldObj) {
+ textView.value_(newObj ? "");
+ };
+ };
+
+ prevState = newState;
+ editKeys = newKeys;
+ }
+}
Deleted: AllGui/GlobalsGui.sc
===================================================================
--- AllGui/GlobalsGui.sc 2013-12-28 02:14:06 UTC (rev 2674)
+++ AllGui/GlobalsGui.sc 2013-12-28 02:18:09 UTC (rev 2675)
@@ -1,122 +0,0 @@
-GlobalsGui : JITGui {
- var <textViews, <cmdLineView, <codeDumpView;
- var <scroller, <editKeys = #[], keysRotation = 0;
-
- classvar <names = #[
- \a, \b, \c, \d, \e, \f, \g,
- \h, \i, \j, \k, \l, \m, \n,
- \o, \p, \q, \r, \s, \t, \u,
- \v, \w, \x, \y, \z, \cmdLine, \codeDump ];
-
- *new { |numItems = 12, parent, bounds|
- // numItems not supported yet, should do scrolling
- // ... for small screens ...
- ^super.new(thisProcess.interpreter, numItems, parent, bounds);
- }
-
- // these methods should be overridden in subclasses:
- setDefaults { |options|
- if (parent.isNil) {
- defPos = 10@260
- } {
- defPos = skin.margin;
- };
- minSize = 200 @ (numItems + 2 * skin.buttonHeight + 4);
- }
-
- makeViews {
- var textwidth = zone.bounds.width - 20;
- var textheight = skin.buttonHeight;
-
- cmdLineView = EZText(zone, textwidth + 16 @ textheight, 'cmdLine', labelWidth: 64)
- .enabled_(false);
- codeDumpView = EZText(zone, textwidth + 16 @ textheight, 'codeDump', labelWidth: 64)
- .enabled_(false);
-
- cmdLineView.labelView.align_(\center);
- cmdLineView.view.resize_(2);
-
- textViews = numItems.collect { |i|
- var text, labelWidth = 15, canEval = true;
-
- text = EZText(zone, textwidth @ textheight, "",
- { |tx|
- object.perform(
- text.labelView.string.asSymbol.asSetter,
- tx.textField.string.interpret);
- },
- labelWidth: labelWidth
- );
- text.visible_(false);
- text.view.resize_(2);
- text.labelView.align_(\center);
- text;
- };
-
- textViews = textViews;
-
- /// make a scroller
- zone.decorator.reset.shift(zone.bounds.width - 16, textheight * 2);
- scroller = EZScroller(zone,
- Rect(0, 0, 12, numItems * textheight),
- numItems, numItems,
- { |sc| keysRotation = sc.value.asInteger.max(0); }
- ).visible_(false);
-
- scroller.slider.resize_(3);
-
- this.name_(this.getName);
- }
-
- getState {
- var state = ();
- names.do { |globvar|
- state.put(globvar, object.instVarAt(globvar))
- };
- ^state;
- }
-
- getName { ^"Global_Vars" }
- winName { ^this.getName }
-
- checkUpdate {
- var newKeys;
- var newState = this.getState;
- var allNewKeys = newState.keys.remove(\cmdLine).asArray.sort;
- var overflow = (allNewKeys.size - numItems).max(0);
-
- keysRotation = keysRotation.clip(0, overflow);
-
- newKeys = allNewKeys.drop(keysRotation).keep(numItems);
-
- if (prevState[\cmdLine] != newState[\cmdLine]) {
- cmdLineView.value_(newState[\cmdLine]);
- };
- if (prevState[\codeDump] != newState[\codeDump]) {
- cmdLineView.value_(newState[\codeDump]);
- };
-
- scroller
- .numItems_(allNewKeys.size)
- .visible_(overflow > 0)
- .value_(keysRotation);
-
- textViews.do { |textView, i|
- var oldKey = editKeys[i];
- var oldObj = textView.value;
- var newKey = newKeys [i];
- var newObj = newState[newKey];
-
- if (newKey != oldKey) {
- textView.visible_(newKey.notNil);
- textView.labelView.string_(newKey.asString);
- };
- if (newObj != oldObj) {
- textView.value_(newObj ? "");
- };
- };
-
- prevState = newState;
- editKeys = newKeys;
- }
-}
Modified: AllGui/HelpSource/Classes/AllGui.schelp
===================================================================
--- AllGui/HelpSource/Classes/AllGui.schelp 2013-12-28 02:14:06 UTC (rev 2674)
+++ AllGui/HelpSource/Classes/AllGui.schelp 2013-12-28 02:18:09 UTC (rev 2675)
@@ -5,18 +5,15 @@
DESCRIPTION::
AllGui shows many of the global storage locations in SC3:
+list::
+##global variables in the interpreter (a-z)
+##objects in the currentEnvironment
+##some classvars that keep all instances of that class:
+##link::Classes/Pdef::.all, link::Classes/Tdef::.all, link::Classes/Pdefn::.all,
+##link::Classes/ProxySpace::.all, link::Classes/Ndef::.all,
+##and potentially others, such as MKtl.
+::
- global variables in the interpreter (a-z)
-
- objects in the currentEnvironment
-
- some classvars that keep all instances of that class:
-
- Pdef.all, Tdef.all, Pdefn.all,
- ProxySpace.all, Ndef.all,
-
- and potentially others, such as MKtl.
-
For each location, the number of items there is displayed,
and a gui can be opened to display it in more detail.
@@ -55,6 +52,8 @@
CLASSMETHODS::
+private:: countGlobals, findProxySpace, inited
+
METHOD:: globalNames
the interpreter global variables as a list of symbols.
@@ -100,3 +99,7 @@
argument:: name
the name of the item to remove
+InstanceMethods::
+private:: winName, texts, setDefaults, makeViews, getState, checkUpdate
+
+
Modified: AllGui/HelpSource/Classes/GlobalsGui.schelp
===================================================================
--- AllGui/HelpSource/Classes/GlobalsGui.schelp 2013-12-28 02:14:06 UTC (rev 2674)
+++ AllGui/HelpSource/Classes/GlobalsGui.schelp 2013-12-28 02:18:09 UTC (rev 2675)
@@ -52,3 +52,4 @@
INSTANCEMETHODS::
+private::setDefaults, textViews, cmdLineView, codeDumpView, editKeys, winName, getName, makeViews, getState, checkUpdate
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/