qnx.dialog.BaseDialog

BaseDialog

Properties | Methods | Events


Packageqnx.dialog
Classpublic class BaseDialog
InheritanceBaseDialog Inheritance flash.events.EventDispatcher
Subclasses AlertDialog, LoginDialog, PasswordChangeDialog, PopupList, PromptDialog

The 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.

Class information:
PlayBook Tablet OS Version:   1.0.6



Public Properties

 PropertyDefined 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
  leaveFocus : Boolean
[write-only] Sets the leaveFocus property for the dialog.
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

Public Methods

 MethodDefined 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
  
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
  
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

Events

 Event Summary Defined By
  Dispatched when a button in the dialog has been clicked.BaseDialog

Property Detail

align


align:String  [write-only]

Sets the position of the dialog.

One of:

  • DialogAlign.BOTTOM
  • DialogAlign.CENTER
  • DialogAlign.TOP


Implementation

public function set align(value:String):void

See also

DialogAlign

defaultButtonIndex


defaultButtonIndex:int

Gets 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.


Implementation

public function get defaultButtonIndex():int
public function set defaultButtonIndex(value:int):void

dialogSize


dialogSize:String

Gets or sets the size of the dialog.

One of:

  • DialogSize.SIZE_FULL
  • DialogSize.SIZE_LARGE
  • DialogSize.SIZE_MEDIUM
  • DialogSize.SIZE_SHORT
  • DialogSize.SIZE_SMALL
  • DialogSize.SIZE_TALL
  • DialogSize.SIZE_WIDE


Implementation

public function get dialogSize():String
public function set dialogSize(value:String):void

See also

DialogSize

hideOnButtonClick


hideOnButtonClick:Boolean

Gets 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.


Implementation

public function get hideOnButtonClick():Boolean
public function set hideOnButtonClick(value:Boolean):void

hideOnOutsideClick


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 ).


Implementation

public function get hideOnOutsideClick():Boolean
public function set hideOnOutsideClick(value:Boolean):void

id


public var id:String

The ID of the dialog, where each ID is unique to the client owner.

leaveFocus


leaveFocus:Boolean  [write-only]

Sets the leaveFocus property for the dialog. This property can be used to ensure the dialog does not steal input focus from an existing window.


Implementation

public function set leaveFocus(value:Boolean):void

modalAlpha


modalAlpha:Number  [write-only]

Sets the background alpha value.


Implementation

public function set modalAlpha(value:Number):void

selectedIndex


selectedIndex:int  [read-only]

Returns the selected index of the button (that was clicked).


Implementation

public function get selectedIndex():int

title


title:String  [write-only]

Sets the text for the dialog's title.


Implementation

public function set title(value:String):void

titleHtml


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>";
         


Implementation

public function set titleHtml(value:String):void

Constructor Detail

BaseDialog()


public function BaseDialog()

Creates a BaseDialog instance.

This method initializes the description and response objects, and sets up the background for the dialog.

Method Detail

addButton()


public function addButton(label:String):int

Adds a button to the dialog.

Parameters

label:String — The button label.

Returns

int — int The index number of the button.

cancel()


public function cancel():void

Cancels or hides the dialog.

getButtonCount()


public function getButtonCount():int

Return the button count from the button array.

Returns

int — int The number of buttons on the dialog.

getButtonPropertyAt()


public function getButtonPropertyAt(prop:String, index:int):Object

Gets 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.

Returns

Object

See also

DialogButtonProperty

getItemAt()


public function getItemAt(index:int):Object

Returns the button at the given index.

Parameters

index:int — The index of the button object.

Returns

Object — A Button object.

removeButtonAt()


public function removeButtonAt(index:int):void

Removes a button from the dialog, given an index.

Parameters

index:int — The index of the button to remove.

sendDescription()


public function sendDescription():Object

Gathers up and returns the description object for the dialog (client side).

Returns

Object

setButtonPropertyAt()


public function 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.

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

DialogButtonProperty

show()


public function show(groupId:String = null):void

Shows 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);
         
This ensures that the dialog will be modal for only your application. In other words, your application can still be minimized when this dialog is active. If you're creating a system-level dialog, don't pass in a group ID.

Parameters

groupId:String (default = null) — The group ID of the application to which the dialog belongs (null for a system dialog).

update()


public function update():void

Updates the dialog to reflect its current attributes.

Event Detail

select


Event Object Type: flash.events.Event
Event.type property = flash.events.Event.SELECT

Dispatched when a button in the dialog has been clicked.