SF.net SVN: supercollider: [7651] trunk/build/SCClassLibrary/crucial

View: New views
1 Messages — Rating Filter:   Alert me  

SF.net SVN: supercollider: [7651] trunk/build/SCClassLibrary/crucial

by cruxxial :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Revision: 7651
          http://svn.sourceforge.net/supercollider/?rev=7651&view=rev
Author:   cruxxial
Date:     2008-07-05 12:27:26 -0700 (Sat, 05 Jul 2008)

Log Message:
-----------
small optimization with reflowDeep
adding spacing argument to .horz  , .vert etc.
other checkins just code cleanups

Modified Paths:
--------------
    trunk/build/SCClassLibrary/crucial/Gui/ActionButton.sc
    trunk/build/SCClassLibrary/crucial/Gui/SelectButtonSet.sc
    trunk/build/SCClassLibrary/crucial/Gui/SynthConsole.sc
    trunk/build/SCClassLibrary/crucial/UncoupledUsefulThings/viewExtensions.sc

Modified: trunk/build/SCClassLibrary/crucial/Gui/ActionButton.sc
===================================================================
--- trunk/build/SCClassLibrary/crucial/Gui/ActionButton.sc 2008-07-05 18:59:41 UTC (rev 7650)
+++ trunk/build/SCClassLibrary/crucial/Gui/ActionButton.sc 2008-07-05 19:27:26 UTC (rev 7651)
@@ -190,6 +190,7 @@
  })
  });
  }
+ // returns the new bounds
  resizeToFit { arg reflow = false,tryParent = false;
  var used,new;
 
@@ -211,6 +212,7 @@
  this.decorator.bounds = new; // if the left/top moved this buggers it
  };
  if(reflow,{ this.reflowAll; });
+ // its better to call reflowDeep on the parent
  if(tryParent,{
  this.parent.tryPerform(\resizeToFit,reflow,tryParent);
  });
@@ -220,12 +222,10 @@
  reflowDeep {
  this.allChildren.reverseDo({ |view|
  if(view.isKindOf(FlowView),{
- view.bounds = view.bounds.resizeTo(1000,1000);
+ view.bounds_(view.bounds.resizeTo(2000,2000),false);
  view.reflowAll.resizeToFit;
  });
  });
- // sometimes this doesn't work, but if you do it twice it usually does
-
 // best way:
 // enlarge the view to full bounds within its parent.
 // this can only be done if you are the last or only child

Modified: trunk/build/SCClassLibrary/crucial/Gui/SelectButtonSet.sc
===================================================================
--- trunk/build/SCClassLibrary/crucial/Gui/SelectButtonSet.sc 2008-07-05 18:59:41 UTC (rev 7650)
+++ trunk/build/SCClassLibrary/crucial/Gui/SelectButtonSet.sc 2008-07-05 19:27:26 UTC (rev 7651)
@@ -32,8 +32,6 @@
 
    butts=
  labelArray.collect({ arg la,i;
- //var r;
- //r = layout.layRight(x.max(la.asString.size * 7),y);
  GUI.button.new(layout,(x@y))
  .states_([[la.asString,Color.black,colorFunc.value(i)],
  [la.asString,Color.black,selectedColor.value(i)]])

Modified: trunk/build/SCClassLibrary/crucial/Gui/SynthConsole.sc
===================================================================
--- trunk/build/SCClassLibrary/crucial/Gui/SynthConsole.sc 2008-07-05 18:59:41 UTC (rev 7650)
+++ trunk/build/SCClassLibrary/crucial/Gui/SynthConsole.sc 2008-07-05 19:27:26 UTC (rev 7651)
@@ -191,10 +191,10 @@
  }
 
  print {
- ActionButton(layout,"#",{ object.asCompileString.postln });
+ ActionButton(layout,"post",{ object.asCompileString.postln });
  }
  printPath {
- ActionButton(layout,"#path",{ path.value.asCompileString.postln })
+ ActionButton(layout,"post path",{ path.value.asCompileString.postln })
  }
  save { arg title="save",minWidth=100;
  ActionButton(layout,title,{

Modified: trunk/build/SCClassLibrary/crucial/UncoupledUsefulThings/viewExtensions.sc
===================================================================
--- trunk/build/SCClassLibrary/crucial/UncoupledUsefulThings/viewExtensions.sc 2008-07-05 18:59:41 UTC (rev 7650)
+++ trunk/build/SCClassLibrary/crucial/UncoupledUsefulThings/viewExtensions.sc 2008-07-05 19:27:26 UTC (rev 7651)
@@ -40,17 +40,19 @@
  ^f
  }
 
- horz { arg func,bounds;
+ horz { arg func,bounds,spacing;
  var comp;
  comp = GUI.hLayoutView.new(this,bounds ?? { this.decorator.indentedRemaining });
  comp.tryPerform('relativeOrigin_',true);
+ comp.spacing = spacing ? GUI.skin.gap.x;
  func.value(comp);
  ^comp
  }
- vert { arg func,bounds;
+ vert { arg func,bounds,spacing;
  var comp;
  comp = GUI.vLayoutView.new(this,bounds ?? { this.decorator.indentedRemaining });
  comp.tryPerform('relativeOrigin_',true);
+ comp.spacing = spacing ? GUI.skin.gap.y;
  func.value(comp);
  ^comp
  }
@@ -86,11 +88,11 @@
  flow { arg func,bounds;
  ^this.view.flow(func,bounds)
  }
- vert { arg func,bounds;
- ^this.view.vert(func,bounds)
+ vert { arg func,bounds,spacing;
+ ^this.view.vert(func,bounds,spacing)
  }
- horz { arg func,bounds;
- ^this.view.horz(func,bounds)
+ horz { arg func,bounds,spacing;
+ ^this.view.horz(func,bounds,spacing)
  }
  comp { arg func,bounds;
  ^this.view.comp(func,bounds)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
sc-dev mailing list
sc-dev@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-dev