From df41e4e8491f6c7050e2e7f8c05908ca78943201 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 27 Oct 2008 23:42:03 +0000 Subject: [PATCH] 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 --- src/as/com/threerings/flex/FlexUtil.as | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/as/com/threerings/flex/FlexUtil.as b/src/as/com/threerings/flex/FlexUtil.as index 7f1228bb..e8aeb337 100644 --- a/src/as/com/threerings/flex/FlexUtil.as +++ b/src/as/com/threerings/flex/FlexUtil.as @@ -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? */