Added createLabel().
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@543 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -21,13 +21,27 @@
|
|||||||
|
|
||||||
package com.threerings.flex {
|
package com.threerings.flex {
|
||||||
|
|
||||||
|
import mx.controls.Label;
|
||||||
import mx.controls.Spacer;
|
import mx.controls.Spacer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps a non-Flex component for use in Flex.
|
* Flex-related utility methods.
|
||||||
*/
|
*/
|
||||||
public class FlexUtil
|
public class FlexUtil
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* How hard would it have been for them to make Label accept an optional text argument?
|
||||||
|
*/
|
||||||
|
public static function createLabel (text :String, style :String = null) :Label
|
||||||
|
{
|
||||||
|
var label :Label = new Label();
|
||||||
|
label.text = text;
|
||||||
|
if (style != null) {
|
||||||
|
label.styleName = style;
|
||||||
|
}
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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