Moved these here from inside metasoy.

Grid changed into GridUtil.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@143 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2007-02-02 19:44:04 +00:00
parent dddf409ad7
commit 7ff794343c
3 changed files with 149 additions and 0 deletions
@@ -0,0 +1,40 @@
//
// $Id$
package com.threerings.flex {
import flash.display.DisplayObjectContainer;
import mx.core.ContainerCreationPolicy;
import mx.core.UIComponent;
import mx.containers.VBox;
public class LazyContainer extends VBox
{
/**
* Create a lazy container that will not create its children
* until needed.
*
* @param creation a function that takes no args and returns
* a UIComponent to be added to the container.
*/
public function LazyContainer (creation :Function)
{
_creation = creation;
creationPolicy = ContainerCreationPolicy.NONE;
}
override public function createComponentsFromDescriptors (
recurse :Boolean = true) :void
{
super.createComponentsFromDescriptors(recurse);
if (_creation != null) {
addChild(_creation() as UIComponent);
_creation = null; // assist gc
}
}
protected var _creation :Function;
}
}