DwtMessageDialog.js
Summary
No overview generated for 'DwtMessageDialog.js'
Class Summary
|
DwtMessageDialog |
This class represents a reusable message dialog box. |
function DwtMessageDialog(parent, className, buttons, extraButtons) {
if (arguments.length == 0) return;
this._msgCellId = Dwt.getNextId();
buttons = buttons ? buttons : [DwtDialog.OK_BUTTON];
DwtDialog.call(this, parent, className, null, buttons, extraButtons);
this.setContent(this._contentHtml());
this._msgCell = document.getElementById(this._msgCellId);
this.addEnterListener(new AjxListener(this, this._enterListener));
};
DwtMessageDialog.prototype = new DwtDialog;
DwtMessageDialog.prototype.constructor = DwtMessageDialog;
DwtMessageDialog.CRITICAL_STYLE = 1;
DwtMessageDialog.INFO_STYLE = 2;
DwtMessageDialog.WARNING_STYLE = 3;
DwtMessageDialog.TITLE = new Object();
DwtMessageDialog.TITLE[DwtMessageDialog.CRITICAL_STYLE] = AjxMsg.criticalMsg;
DwtMessageDialog.TITLE[DwtMessageDialog.INFO_STYLE] = AjxMsg.infoMsg
DwtMessageDialog.TITLE[DwtMessageDialog.WARNING_STYLE] = AjxMsg.warningMsg;
DwtMessageDialog.ICON = new Object();
DwtMessageDialog.ICON[DwtMessageDialog.CRITICAL_STYLE] = "Critical_32";
DwtMessageDialog.ICON[DwtMessageDialog.INFO_STYLE] = "Information_32";
DwtMessageDialog.ICON[DwtMessageDialog.WARNING_STYLE] = "Warning_32";
DwtMessageDialog.prototype.toString =
function() {
return "DwtMessageDialog";
};
DwtMessageDialog.prototype.setMessage =
function(msgStr, style, title) {
style = style ? style : DwtMessageDialog.INFO_STYLE;
title = title ? title : DwtMessageDialog.TITLE[style];
this.setTitle(title);
if (msgStr) {
var html = new Array();
var i = 0;
html[i++] = "<table cellspacing=0 cellpadding=0 border=0><tr>";
html[i++] = "<td valign='top'>";
html[i++] = AjxImg.getImageHtml(DwtMessageDialog.ICON[style]);
html[i++] = "</td><td class='DwtMsgArea'>";
html[i++] = msgStr;
html[i++] = "</td></tr></table>";
this._msgCell.innerHTML = html.join("");
} else {
this._msgCell.innerHTML = "";
}
};
DwtMessageDialog.prototype.reset =
function() {
this._msgCell.innerHTML = "";
DwtDialog.prototype.reset.call(this);
};
DwtMessageDialog.prototype._contentHtml =
function() {
return "<div id='" + this._msgCellId + "' class='DwtMsgDialog'></div>";
};
DwtMessageDialog.prototype._enterListener =
function(ev) {
this._runEnterCallback();
};
Documentation generated by
JSDoc on Thu Apr 27 13:54:36 2006