Quantcast
Channel: Dirty Motherfucking Blog » aswing
Viewing all articles
Browse latest Browse all 4

MessageBox Class for AsWing

$
0
0

I lately commited a new class to the AsWing Kit SVN.

It enables you to display simple message boxes in AsWing based ActionScript applications.
The class was modeled after the Windows API function MessageBox().

AsWing MessageBox

The repository can be accessed through http://svn.aswing.org/aswingkit

/**
* Opens the global MessageBox instance with the supplied parameters set.
* When the MessageBox is closed it will call the closeHandler function.
* If the user added a Help button to the box and it is clicked, the helpHandler function will be called. Clicking the help button doesn't close the MessageBox.
* Example: <code>MessageBox.showDialog( null, "An error has occured.", "Error", MessageBox.ICON_ERROR | MessageBox.ABORT_RETRY_IGNORE | MessageBox.HELP, function( button:String ):void { trace( button ); } );</code>
* @param    owner The owner for the JFrame instance. This can be left as null.
* @param    text The text to be displayed in the MessageBox.
* @param    caption The caption of the MessageBox. Default is "Error".
* @param    type A combination of flags that describe the type of MessageBox.
* This can be a combination of a button flag (plus optional help button), an icon flag and text orientation. Optionally the text can be made selectable.
* The default value is: <code>OK_ONLY | ICON_NONE | TEXT_ORIENTATION_LEFT | STATIC_TEXT</code>
* @param    closeHandler This function will be called when the MessageBox is closed. It sends one parameter which is one of the button flags.
* Possible flags are: <code>ABORT, CANCEL, CONTINUE, IGNORE, NO, OK, RETRY, TRY_AGAIN, YES</code>
* @param    helpHandler This function will be called when the user clicks the help button.
*/
public static function showDialog( owner:* = null, text:String = "", caption:String = "Error", type:uint = 0, closeHandler:Function = null, helpHandler:Function = null ):void {

Viewing all articles
Browse latest Browse all 4

Trending Articles