class Alert
package feathers.controls
extends Panel › ScrollContainer › BaseScrollContainer › FeathersControl › MeasureSprite › ValidatingSprite
Displays a message in a modal pop-up dialog with a title and a set of buttons.
In the following example, an alert is shown when a Button
is triggered:
var button = new Button();
button.text = "Click Me";
addChild(button);
button.addEventListener(TriggerEvent.TRIGGER, (event) -> {
Alert.show( "Something bad happened!", "Error", ["OK"]);
});
1.0.0
.See also:
Static variables
staticfinalread onlyCHILD_VARIANT_BUTTON_BAR:String = "alert_buttonBar"
The variant used to style the ButtonBar
child component.
To override this default variant, set the
Alert.customButtonBarVariant
property.
1.0.0
.See also:
staticfinalread onlyCHILD_VARIANT_HEADER:String = "alert_header"
The variant used to style the Header
child component.
To override this default variant, set the
Alert.customHeaderVariant
property.
1.0.0
.See also:
staticfinalread onlyCHILD_VARIANT_MESSAGE_LABEL:String = "alert_messageLabel"
The variant used to style the message Label
child component.
To override this default variant, set the
Alert.customMessageLabelVariant
property.
1.0.0
.See also:
Static methods
staticshow(text:String, ?titleText:String, ?buttonsText:Array<String>, ?callback:(state:ButtonBarItemState) ‑> Void, ?alertFactory:() ‑> Alert, ?popUpAdapter:IPopUpAdapter):Alert
Creates an alert, sets a few common properties, and adds it to the
PopUpManager
.
Note: If no text is provided for the buttons, no buttons will be
displayed, and the Alert will need to be closed manually with
PopUpManager.removePopUp()
.
1.0.0
.Constructor
Variables
buttonBarFactory:AbstractDisplayObjectFactory<Dynamic, ButtonBar>
Creates the button bar, which must be of type
feathers.controls.ButtonBar
.
In the following example, a custom button bar factory is provided:
alert.buttonBarFactory = () ->
{
return new ButtonBar();
};
1.0.0
.See also:
customButtonBarVariant:String
An optional custom variant to use for the alert's button bar, instead of
Alert.CHILD_VARIANT_BUTTON_BAR
.
The customButtonBarVariant
will be not be used if the result of
buttonBarFactory
already has a variant set.
1.0.0
.See also:
customHeaderVariant:String
An optional custom variant to use for the alert's header, instead of
Alert.CHILD_VARIANT_HEADER
.
The customHeaderVariant
will be not be used if the result of
headerFactory
already has a variant set.
1.0.0
.See also:
customMessageLabelVariant:String
An optional custom variant to use for the alert's message label, instead
of Alert.CHILD_VARIANT_MESSAGE_LABEL
.
The customMessageLabelVariant
will be not be used if the result of
messageLabelFactory
already has a variant set.
1.0.0
.See also:
headerFactory:AbstractDisplayObjectFactory<Dynamic, Header>
Creates the header, which must be of type feathers.controls.Header
.
In the following example, a custom header factory is provided:
alert.headerFactory = () ->
{
return new Header();
};
1.0.0
.See also:
htmlText:String
Text displayed by the alert that is parsed as a simple form of HTML.
The following example sets the alert's HTML text:
alert.htmlText = "<b>Hello</b> <i>World</i>";
1.0.0
.See also:
icon:DisplayObject
The display object to use as the alert's icon.
The following example gives the alert an icon:
alert.icon = new Bitmap(bitmapData);
To change the position of the icon relative to the alert's text, see
iconPosition
and gap
.
alert.icon = new Bitmap(bitmapData);
alert.iconPosition = LEFT;
alert.gap = 20.0;
1.0.0
.See also:
messageLabelFactory:AbstractDisplayObjectFactory<Dynamic, Label>
Creates the message label, which must be of type
feathers.controls.Label
.
In the following example, a custom message label factory is provided:
alert.messageLabelFactory = () ->
{
return new Label();
};
1.0.0
.See also:
text:String
The message displayed by the alert.
The following example sets the alert's text:
alert.text = "Good afternoon!";
1.0.0
.