class TextCallout
package feathers.controls
extends Callout › FeathersControl › MeasureSprite › ValidatingSprite
implements IHTMLTextControl, ITextControl
A special type of Callout
designed to display text only.
In the following example, a text callout is shown when a Button
is
triggered:
function button_triggerHandler(event:TriggerEvent):Void
{
var button = cast(event.currentTarget, Button);
TextCallout.show("Hello World", button);
}
button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
1.0.0
.See also:
Static variables
staticfinalread onlyVARIANT_DANGER:String = "danger"
A variant used to style the callout in a style that indicates that something related to the origin is considered dangerous or in error. Variants allow themes to provide an assortment of different appearances for the same type of UI component.
The following example uses this variant:
callout.variant = TextCallout.VARIANT_DANGER;
1.0.0
.See also:
Static methods
staticshow(text:String, origin:DisplayObject, ?supportedPositions:RelativePositions, modal:Bool = true):TextCallout
Creates a text callout, and then positions and sizes it automatically based based on an origin component and an optional set of positions.
In the following example, a text callout is shown when a Button
is
triggered:
function button_triggerHandler(event:TriggerEvent):Void
{
var button = cast(event.currentTarget, Button);
TextCallout.show("Hello World", button);
}
button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
1.0.0
.Constructor
new(text:String = "")
Creates a new TextCallout
object.
In general, a TextCallout
shouldn't be instantiated directly with the
constructor. Instead, use the static function TextCallout.show()
to
create a TextCallout
, as this often requires less pop-up management
code.
1.0.0
.See also:
Variables
disabledTextFormat:AbstractTextFormat
The font styles used to render the text callout's text when the text callout is disabled.
In the following example, the text callout's disabled text formatting is customized:
callout.enabled = false;
callout.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
1.0.0
.See also:
embedFonts:Bool
Determines if an embedded font is used or not.
In the following example, the callout uses embedded fonts:
callout.embedFonts = true;
1.0.0
.See also:
htmlText:String
Text displayed by the callout that is parsed as a simple form of HTML.
The following example sets the callout's HTML text:
callout.htmlText = "<b>Hello</b> <i>World</i>";
1.0.0
.See also:
text:String
The text displayed by the text callout.
The following example creates a text callout and changes its text:
var callout = TextCallout.show("Good morning!", origin);
callout.text = "Good afternoon!";
1.0.0
.See also:
textFormat:AbstractTextFormat
The font styles used to render the text callout's text.
In the following example, the text callout's formatting is customized:
callout.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
1.0.0
.See also: