[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: supercollider:[8340] trunk/build
Revision: 8340
http://supercollider.svn.sourceforge.net/supercollider/?rev=8340&view=rev
Author: jmfuo
Date: 2008-12-31 11:30:36 +0000 (Wed, 31 Dec 2008)
Log Message:
-----------
Further optimization to EZ class tree
Modified Paths:
--------------
trunk/build/Help/GUI/EZ-GUI/EZLists.html
trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc
trunk/build/SCClassLibrary/Common/GUI/Base/EZNumber.sc
trunk/build/SCClassLibrary/Common/GUI/Base/EZPopUpMenu.sc
trunk/build/SCClassLibrary/Common/GUI/Base/EZRangerSC.sc
trunk/build/SCClassLibrary/Common/GUI/Base/EZSlider.sc
trunk/build/SCClassLibrary/Common/GUI/Base/EZgui.sc
Modified: trunk/build/Help/GUI/EZ-GUI/EZLists.html
===================================================================
--- trunk/build/Help/GUI/EZ-GUI/EZLists.html 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/Help/GUI/EZ-GUI/EZLists.html 2008-12-31 11:30:36 UTC (rev 8340)
@@ -20,10 +20,10 @@
p.p11 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica}
p.p12 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica; min-height: 14.0px}
span.s1 {font: 18.0px Helvetica}
-span.s2 {color: #2946d8}
+span.s2 {color: #314bd1}
span.s3 {color: #000000}
span.s4 {text-decoration: underline}
-span.s5 {color: #5f689f}
+span.s5 {color: #61699c}
span.Apple-tab-span {white-space:pre}
</style>
</head>
Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZListView.sc 2008-12-31 11:30:36 UTC (rev 8340)
@@ -1,34 +1,16 @@
EZListView : EZLists{
initViews{ arg parentView, bounds, label, labelWidth,labelHeight,arglayout;
- var labelBounds, listBounds,w, winBounds;
+ var labelBounds, listBounds;
- bounds.isNil.if{bounds= 160@200};
labelWidth = labelWidth ? 80;
layout=arglayout ? \vert;
labelSize=labelWidth@labelHeight;
- // if no parent, then pop up window
- parentView.isNil.if{
- if (bounds.class==Point){
- // if bounds is a point the place the window on screen
- winBounds=Rect(200, Window.screenBounds.height-bounds.y-100,
- bounds.x,bounds.y)
- }{winBounds=bounds};
- w = GUI.window.new("",winBounds).alwaysOnTop_(alwaysOnTop);
- parentView=w.asView;
- w.front;
- bounds=bounds.asRect;
- // inset the bounds to make a nice margin
- bounds=Rect(4,4,bounds.width-8,bounds.height-24);
- view=GUI.compositeView.new(parentView,bounds).resize_(5).relativeOrigin_(true);
+ bounds.isNil.if{bounds= 160@200};
- // normal parent view
- }{
- bounds=bounds.asRect;
- view=GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
- };
-
+ // if no parent, then pop up window
+ # view,bounds = this.prPopUpWindow( parentView,bounds);
// calcualate bounds
# labelBounds,listBounds = this.prSubViewBounds(bounds, label.notNil);
Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZNumber.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZNumber.sc 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZNumber.sc 2008-12-31 11:30:36 UTC (rev 8340)
@@ -1,7 +1,7 @@
EZNumberSC : EZGui{
var <numberView, <unitView, <>controlSpec,
- <>action,<value, popUp=false, numSize,numberWidth,unitWidth, gap, gap2;
+ <>action,<value, numSize,numberWidth,unitWidth, gap, gap2;
var <>round = 0.001;
*new { arg parent, bounds, label, controlSpec, action, initVal,
@@ -17,8 +17,7 @@
initAction, labelWidth, argNumberWidth,argUnitWidth,
labelHeight, argLayout, argGap;
- var labelBounds, numBounds,w, winBounds,
- viewBounds, unitBounds;
+ var labelBounds, numBounds, unitBounds;
// try to use the parent decorator gap
var decorator = parentView.asView.tryPerform(\decorator);
@@ -31,33 +30,11 @@
numberWidth = argNumberWidth;
layout=argLayout;
- // if no parent, then pop up window
- parentView.isNil.if{
- popUp=true;
- bounds.isNil.if {bounds= 160@20};
- // if bounds is a point the place the window on screen
- if (bounds.class==Point)
- { bounds = bounds.x@max(bounds.y,bounds.y+24);// window minimum height;
- winBounds=Rect(200, Window.screenBounds.height-bounds.y-100,
- bounds.x,bounds.y)
- }{// window minimum height;
- winBounds = bounds.height_(max(bounds.height,bounds.height+24))
- };
- w = GUI.window.new("",winBounds).alwaysOnTop_(alwaysOnTop);
- parentView=w.asView;
- w.front;
- bounds=bounds.asRect;
- // inset the bounds to make a nice margin
- bounds=Rect(4,4,bounds.width-8,bounds.height-24);
- view=GUI.compositeView.new(parentView,bounds)
- .relativeOrigin_(true).resize_(2);
- // normal parent view
- }{
- bounds.isNil.if{bounds= 160@20};
- bounds=bounds.asRect;
- view=GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
- };
+ bounds.isNil.if {bounds= 160@20};
+ // if no parent, then pop up window
+ # view,bounds = this.prPopUpWindow( parentView,bounds);
+
labelSize=labelWidth@labelHeight;
numSize = numberWidth@labelHeight;
Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZPopUpMenu.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZPopUpMenu.sc 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZPopUpMenu.sc 2008-12-31 11:30:36 UTC (rev 8340)
@@ -1,37 +1,16 @@
EZPopUpMenu : EZLists{
initViews{ arg parentView, bounds, label, labelWidth,labelHeight,arglayout;
- var labelBounds, listBounds,w, winBounds ;
+ var labelBounds, listBounds;
labelWidth = labelWidth ? 80;
layout=arglayout ? \horz;
labelSize=labelWidth@labelHeight;
+ bounds.isNil.if{bounds= 160@44};
+
// if no parent, then pop up window
- parentView.isNil.if{
- bounds.isNil.if{bounds= 160@44};
- // if bounds is a point the place the window on screen
- if (bounds.class==Point){
- bounds = bounds.x@max(bounds.y,bounds.y+24);// window minimum height;
- winBounds=Rect(200, Window.screenBounds.height-bounds.y-100,
- bounds.x,bounds.y)
- }{// window minimum height;
- winBounds = bounds.height_(max(bounds.height,bounds.height+24))
- };
- w = GUI.window.new("",winBounds).alwaysOnTop_(alwaysOnTop);
- parentView=w.asView;
- w.front;
- bounds=bounds.asRect;
- // inset the bounds to make a nice margin
- bounds=Rect(4,4,bounds.width-8,bounds.height-24);
- view=GUI.compositeView.new(parentView,bounds).relativeOrigin_(true).resize_(2);
-
- // normal parent view
- }{
- bounds.isNil.if{bounds= 160@20};
- bounds=bounds.asRect;
- view=GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
- };
+ # view,bounds = this.prPopUpWindow( parentView,bounds);
// calcualate bounds
# labelBounds,listBounds = this.prSubViewBounds(bounds, label.notNil);
Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZRangerSC.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZRangerSC.sc 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZRangerSC.sc 2008-12-31 11:30:36 UTC (rev 8340)
@@ -18,8 +18,7 @@
initAction, labelWidth, argNumberWidth,argUnitWidth,
labelHeight, argLayout, argGap;
- var labelBounds, hiBounds,loBounds, w, winBounds,
- viewBounds, unitBounds,rangerBounds;
+ var labelBounds, hiBounds,loBounds, unitBounds,rangerBounds;
// try to use the parent decorator gap
var decorator = parentView.asView.tryPerform(\decorator);
@@ -32,32 +31,11 @@
numberWidth = argNumberWidth;
layout=argLayout;
- // pop up window
- parentView.isNil.if{
- popUp=true;
- bounds.isNil.if{bounds = 350@20};
- //if its a point, then place the Window on the screen
- if (bounds.class == Point){
- bounds = bounds.x@max(bounds.y,bounds.y+24);// window minimum height;
- winBounds = Rect(200, Window.screenBounds.height-bounds.y-100,
- bounds.x,bounds.y)
- }{// window minimum height;
- winBounds = bounds.height_(max(bounds.height,bounds.height+24))
- };
- w = GUI.window.new("",winBounds).alwaysOnTop_(alwaysOnTop);
- parentView = w.asView;
- w.front;
- bounds = bounds.asRect;
- // inset the bounds to make a nice margin
- bounds = Rect(4,4,bounds.width-8,bounds.height-24);
- view = GUI.compositeView.new(parentView,bounds)
- .relativeOrigin_(true).resize_(5);
- }{
- bounds.isNil.if{bounds = 160@20};
- bounds = bounds.asRect;
- view = GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
- };
+ bounds.isNil.if{bounds = 350@20};
+ // if no parent, then pop up window
+ # view,bounds = this.prPopUpWindow( parentView,bounds);
+
labelSize=labelWidth@labelHeight;
numSize = numberWidth@labelHeight;
Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZSlider.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZSlider.sc 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZSlider.sc 2008-12-31 11:30:36 UTC (rev 8340)
@@ -18,8 +18,7 @@
initAction, labelWidth, argNumberWidth,argUnitWidth,
labelHeight, argLayout, argGap;
- var labelBounds, numBounds,w, winBounds,
- viewBounds, unitBounds,sliderBounds;
+ var labelBounds, numBounds, unitBounds,sliderBounds;
// try to use the parent decorator gap
var decorator = parentView.asView.tryPerform(\decorator);
@@ -31,34 +30,10 @@
unitWidth = argUnitWidth;
numberWidth = argNumberWidth;
layout=argLayout;
+ bounds.isNil.if{bounds = 350@20};
// if no parent, then pop up window
- parentView.isNil.if{
- popUp=true;
- bounds.isNil.if{bounds = 350@20};
- //if its a point, then place the Window on the screen
- if (bounds.class == Point){
- bounds = bounds.x@max(bounds.y,bounds.y+24);// window minimum height;
- winBounds = Rect(200, Window.screenBounds.height-bounds.y-100,
- bounds.x,bounds.y)
- }{// window minimum height;
- winBounds = bounds.height_(max(bounds.height,bounds.height+24))
- };
- w = GUI.window.new("",winBounds).alwaysOnTop_(alwaysOnTop);
- parentView = w.asView;
- w.front;
- bounds = bounds.asRect;
- // inset the bounds to make a nice margin
- bounds = Rect(4,4,bounds.width-8,bounds.height-24);
- view = GUI.compositeView.new(parentView,bounds)
- .relativeOrigin_(true).resize_(5);
-
- // normal parent view
- }{
- bounds.isNil.if{bounds = 160@20};
- bounds = bounds.asRect;
- view = GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
- };
+ # view,bounds = this.prPopUpWindow( parentView,bounds);
labelSize=labelWidth@labelHeight;
numSize = numberWidth@labelHeight;
Modified: trunk/build/SCClassLibrary/Common/GUI/Base/EZgui.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/Base/EZgui.sc 2008-12-30 13:14:01 UTC (rev 8339)
+++ trunk/build/SCClassLibrary/Common/GUI/Base/EZgui.sc 2008-12-31 11:30:36 UTC (rev 8340)
@@ -1,5 +1,5 @@
EZGui{ // an abstract class
- var <>labelView, widget, <view, <gap, <layout, labelSize, <alwaysOnTop=false;
+ var <>labelView, widget, <view, <gap, popUp=false, <layout, labelSize, <alwaysOnTop=false;
visible { ^view.getProperty(\visible) }
visible_ { |bool| view.setProperty(\visible,bool) }
@@ -51,7 +51,33 @@
^[labelBounds, widgetBounds]
}
-
+ prPopUpWindow{arg parentView,bounds; // return a container, or a popUpWindow with a container
+ var w, winBounds, view;
+ parentView.isNil.if{
+ popUp=true;
+ // if bounds is a point the place the window on screen
+ if (bounds.class==Point)
+ { bounds = bounds.x@max(bounds.y,bounds.y+24);// window minimum height;
+ winBounds=Rect(200, Window.screenBounds.height-bounds.y-100,
+ bounds.x,bounds.y)
+ }{// window minimum height;
+ winBounds = bounds.height_(max(bounds.height,bounds.height+24))
+ };
+ w = GUI.window.new("",winBounds).alwaysOnTop_(alwaysOnTop);
+ parentView=w.asView;
+ w.front;
+ bounds=bounds.asRect;
+ // inset the bounds to make a nice margin
+ bounds=Rect(4,4,bounds.width-8,bounds.height-24);
+ view=GUI.compositeView.new(parentView,bounds)
+ .relativeOrigin_(true).resize_(2);
+ // normal parent view
+ }{
+ bounds=bounds.asRect;
+ view=GUI.compositeView.new(parentView,bounds).relativeOrigin_(true);
+ };
+ ^[view,bounds];
+ }
}
@@ -76,7 +102,7 @@
gap = gap ? (2@2)}
{gap=argGap};
- // init the views (hndled by subclasses)
+ // init the views (handled by subclasses)
this.initViews( parentView, bounds, label, labelWidth,labelHeight,layout );
this.items=argItems ? [];
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/