Index: lams_flash/src/common/flash/org/lamsfoundation/lams/common/ui/LFMessage.as
===================================================================
diff -u -r245728d04c9feab340685e9d94b5623e0f9a1d74 -re2883d54b929369b486573d1c056a8d7d7e44825
--- lams_flash/src/common/flash/org/lamsfoundation/lams/common/ui/LFMessage.as (.../LFMessage.as) (revision 245728d04c9feab340685e9d94b5623e0f9a1d74)
+++ lams_flash/src/common/flash/org/lamsfoundation/lams/common/ui/LFMessage.as (.../LFMessage.as) (revision e2883d54b929369b486573d1c056a8d7d7e44825)
@@ -49,111 +49,43 @@
title = Dictionary.getValue('al_alert')
}
-
- /**
- * Shows an alert dialogue. specify the OK Handler and icon.
- * @usage
- * @param msg Message to display
- * @param okHandler TO execute on click - use the proxy function
- * @param icon string linkage name of icon in library
-
- public static function showMessageAlert(msg ,okHandler, icon){
- var alt:Alert;
- //TODO: increase line breaks to account for stoopid bug in MMs alert.
- // if an icon is being used then the width of the icon is not taken into account
- //msg += "\n \n \n \n ";
- Alert.okLabel = Dictionary.getValue('al_ok');
-
- if(okHandler != undefined){
- alt = Alert.show(msg + newline + "\n ", Dictionary.getValue('al_alert') + "\t\t\t\t\t", Alert.OK, null, okHandler, null, Alert.OK);
- }else{
- alt = Alert.show(msg + newline + "\n ", Dictionary.getValue('al_alert') + "\t\t\t\t\t", Alert.OK, null, null, null, Alert.OK);
- }
-
- alt.buttonWidth = 50;
-
- }
- */
+ public static function showMessageAlert(msg, okHandler){
+ var title:String = "" + Dictionary.getValue('al_alert') + "\n";
+ var _dialog:MovieClip;
+
+ if(okHandler != undefined){
+ _dialog = Dialog.createAlertDialog(title, msg, Dictionary.getValue('al_ok'), null, okHandler, null, AlertDialog.ALERT);
+ }else{
+ _dialog = Dialog.createAlertDialog(title, msg, Dictionary.getValue('al_ok'), null, null, null, AlertDialog.ALERT);
+ }
+ }
- public static function showMessageAlert(msg, okHandler){
- var title:String = "" + Dictionary.getValue('al_alert') + "\n";
- var _dialog:MovieClip;
-
- if(okHandler != undefined){
- _dialog = Dialog.createAlertDialog(title, msg, Dictionary.getValue('al_ok'), null, okHandler, null, AlertDialog.ALERT);
- }else{
- _dialog = Dialog.createAlertDialog(title, msg, Dictionary.getValue('al_ok'), null, null, null, AlertDialog.ALERT);
- }
-
- Debugger.log("dialog: " + _dialog, Debugger.CRITICAL, "showMessageAlert", "LFMessage");
- }
+ public static function showMessageConfirm(msg:String, okHandler:Function, cancelHandler:Function, okLabel:String, cancelLabel:String, msgTitle:String){
+ var _dialog:MovieClip;
+
+ if(msgTitle == null){
+ msgTitle = Dictionary.getValue('al_confirm');
+ }
+
+ var title:String = "" + msgTitle + "\n";
+
+ if(!okLabel){
+ okLabel = Dictionary.getValue('al_ok');
+ }
+
+ if(!cancelLabel){
+ cancelLabel = Dictionary.getValue('al_cancel');
+ }
+
+ _dialog = Dialog.createAlertDialog(title, msg, okLabel, cancelLabel, okHandler, cancelHandler, AlertDialog.CONFIRM);
+ }
- public static function showMessageConfirm(msg:String, okHandler:Function, cancelHandler:Function, okLabel:String, cancelLabel:String, msgTitle:String){
- var _dialog:MovieClip;
-
- if(msgTitle == null){
- msgTitle = Dictionary.getValue('al_confirm');
- }
-
- var title:String = "" + msgTitle + "\n";
-
- if(!okLabel){
- okLabel = Dictionary.getValue('al_ok');
- }
-
- if(!cancelLabel){
- cancelLabel = Dictionary.getValue('al_cancel');
- }
-
- _dialog = Dialog.createAlertDialog(title, msg, okLabel, cancelLabel, okHandler, cancelHandler, AlertDialog.CONFIRM);
-
- Debugger.log("dialog: " + _dialog, Debugger.CRITICAL, "showMessageConfirm", "LFMessage");
- }
-
- /**
- * Shows an alert confirm dialogue. It is centred in the root time line and diplays the standard LAMS alert icon
- * @usage
- * @param msg The message to display
- * @param handler A handler for the click events broadcast when the buttons are clicked. In addition to the standard click event object properties, there is an additional detail property, which contains the flag value of the button that was clicked (Alert.OK, Alert.CANCEL, Alert.YES, Alert.NO). This handler can be a function or an object
- * @return
- /
- public static function showMessageConfirm(msg:String,okHandler:Function, cancelHandler:Function, okLabel:String, cancelLabel:String, msgTitle:String){
- var alt:Alert;
- if(msgTitle == null){
- msgTitle = Dictionary.getValue('al_confirm');
+ public function get reference():Object{
+ return _ref;
}
-
- var handlerObj = new Object();
- handlerObj.click = function(e){
- if(e.detail == Alert.OK){
- okHandler();
- }else if(e.detail == Alert.CANCEL){
- cancelHandler();
- }else{
- Debugger.log('Unknown event detail form confirm:'+e.detail,Debugger.CRITICAL,"showMessageConfirm",'LFMessage');
- }
+
+ public function get fname():String{
+ return _fn;
}
-
- if(okLabel){
- Alert.okLabel = okLabel;
- }else{
- Alert.okLabel = Dictionary.getValue('al_ok');
- }
- if(cancelLabel){
- Alert.cancelLabel= cancelLabel;
- }else{
- Alert.cancelLabel= Dictionary.getValue('al_cancel');
- }
- alt = Alert.show(msg, msgTitle, Alert.OK | Alert.CANCEL, null, handlerObj, null, Alert.OK);
- }
- */
- public function get reference():Object{
- return _ref;
- }
-
- public function get fname():String{
- return _fn;
- }
-
}
\ No newline at end of file