From 8590d5650bb77463e34b44748f29091dd809f9bf Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 25 Sep 2008 00:54:54 +0000 Subject: [PATCH] Added createTipLabel(). git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@661 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flex/FlexUtil.as | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/flex/FlexUtil.as b/src/as/com/threerings/flex/FlexUtil.as index 55c4aa57..62f0282d 100644 --- a/src/as/com/threerings/flex/FlexUtil.as +++ b/src/as/com/threerings/flex/FlexUtil.as @@ -32,18 +32,31 @@ import mx.core.UIComponent; public class FlexUtil { /** - * How hard would it have been for them to make Label accept an optional text argument? + * Creates a label with the supplied text and tooltip, and optionally applies a style class to + * it. */ - public static function createLabel (text :String, style :String = null) :Label + public static function createTipLabel ( + text :String, toolTip :String, style :String = null) :Label { var label :Label = new Label(); label.text = text; + if (toolTip != null) { + label.toolTip = toolTip; + } if (style != null) { label.styleName = style; } return label; } + /** + * Creates a label with the supplied text, and optionally applies a style class to it. + */ + public static function createLabel (text :String, style :String = null) :Label + { + return createTipLabel(text, null, style); + } + /** * How hard would it have been for them make Spacer accept two optional arguments? */