Added createText() for conveniently creating a multiline text widget.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@677 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2008-10-27 23:42:03 +00:00
parent c420e540d6
commit df41e4e849
+14
View File
@@ -23,6 +23,7 @@ package com.threerings.flex {
import mx.controls.Label;
import mx.controls.Spacer;
import mx.controls.Text;
import mx.core.Container;
import mx.core.UIComponent;
@@ -58,6 +59,19 @@ public class FlexUtil
return createTipLabel(text, null, style);
}
/**
* Create an uneditable/unselectable multiline Text widget with the specified text and width.
*/
public static function createText (text :String, width :int, style :String = null) :Text
{
var t :Text = new Text();
t.styleName = style;
t.width = width;
t.selectable = false;
t.text = text;
return t;
}
/**
* How hard would it have been for them make Spacer accept two optional arguments?
*/