Class fvaswing.components.FvAlert

Description

Alert dialog box.

The Alert control is modal, which means it will retain focus until the user closes it.

Is connected to Fever Localisation API

	public function test() : Void
	{
		var alert : FvAlert = new FvAlert( FvAlertType.OK_ONLY );
		alert.message = "Delete this file";
		alert.title = "Caution";
		alert.addListener( this, _onResult );
		alert.enabledBlurEffect = true;
		alert.open( );
	}
	
	private function _onResult( event : FvAlertEvent ) : Void
	{
		if( event.getButton() == FvAlert.BUTTON_YES )
		{
			//do something
		}
	}
	
 

See Also

Field Index

alertType, buttonHeight, buttonWidth, defaultButton, enabledBlurEffect, icon, message, onAlertClosedEvent, title

Method Index

new FvAlert()
addListener(), close(), fireClose(), isOpen(), open(), removeListener(), show()

Inherited from FvAlertView

Constructor Detail

Field Detail

onAlertClosedEvent

static public onAlertClosedEvent:EventType
Event type braodcasted when alert is closed.

buttonHeight

static public buttonHeight:Number
Height of each Alert button, in pixels.

buttonWidth

static public buttonWidth:Number
Width of each Alert button, in pixels.

alertType

defaultButton

message

public message:String
Indicates the alert message to be displayed.

title

public title:String
Indicates the alert dialog caption.

icon

public icon:Icon
Indicates the icon to be displayed in alert message.

enabledBlurEffect

public enabledBlurEffect:Boolean

Method Detail

show

static public function show(text:String, caption:String, type:FvAlertType, listener, customIcon:Icon, defaultFlag:FvAlertButton):FvAlert

addListener

public function addListener(listener):Void

Adds listener to close alert event.

removeListener

public function removeListener(listener):Void

Remove the specified event listener.

Parameters

listenerthe listener which will be removed.

isOpen

public function isOpen():Boolean

Indicates if current alert instance is opened or not.

Return

true if alert is opened.

open

public function open():Void

Displays the alert window.

The buttons label are automatically update

close

public function close():Void

Closes the alert window.

When user click on 'close button', the ON_ALERT_CLOSED event is dispatched with BUTTON_CANCEL id.

fireClose

public function fireClose(button:FvAlertButton):Void

Forces the dialog to be closed.