| Package | qnx.dialog |
| Class | public class BaseDialog |
| Inheritance | BaseDialog flash.events.EventDispatcher |
| Subclasses | AlertDialog, LoginDialog, PasswordChangeDialog, PopupList, PromptDialog |
BaseDialog class is the base class for all dialogs in the system. It creates
the background to stop clickthroughs, it provides the row of buttons, and contains the show/hide
functions and other methods that can be overriden by classes inheriting this
base class.
| Property | Defined By | ||
|---|---|---|---|
| align : String [write-only]
Sets the position of the dialog. | BaseDialog | ||
| defaultButtonIndex : int
Gets or sets the default button index value. | BaseDialog | ||
| dialogSize : String
Gets or sets the size of the dialog. | BaseDialog | ||
| hideOnButtonClick : Boolean
Gets or sets the a value that determines if the dialog will close
when the user clicks a button. | BaseDialog | ||
| hideOnOutsideClick : Boolean
Gets or sets the a value that determines if the dialog will close
when the user clicks outside the dialog ( perhaps on the modal ). | BaseDialog | ||
| id : String
The ID of the dialog, where each ID is unique to the client owner. | BaseDialog | ||
| modalAlpha : Number [write-only]
Sets the background alpha value. | BaseDialog | ||
| selectedIndex : int [read-only]
Returns the selected index of the button (that was clicked). | BaseDialog | ||
| title : String [write-only]
Sets the text for the dialog's title. | BaseDialog | ||
| titleHtml : String [write-only]
Sets the html text for the dialog's title. | BaseDialog | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a BaseDialog instance. | BaseDialog | ||
addButton(label:String):int
Adds a button to the dialog. | BaseDialog | ||
cancel():void
Cancels or hides the dialog. | BaseDialog | ||
getButtonCount():int
Return the button count from the button array. | BaseDialog | ||
getButtonPropertyAt(prop:String, index:int):Object
Gets the value of a property, given the property name and property object index. | BaseDialog | ||
getItemAt(index:int):Object
Returns the button at the given index. | BaseDialog | ||
removeButtonAt(index:int):void
Removes a button from the dialog, given an index. | BaseDialog | ||
sendDescription():Object
Gathers up and returns the description object for the dialog (client side). | BaseDialog | ||
setButtonPropertyAt(prop:String, value:Object, index:int):void
Sets a button property given a property name, a property value, and the index of a button property object. | BaseDialog | ||
show(groupId:String = null):void
Shows the dialog on the screen as a system or application dialog. | BaseDialog | ||
update():void
Updates the dialog to reflect its current attributes. | BaseDialog | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when a button in the dialog has been clicked. | BaseDialog | |||
| align | property |
align:String [write-only] Sets the position of the dialog.
One of:
DialogAlign.BOTTOMDialogAlign.CENTERDialogAlign.TOP public function set align(value:String):voidSee also
| defaultButtonIndex | property |
defaultButtonIndex:intGets or sets the default button index value. This value is used to determine what button data to send in the event that the user hits the return key.
public function get defaultButtonIndex():int public function set defaultButtonIndex(value:int):void| dialogSize | property |
dialogSize:StringGets or sets the size of the dialog.
One of:
DialogSize.SIZE_FULLDialogSize.SIZE_LARGEDialogSize.SIZE_MEDIUMDialogSize.SIZE_SHORTDialogSize.SIZE_SMALLDialogSize.SIZE_TALLDialogSize.SIZE_WIDE public function get dialogSize():String public function set dialogSize(value:String):voidSee also
| hideOnButtonClick | property |
hideOnButtonClick:BooleanGets or sets the a value that determines if the dialog will close when the user clicks a button.
Set to true if the dialog must be cancelled by the caller to be removed from the screen. By default, dialogs are removed when a button is pressed.
public function get hideOnButtonClick():Boolean public function set hideOnButtonClick(value:Boolean):void| hideOnOutsideClick | property |
hideOnOutsideClick:BooleanGets or sets the a value that determines if the dialog will close when the user clicks outside the dialog ( perhaps on the modal ).
public function get hideOnOutsideClick():Boolean public function set hideOnOutsideClick(value:Boolean):void| id | property |
public var id:StringThe ID of the dialog, where each ID is unique to the client owner.
| modalAlpha | property |
modalAlpha:Number [write-only] Sets the background alpha value.
public function set modalAlpha(value:Number):void| selectedIndex | property |
selectedIndex:int [read-only] Returns the selected index of the button (that was clicked).
public function get selectedIndex():int| title | property |
title:String [write-only] Sets the text for the dialog's title.
public function set title(value:String):void| titleHtml | property |
titleHtml:String [write-only] Sets the html text for the dialog's title.
The titleHtml function improves the look and feel of your dialogs by providing HTML formatting to text elements. In the
following listing, the title text of a dialog is centered using an HTML paragraph tag, and styled using the italic and bold tags.
var dialog:AlertDialog = new AlertDialog();
dlaoig.titleHtml = "<p align='center'><b><i>My HTML formatted title</i></b></p>";
public function set titleHtml(value:String):void| BaseDialog | () | Constructor |
public function BaseDialog()
Creates a BaseDialog instance.
This method initializes the description and response objects, and sets up the background for the dialog.
| addButton | () | method |
public function addButton(label:String):intAdds a button to the dialog.
Parameters
label:String — The button label.
|
int — int The index number of the button.
|
| cancel | () | method |
public function cancel():voidCancels or hides the dialog.
| getButtonCount | () | method |
public function getButtonCount():intReturn the button count from the button array.
Returnsint — int The number of buttons on the dialog.
|
| getButtonPropertyAt | () | method |
public function getButtonPropertyAt(prop:String, index:int):ObjectGets the value of a property, given the property name and property object index.
Parameters
prop:String — The property String value.
| |
index:int — The index of the property object to inspect.
|
Object |
See also
| getItemAt | () | method |
public function getItemAt(index:int):ObjectReturns the button at the given index.
Parameters
index:int — The index of the button object.
|
Object — A Button object.
|
| removeButtonAt | () | method |
public function removeButtonAt(index:int):voidRemoves a button from the dialog, given an index.
Parameters
index:int — The index of the button to remove.
|
| sendDescription | () | method |
public function sendDescription():ObjectGathers up and returns the description object for the dialog (client side).
ReturnsObject |
| setButtonPropertyAt | () | method |
public function setButtonPropertyAt(prop:String, value:Object, index:int):voidSets a button property given a property name, a property value, and the index of a button property object.
In the following listing, the button at the second index position is disabled.
alert.setButtonPropertyAt(DialogButtonProperty.ENABLED, false, 1);
Parameters
prop:String — The name of the property to set.
| |
value:Object — The value of the property.
| |
index:int — The index of a button property object.
|
See also
| show | () | method |
public function show(groupId:String = null):voidShows the dialog on the screen as a system or application dialog.
Note: If you're creating a dialog for your application, it's a good idea to pass in a valid group ID:
alert.show(IowWindow.getAirWindow().group);
Parameters
groupId:String (default = null) — The group ID of the application to which the dialog belongs (null for a system dialog).
|
| update | () | method |
public function update():voidUpdates the dialog to reflect its current attributes.
| select | Event |
flash.events.Eventflash.events.Event.SELECTDispatched when a button in the dialog has been clicked.