Upgrade to ExtJS 3.3.0 - Released 10/06/2010
[extjs.git] / docs / source / MessageBox.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
4   <title>The source code</title>
5     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 </head>
8 <body  onload="prettyPrint();">
9     <pre class="prettyprint lang-js">/*!
10  * Ext JS Library 3.3.0
11  * Copyright(c) 2006-2010 Ext JS, Inc.
12  * licensing@extjs.com
13  * http://www.extjs.com/license
14  */
15 <div id="cls-Ext.MessageBox"></div>/**
16  * @class Ext.MessageBox
17  * <p>Utility class for generating different styles of message boxes.  The alias Ext.Msg can also be used.<p/>
18  * <p>Note that the MessageBox is asynchronous.  Unlike a regular JavaScript <code>alert</code> (which will halt
19  * browser execution), showing a MessageBox will not cause the code to stop.  For this reason, if you have code
20  * that should only run <em>after</em> some user feedback from the MessageBox, you must use a callback function
21  * (see the <code>function</code> parameter for {@link #show} for more details).</p>
22  * <p>Example usage:</p>
23  *<pre><code>
24 // Basic alert:
25 Ext.Msg.alert('Status', 'Changes saved successfully.');
26
27 // Prompt for user data and process the result using a callback:
28 Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
29     if (btn == 'ok'){
30         // process text value and close...
31     }
32 });
33
34 // Show a dialog using config options:
35 Ext.Msg.show({
36    title:'Save Changes?',
37    msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
38    buttons: Ext.Msg.YESNOCANCEL,
39    fn: processResult,
40    animEl: 'elId',
41    icon: Ext.MessageBox.QUESTION
42 });
43 </code></pre>
44  * @singleton
45  */
46 Ext.MessageBox = function(){
47     var dlg, opt, mask, waitTimer,
48         bodyEl, msgEl, textboxEl, textareaEl, progressBar, pp, iconEl, spacerEl,
49         buttons, activeTextEl, bwidth, bufferIcon = '', iconCls = '',
50         buttonNames = ['ok', 'yes', 'no', 'cancel'];
51
52     // private
53     var handleButton = function(button){
54         buttons[button].blur();
55         if(dlg.isVisible()){
56             dlg.hide();
57             handleHide();
58             Ext.callback(opt.fn, opt.scope||window, [button, activeTextEl.dom.value, opt], 1);
59         }
60     };
61
62     // private
63     var handleHide = function(){
64         if(opt && opt.cls){
65             dlg.el.removeClass(opt.cls);
66         }
67         progressBar.reset();        
68     };
69
70     // private
71     var handleEsc = function(d, k, e){
72         if(opt && opt.closable !== false){
73             dlg.hide();
74             handleHide();
75         }
76         if(e){
77             e.stopEvent();
78         }
79     };
80
81     // private
82     var updateButtons = function(b){
83         var width = 0,
84             cfg;
85         if(!b){
86             Ext.each(buttonNames, function(name){
87                 buttons[name].hide();
88             });
89             return width;
90         }
91         dlg.footer.dom.style.display = '';
92         Ext.iterate(buttons, function(name, btn){
93             cfg = b[name];
94             if(cfg){
95                 btn.show();
96                 btn.setText(Ext.isString(cfg) ? cfg : Ext.MessageBox.buttonText[name]);
97                 width += btn.getEl().getWidth() + 15;
98             }else{
99                 btn.hide();
100             }
101         });
102         return width;
103     };
104
105     return {
106         <div id="method-Ext.MessageBox-getDialog"></div>/**
107          * Returns a reference to the underlying {@link Ext.Window} element
108          * @return {Ext.Window} The window
109          */
110         getDialog : function(titleText){
111            if(!dlg){
112                 var btns = [];
113                 
114                 buttons = {};
115                 Ext.each(buttonNames, function(name){
116                     btns.push(buttons[name] = new Ext.Button({
117                         text: this.buttonText[name],
118                         handler: handleButton.createCallback(name),
119                         hideMode: 'offsets'
120                     }));
121                 }, this);
122                 dlg = new Ext.Window({
123                     autoCreate : true,
124                     title:titleText,
125                     resizable:false,
126                     constrain:true,
127                     constrainHeader:true,
128                     minimizable : false,
129                     maximizable : false,
130                     stateful: false,
131                     modal: true,
132                     shim:true,
133                     buttonAlign:"center",
134                     width:400,
135                     height:100,
136                     minHeight: 80,
137                     plain:true,
138                     footer:true,
139                     closable:true,
140                     close : function(){
141                         if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){
142                             handleButton("no");
143                         }else{
144                             handleButton("cancel");
145                         }
146                     },
147                     fbar: new Ext.Toolbar({
148                         items: btns,
149                         enableOverflow: false
150                     })
151                 });
152                 dlg.render(document.body);
153                 dlg.getEl().addClass('x-window-dlg');
154                 mask = dlg.mask;
155                 bodyEl = dlg.body.createChild({
156                     html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'
157                 });
158                 iconEl = Ext.get(bodyEl.dom.firstChild);
159                 var contentEl = bodyEl.dom.childNodes[1];
160                 msgEl = Ext.get(contentEl.firstChild);
161                 textboxEl = Ext.get(contentEl.childNodes[2].firstChild);
162                 textboxEl.enableDisplayMode();
163                 textboxEl.addKeyListener([10,13], function(){
164                     if(dlg.isVisible() && opt && opt.buttons){
165                         if(opt.buttons.ok){
166                             handleButton("ok");
167                         }else if(opt.buttons.yes){
168                             handleButton("yes");
169                         }
170                     }
171                 });
172                 textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]);
173                 textareaEl.enableDisplayMode();
174                 progressBar = new Ext.ProgressBar({
175                     renderTo:bodyEl
176                 });
177                bodyEl.createChild({cls:'x-clear'});
178             }
179             return dlg;
180         },
181
182         <div id="method-Ext.MessageBox-updateText"></div>/**
183          * Updates the message box body text
184          * @param {String} text (optional) Replaces the message box element's innerHTML with the specified string (defaults to
185          * the XHTML-compliant non-breaking space character '&amp;#160;')
186          * @return {Ext.MessageBox} this
187          */
188         updateText : function(text){
189             if(!dlg.isVisible() && !opt.width){
190                 dlg.setSize(this.maxWidth, 100); // resize first so content is never clipped from previous shows
191             }
192             // Append a space here for sizing. In IE, for some reason, it wraps text incorrectly without one in some cases
193             msgEl.update(text ? text + ' ' : '&#160;');
194
195             var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0,
196                 mw = msgEl.getWidth() + msgEl.getMargins('lr'),
197                 fw = dlg.getFrameWidth('lr'),
198                 bw = dlg.body.getFrameWidth('lr'),
199                 w;
200                 
201             w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth),
202                     Math.max(opt.minWidth || this.minWidth, bwidth || 0));
203
204             if(opt.prompt === true){
205                 activeTextEl.setWidth(w-iw-fw-bw);
206             }
207             if(opt.progress === true || opt.wait === true){
208                 progressBar.setSize(w-iw-fw-bw);
209             }
210             if(Ext.isIE && w == bwidth){
211                 w += 4; //Add offset when the content width is smaller than the buttons.    
212             }
213             msgEl.update(text || '&#160;');
214             dlg.setSize(w, 'auto').center();
215             return this;
216         },
217
218         <div id="method-Ext.MessageBox-updateProgress"></div>/**
219          * Updates a progress-style message box's text and progress bar. Only relevant on message boxes
220          * initiated via {@link Ext.MessageBox#progress} or {@link Ext.MessageBox#wait},
221          * or by calling {@link Ext.MessageBox#show} with progress: true.
222          * @param {Number} value Any number between 0 and 1 (e.g., .5, defaults to 0)
223          * @param {String} progressText The progress text to display inside the progress bar (defaults to '')
224          * @param {String} msg The message box's body text is replaced with the specified string (defaults to undefined
225          * so that any existing body text will not get overwritten by default unless a new value is passed in)
226          * @return {Ext.MessageBox} this
227          */
228         updateProgress : function(value, progressText, msg){
229             progressBar.updateProgress(value, progressText);
230             if(msg){
231                 this.updateText(msg);
232             }
233             return this;
234         },
235
236         <div id="method-Ext.MessageBox-isVisible"></div>/**
237          * Returns true if the message box is currently displayed
238          * @return {Boolean} True if the message box is visible, else false
239          */
240         isVisible : function(){
241             return dlg && dlg.isVisible();
242         },
243
244         <div id="method-Ext.MessageBox-hide"></div>/**
245          * Hides the message box if it is displayed
246          * @return {Ext.MessageBox} this
247          */
248         hide : function(){
249             var proxy = dlg ? dlg.activeGhost : null;
250             if(this.isVisible() || proxy){
251                 dlg.hide();
252                 handleHide();
253                 if (proxy){
254                     // unghost is a private function, but i saw no better solution
255                     // to fix the locking problem when dragging while it closes
256                     dlg.unghost(false, false);
257                 } 
258             }
259             return this;
260         },
261
262         <div id="method-Ext.MessageBox-show"></div>/**
263          * Displays a new message box, or reinitializes an existing message box, based on the config options
264          * passed in. All display functions (e.g. prompt, alert, etc.) on MessageBox call this function internally,
265          * although those calls are basic shortcuts and do not support all of the config options allowed here.
266          * @param {Object} config The following config options are supported: <ul>
267          * <li><b>animEl</b> : String/Element<div class="sub-desc">An id or Element from which the message box should animate as it
268          * opens and closes (defaults to undefined)</div></li>
269          * <li><b>buttons</b> : Object/Boolean<div class="sub-desc">A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo',
270          * cancel:'Bar'}), or false to not show any buttons (defaults to false)</div></li>
271          * <li><b>closable</b> : Boolean<div class="sub-desc">False to hide the top-right close button (defaults to true). Note that
272          * progress and wait dialogs will ignore this property and always hide the close button as they can only
273          * be closed programmatically.</div></li>
274          * <li><b>cls</b> : String<div class="sub-desc">A custom CSS class to apply to the message box's container element</div></li>
275          * <li><b>defaultTextHeight</b> : Number<div class="sub-desc">The default height in pixels of the message box's multiline textarea
276          * if displayed (defaults to 75)</div></li>
277          * <li><b>fn</b> : Function<div class="sub-desc">A callback function which is called when the dialog is dismissed either
278          * by clicking on the configured buttons, or on the dialog close button, or by pressing
279          * the return button to enter input.
280          * <p>Progress and wait dialogs will ignore this option since they do not respond to user
281          * actions and can only be closed programmatically, so any required function should be called
282          * by the same code after it closes the dialog. Parameters passed:<ul>
283          * <li><b>buttonId</b> : String<div class="sub-desc">The ID of the button pressed, one of:<div class="sub-desc"><ul>
284          * <li><tt>ok</tt></li>
285          * <li><tt>yes</tt></li>
286          * <li><tt>no</tt></li>
287          * <li><tt>cancel</tt></li>
288          * </ul></div></div></li>
289          * <li><b>text</b> : String<div class="sub-desc">Value of the input field if either <tt><a href="#show-option-prompt" ext:member="show-option-prompt" ext:cls="Ext.MessageBox">prompt</a></tt>
290          * or <tt><a href="#show-option-multiline" ext:member="show-option-multiline" ext:cls="Ext.MessageBox">multiline</a></tt> is true</div></li>
291          * <li><b>opt</b> : Object<div class="sub-desc">The config object passed to show.</div></li>
292          * </ul></p></div></li>
293          * <li><b>scope</b> : Object<div class="sub-desc">The scope of the callback function</div></li>
294          * <li><b>icon</b> : String<div class="sub-desc">A CSS class that provides a background image to be used as the body icon for the
295          * dialog (e.g. Ext.MessageBox.WARNING or 'custom-class') (defaults to '')</div></li>
296          * <li><b>iconCls</b> : String<div class="sub-desc">The standard {@link Ext.Window#iconCls} to
297          * add an optional header icon (defaults to '')</div></li>
298          * <li><b>maxWidth</b> : Number<div class="sub-desc">The maximum width in pixels of the message box (defaults to 600)</div></li>
299          * <li><b>minWidth</b> : Number<div class="sub-desc">The minimum width in pixels of the message box (defaults to 100)</div></li>
300          * <li><b>modal</b> : Boolean<div class="sub-desc">False to allow user interaction with the page while the message box is
301          * displayed (defaults to true)</div></li>
302          * <li><b>msg</b> : String<div class="sub-desc">A string that will replace the existing message box body text (defaults to the
303          * XHTML-compliant non-breaking space character '&amp;#160;')</div></li>
304          * <li><a id="show-option-multiline"></a><b>multiline</b> : Boolean<div class="sub-desc">
305          * True to prompt the user to enter multi-line text (defaults to false)</div></li>
306          * <li><b>progress</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>
307          * <li><b>progressText</b> : String<div class="sub-desc">The text to display inside the progress bar if progress = true (defaults to '')</div></li>
308          * <li><a id="show-option-prompt"></a><b>prompt</b> : Boolean<div class="sub-desc">True to prompt the user to enter single-line text (defaults to false)</div></li>
309          * <li><b>proxyDrag</b> : Boolean<div class="sub-desc">True to display a lightweight proxy while dragging (defaults to false)</div></li>
310          * <li><b>title</b> : String<div class="sub-desc">The title text</div></li>
311          * <li><b>value</b> : String<div class="sub-desc">The string value to set into the active textbox element if displayed</div></li>
312          * <li><b>wait</b> : Boolean<div class="sub-desc">True to display a progress bar (defaults to false)</div></li>
313          * <li><b>waitConfig</b> : Object<div class="sub-desc">A {@link Ext.ProgressBar#waitConfig} object (applies only if wait = true)</div></li>
314          * <li><b>width</b> : Number<div class="sub-desc">The width of the dialog in pixels</div></li>
315          * </ul>
316          * Example usage:
317          * <pre><code>
318 Ext.Msg.show({
319    title: 'Address',
320    msg: 'Please enter your address:',
321    width: 300,
322    buttons: Ext.MessageBox.OKCANCEL,
323    multiline: true,
324    fn: saveAddress,
325    animEl: 'addAddressBtn',
326    icon: Ext.MessageBox.INFO
327 });
328 </code></pre>
329          * @return {Ext.MessageBox} this
330          */
331         show : function(options){
332             if(this.isVisible()){
333                 this.hide();
334             }
335             opt = options;
336             var d = this.getDialog(opt.title || "&#160;");
337
338             d.setTitle(opt.title || "&#160;");
339             var allowClose = (opt.closable !== false && opt.progress !== true && opt.wait !== true);
340             d.tools.close.setDisplayed(allowClose);
341             activeTextEl = textboxEl;
342             opt.prompt = opt.prompt || (opt.multiline ? true : false);
343             if(opt.prompt){
344                 if(opt.multiline){
345                     textboxEl.hide();
346                     textareaEl.show();
347                     textareaEl.setHeight(Ext.isNumber(opt.multiline) ? opt.multiline : this.defaultTextHeight);
348                     activeTextEl = textareaEl;
349                 }else{
350                     textboxEl.show();
351                     textareaEl.hide();
352                 }
353             }else{
354                 textboxEl.hide();
355                 textareaEl.hide();
356             }
357             activeTextEl.dom.value = opt.value || "";
358             if(opt.prompt){
359                 d.focusEl = activeTextEl;
360             }else{
361                 var bs = opt.buttons;
362                 var db = null;
363                 if(bs && bs.ok){
364                     db = buttons["ok"];
365                 }else if(bs && bs.yes){
366                     db = buttons["yes"];
367                 }
368                 if (db){
369                     d.focusEl = db;
370                 }
371             }
372             if(Ext.isDefined(opt.iconCls)){
373               d.setIconClass(opt.iconCls);
374             }
375             this.setIcon(Ext.isDefined(opt.icon) ? opt.icon : bufferIcon);
376             bwidth = updateButtons(opt.buttons);
377             progressBar.setVisible(opt.progress === true || opt.wait === true);
378             this.updateProgress(0, opt.progressText);
379             this.updateText(opt.msg);
380             if(opt.cls){
381                 d.el.addClass(opt.cls);
382             }
383             d.proxyDrag = opt.proxyDrag === true;
384             d.modal = opt.modal !== false;
385             d.mask = opt.modal !== false ? mask : false;
386             if(!d.isVisible()){
387                 // force it to the end of the z-index stack so it gets a cursor in FF
388                 document.body.appendChild(dlg.el.dom);
389                 d.setAnimateTarget(opt.animEl);
390                 //workaround for window internally enabling keymap in afterShow
391                 d.on('show', function(){
392                     if(allowClose === true){
393                         d.keyMap.enable();
394                     }else{
395                         d.keyMap.disable();
396                     }
397                 }, this, {single:true});
398                 d.show(opt.animEl);
399             }
400             if(opt.wait === true){
401                 progressBar.wait(opt.waitConfig);
402             }
403             return this;
404         },
405
406         <div id="method-Ext.MessageBox-setIcon"></div>/**
407          * Adds the specified icon to the dialog.  By default, the class 'ext-mb-icon' is applied for default
408          * styling, and the class passed in is expected to supply the background image url. Pass in empty string ('')
409          * to clear any existing icon. This method must be called before the MessageBox is shown.
410          * The following built-in icon classes are supported, but you can also pass in a custom class name:
411          * <pre>
412 Ext.MessageBox.INFO
413 Ext.MessageBox.WARNING
414 Ext.MessageBox.QUESTION
415 Ext.MessageBox.ERROR
416          *</pre>
417          * @param {String} icon A CSS classname specifying the icon's background image url, or empty string to clear the icon
418          * @return {Ext.MessageBox} this
419          */
420         setIcon : function(icon){
421             if(!dlg){
422                 bufferIcon = icon;
423                 return;
424             }
425             bufferIcon = undefined;
426             if(icon && icon != ''){
427                 iconEl.removeClass('x-hidden');
428                 iconEl.replaceClass(iconCls, icon);
429                 bodyEl.addClass('x-dlg-icon');
430                 iconCls = icon;
431             }else{
432                 iconEl.replaceClass(iconCls, 'x-hidden');
433                 bodyEl.removeClass('x-dlg-icon');
434                 iconCls = '';
435             }
436             return this;
437         },
438
439         <div id="method-Ext.MessageBox-progress"></div>/**
440          * Displays a message box with a progress bar.  This message box has no buttons and is not closeable by
441          * the user.  You are responsible for updating the progress bar as needed via {@link Ext.MessageBox#updateProgress}
442          * and closing the message box when the process is complete.
443          * @param {String} title The title bar text
444          * @param {String} msg The message box body text
445          * @param {String} progressText (optional) The text to display inside the progress bar (defaults to '')
446          * @return {Ext.MessageBox} this
447          */
448         progress : function(title, msg, progressText){
449             this.show({
450                 title : title,
451                 msg : msg,
452                 buttons: false,
453                 progress:true,
454                 closable:false,
455                 minWidth: this.minProgressWidth,
456                 progressText: progressText
457             });
458             return this;
459         },
460
461         <div id="method-Ext.MessageBox-wait"></div>/**
462          * Displays a message box with an infinitely auto-updating progress bar.  This can be used to block user
463          * interaction while waiting for a long-running process to complete that does not have defined intervals.
464          * You are responsible for closing the message box when the process is complete.
465          * @param {String} msg The message box body text
466          * @param {String} title (optional) The title bar text
467          * @param {Object} config (optional) A {@link Ext.ProgressBar#waitConfig} object
468          * @return {Ext.MessageBox} this
469          */
470         wait : function(msg, title, config){
471             this.show({
472                 title : title,
473                 msg : msg,
474                 buttons: false,
475                 closable:false,
476                 wait:true,
477                 modal:true,
478                 minWidth: this.minProgressWidth,
479                 waitConfig: config
480             });
481             return this;
482         },
483
484         <div id="method-Ext.MessageBox-alert"></div>/**
485          * Displays a standard read-only message box with an OK button (comparable to the basic JavaScript alert prompt).
486          * If a callback function is passed it will be called after the user clicks the button, and the
487          * id of the button that was clicked will be passed as the only parameter to the callback
488          * (could also be the top-right close button).
489          * @param {String} title The title bar text
490          * @param {String} msg The message box body text
491          * @param {Function} fn (optional) The callback function invoked after the message box is closed
492          * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser wnidow.
493          * @return {Ext.MessageBox} this
494          */
495         alert : function(title, msg, fn, scope){
496             this.show({
497                 title : title,
498                 msg : msg,
499                 buttons: this.OK,
500                 fn: fn,
501                 scope : scope,
502                 minWidth: this.minWidth
503             });
504             return this;
505         },
506
507         <div id="method-Ext.MessageBox-confirm"></div>/**
508          * Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's confirm).
509          * If a callback function is passed it will be called after the user clicks either button,
510          * and the id of the button that was clicked will be passed as the only parameter to the callback
511          * (could also be the top-right close button).
512          * @param {String} title The title bar text
513          * @param {String} msg The message box body text
514          * @param {Function} fn (optional) The callback function invoked after the message box is closed
515          * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser wnidow.
516          * @return {Ext.MessageBox} this
517          */
518         confirm : function(title, msg, fn, scope){
519             this.show({
520                 title : title,
521                 msg : msg,
522                 buttons: this.YESNO,
523                 fn: fn,
524                 scope : scope,
525                 icon: this.QUESTION,
526                 minWidth: this.minWidth
527             });
528             return this;
529         },
530
531         <div id="method-Ext.MessageBox-prompt"></div>/**
532          * Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to JavaScript's prompt).
533          * The prompt can be a single-line or multi-line textbox.  If a callback function is passed it will be called after the user
534          * clicks either button, and the id of the button that was clicked (could also be the top-right
535          * close button) and the text that was entered will be passed as the two parameters to the callback.
536          * @param {String} title The title bar text
537          * @param {String} msg The message box body text
538          * @param {Function} fn (optional) The callback function invoked after the message box is closed
539          * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser wnidow.
540          * @param {Boolean/Number} multiline (optional) True to create a multiline textbox using the defaultTextHeight
541          * property, or the height in pixels to create the textbox (defaults to false / single-line)
542          * @param {String} value (optional) Default value of the text input element (defaults to '')
543          * @return {Ext.MessageBox} this
544          */
545         prompt : function(title, msg, fn, scope, multiline, value){
546             this.show({
547                 title : title,
548                 msg : msg,
549                 buttons: this.OKCANCEL,
550                 fn: fn,
551                 minWidth: this.minPromptWidth,
552                 scope : scope,
553                 prompt:true,
554                 multiline: multiline,
555                 value: value
556             });
557             return this;
558         },
559
560         <div id="prop-Ext.MessageBox-OK"></div>/**
561          * Button config that displays a single OK button
562          * @type Object
563          */
564         OK : {ok:true},
565         <div id="prop-Ext.MessageBox-CANCEL"></div>/**
566          * Button config that displays a single Cancel button
567          * @type Object
568          */
569         CANCEL : {cancel:true},
570         <div id="prop-Ext.MessageBox-OKCANCEL"></div>/**
571          * Button config that displays OK and Cancel buttons
572          * @type Object
573          */
574         OKCANCEL : {ok:true, cancel:true},
575         <div id="prop-Ext.MessageBox-YESNO"></div>/**
576          * Button config that displays Yes and No buttons
577          * @type Object
578          */
579         YESNO : {yes:true, no:true},
580         <div id="prop-Ext.MessageBox-YESNOCANCEL"></div>/**
581          * Button config that displays Yes, No and Cancel buttons
582          * @type Object
583          */
584         YESNOCANCEL : {yes:true, no:true, cancel:true},
585         <div id="prop-Ext.MessageBox-INFO"></div>/**
586          * The CSS class that provides the INFO icon image
587          * @type String
588          */
589         INFO : 'ext-mb-info',
590         <div id="prop-Ext.MessageBox-WARNING"></div>/**
591          * The CSS class that provides the WARNING icon image
592          * @type String
593          */
594         WARNING : 'ext-mb-warning',
595         <div id="prop-Ext.MessageBox-QUESTION"></div>/**
596          * The CSS class that provides the QUESTION icon image
597          * @type String
598          */
599         QUESTION : 'ext-mb-question',
600         <div id="prop-Ext.MessageBox-ERROR"></div>/**
601          * The CSS class that provides the ERROR icon image
602          * @type String
603          */
604         ERROR : 'ext-mb-error',
605
606         <div id="prop-Ext.MessageBox-defaultTextHeight"></div>/**
607          * The default height in pixels of the message box's multiline textarea if displayed (defaults to 75)
608          * @type Number
609          */
610         defaultTextHeight : 75,
611         <div id="prop-Ext.MessageBox-maxWidth"></div>/**
612          * The maximum width in pixels of the message box (defaults to 600)
613          * @type Number
614          */
615         maxWidth : 600,
616         <div id="prop-Ext.MessageBox-minWidth"></div>/**
617          * The minimum width in pixels of the message box (defaults to 100)
618          * @type Number
619          */
620         minWidth : 100,
621         <div id="prop-Ext.MessageBox-minProgressWidth"></div>/**
622          * The minimum width in pixels of the message box if it is a progress-style dialog.  This is useful
623          * for setting a different minimum width than text-only dialogs may need (defaults to 250).
624          * @type Number
625          */
626         minProgressWidth : 250,
627         <div id="prop-Ext.MessageBox-minPromptWidth"></div>/**
628          * The minimum width in pixels of the message box if it is a prompt dialog.  This is useful
629          * for setting a different minimum width than text-only dialogs may need (defaults to 250).
630          * @type Number
631          */
632         minPromptWidth: 250,
633         <div id="prop-Ext.MessageBox-buttonText"></div>/**
634          * An object containing the default button text strings that can be overriden for localized language support.
635          * Supported properties are: ok, cancel, yes and no.  Generally you should include a locale-specific
636          * resource file for handling language support across the framework.
637          * Customize the default text like so: Ext.MessageBox.buttonText.yes = "oui"; //french
638          * @type Object
639          */
640         buttonText : {
641             ok : "OK",
642             cancel : "Cancel",
643             yes : "Yes",
644             no : "No"
645         }
646     };
647 }();
648
649 <div id="prop-Ext.MessageBox-Msg"></div>/**
650  * Shorthand for {@link Ext.MessageBox}
651  */
652 Ext.Msg = Ext.MessageBox;</pre>    
653 </body>
654 </html>