From cd276073a215831106ebf034b28bd043f0514cfb Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Tue, 9 Dec 2008 00:34:32 +0000 Subject: [PATCH] Helper to make a multiline text that fills the width of its parent. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@733 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flex/FlexUtil.as | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/as/com/threerings/flex/FlexUtil.as b/src/as/com/threerings/flex/FlexUtil.as index e8aeb337..88cc45ba 100644 --- a/src/as/com/threerings/flex/FlexUtil.as +++ b/src/as/com/threerings/flex/FlexUtil.as @@ -72,6 +72,19 @@ public class FlexUtil return t; } + /** + * Create an uneditable/unselectable multiline Text widget with 100% width. + */ + public static function createWideText (text :String, style :String = null) :Text + { + var t :Text = new Text(); + t.styleName = style; + t.percentWidth = 100; + t.selectable = false; + t.text = text; + return t; + } + /** * How hard would it have been for them make Spacer accept two optional arguments? */