Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / pkgs / window-debug.js
index 0461d5e..b8a3085 100644 (file)
@@ -1,6 +1,6 @@
 /*!
 /*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
@@ -196,12 +196,6 @@ Ext.Window = Ext.extend(Ext.Panel, {
      */
     hidden : true,
 
      */
     hidden : true,
 
-    /**
-    * @cfg {Boolean} monitorResize @hide
-    * This is automatically managed based on the value of constrain and constrainToHeader
-    */
-    monitorResize : true,
-
     // The following configs are set to provide the basic functionality of a window.
     // Changing them would require additional code to handle correctly and should
     // usually only be done in subclasses that can provide custom behavior.  Changing them
     // The following configs are set to provide the basic functionality of a window.
     // Changing them would require additional code to handle correctly and should
     // usually only be done in subclasses that can provide custom behavior.  Changing them
@@ -311,7 +305,8 @@ Ext.Window = Ext.extend(Ext.Panel, {
                 minHeight:this.minHeight,
                 handles: this.resizeHandles || 'all',
                 pinned: true,
                 minHeight:this.minHeight,
                 handles: this.resizeHandles || 'all',
                 pinned: true,
-                resizeElement : this.resizerAction
+                resizeElement : this.resizerAction,
+                handleCls: 'x-window-handle'
             });
             this.resizer.window = this;
             this.mon(this.resizer, 'beforeresize', this.beforeResize, this);
             });
             this.resizer.window = this;
             this.mon(this.resizer, 'beforeresize', this.beforeResize, this);
@@ -345,7 +340,8 @@ Ext.Window = Ext.extend(Ext.Panel, {
     },
 
    // private
     },
 
    // private
-    onEsc : function(){
+    onEsc : function(k, e){
+        e.stopEvent();
         this[this.closeAction]();
     },
 
         this[this.closeAction]();
     },
 
@@ -437,6 +433,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
         this.focus();
         this.updateHandles();
         this.saveState();
         this.focus();
         this.updateHandles();
         this.saveState();
+        this.doLayout();
     },
 
     /**
     },
 
     /**
@@ -527,6 +524,9 @@ Ext.Window = Ext.extend(Ext.Panel, {
 
     // private
     afterShow : function(isAnim){
 
     // private
     afterShow : function(isAnim){
+        if (this.isDestroyed){
+            return false;
+        }
         this.proxy.hide();
         this.el.setStyle('display', 'block');
         this.el.show();
         this.proxy.hide();
         this.el.setStyle('display', 'block');
         this.el.show();
@@ -888,7 +888,6 @@ Ext.Window = Ext.extend(Ext.Panel, {
           Ext.EventManager.on(window, 'scroll', this.doAnchor, this,
               {buffer: tm == 'number' ? monitorScroll : 50});
       }
           Ext.EventManager.on(window, 'scroll', this.doAnchor, this,
               {buffer: tm == 'number' ? monitorScroll : 50});
       }
-      this.doAnchor();
       return this;
     },
 
       return this;
     },
 
@@ -1363,17 +1362,19 @@ Ext.MessageBox = function(){
             }\r
             msgEl.update(text || ' ');\r
 \r
             }\r
             msgEl.update(text || ' ');\r
 \r
-            var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0;\r
-            var mw = msgEl.getWidth() + msgEl.getMargins('lr');\r
-            var fw = dlg.getFrameWidth('lr');\r
-            var bw = dlg.body.getFrameWidth('lr');\r
+            var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0,\r
+                mw = msgEl.getWidth() + msgEl.getMargins('lr'),\r
+                fw = dlg.getFrameWidth('lr'),\r
+                bw = dlg.body.getFrameWidth('lr'),\r
+                w;\r
+                \r
             if (Ext.isIE && iw > 0){\r
                 //3 pixels get subtracted in the icon CSS for an IE margin issue,\r
                 //so we have to add it back here for the overall width to be consistent\r
                 iw += 3;\r
             }\r
             if (Ext.isIE && iw > 0){\r
                 //3 pixels get subtracted in the icon CSS for an IE margin issue,\r
                 //so we have to add it back here for the overall width to be consistent\r
                 iw += 3;\r
             }\r
-            var w = Math.max(Math.min(opt.width || iw+mw+fw+bw, this.maxWidth),\r
-                        Math.max(opt.minWidth || this.minWidth, bwidth || 0));\r
+            w = Math.max(Math.min(opt.width || iw+mw+fw+bw, opt.maxWidth || this.maxWidth),\r
+                    Math.max(opt.minWidth || this.minWidth, bwidth || 0));\r
 \r
             if(opt.prompt === true){\r
                 activeTextEl.setWidth(w-iw-fw-bw);\r
 \r
             if(opt.prompt === true){\r
                 activeTextEl.setWidth(w-iw-fw-bw);\r
@@ -1671,7 +1672,8 @@ Ext.MessageBox.ERROR
                 msg : msg,\r
                 buttons: this.OK,\r
                 fn: fn,\r
                 msg : msg,\r
                 buttons: this.OK,\r
                 fn: fn,\r
-                scope : scope\r
+                scope : scope,\r
+                minWidth: this.minWidth\r
             });\r
             return this;\r
         },\r
             });\r
             return this;\r
         },\r
@@ -1694,7 +1696,8 @@ Ext.MessageBox.ERROR
                 buttons: this.YESNO,\r
                 fn: fn,\r
                 scope : scope,\r
                 buttons: this.YESNO,\r
                 fn: fn,\r
                 scope : scope,\r
-                icon: this.QUESTION\r
+                icon: this.QUESTION,\r
+                minWidth: this.minWidth\r
             });\r
             return this;\r
         },\r
             });\r
             return this;\r
         },\r
@@ -1719,7 +1722,7 @@ Ext.MessageBox.ERROR
                 msg : msg,\r
                 buttons: this.OKCANCEL,\r
                 fn: fn,\r
                 msg : msg,\r
                 buttons: this.OKCANCEL,\r
                 fn: fn,\r
-                minWidth:250,\r
+                minWidth: this.minPromptWidth,\r
                 scope : scope,\r
                 prompt:true,\r
                 multiline: multiline,\r
                 scope : scope,\r
                 prompt:true,\r
                 multiline: multiline,\r
@@ -1791,10 +1794,16 @@ Ext.MessageBox.ERROR
         minWidth : 100,\r
         /**\r
          * The minimum width in pixels of the message box if it is a progress-style dialog.  This is useful\r
         minWidth : 100,\r
         /**\r
          * The minimum width in pixels of the message box if it is a progress-style dialog.  This is useful\r
-         * for setting a different minimum width than text-only dialogs may need (defaults to 250)\r
+         * for setting a different minimum width than text-only dialogs may need (defaults to 250).\r
          * @type Number\r
          */\r
         minProgressWidth : 250,\r
          * @type Number\r
          */\r
         minProgressWidth : 250,\r
+        /**\r
+         * The minimum width in pixels of the message box if it is a prompt dialog.  This is useful\r
+         * for setting a different minimum width than text-only dialogs may need (defaults to 250).\r
+         * @type Number\r
+         */\r
+        minPromptWidth: 250,\r
         /**\r
          * An object containing the default button text strings that can be overriden for localized language support.\r
          * Supported properties are: ok, cancel, yes and no.  Generally you should include a locale-specific\r
         /**\r
          * An object containing the default button text strings that can be overriden for localized language support.\r
          * Supported properties are: ok, cancel, yes and no.  Generally you should include a locale-specific\r