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:
@@ -23,6 +23,7 @@ package com.threerings.flex {
|
|||||||
|
|
||||||
import mx.controls.Label;
|
import mx.controls.Label;
|
||||||
import mx.controls.Spacer;
|
import mx.controls.Spacer;
|
||||||
|
import mx.controls.Text;
|
||||||
|
|
||||||
import mx.core.Container;
|
import mx.core.Container;
|
||||||
import mx.core.UIComponent;
|
import mx.core.UIComponent;
|
||||||
@@ -58,6 +59,19 @@ public class FlexUtil
|
|||||||
return createTipLabel(text, null, style);
|
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?
|
* How hard would it have been for them make Spacer accept two optional arguments?
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user