X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..05ce1c11e98b33f14ddee184493bd5a60dc947e2:/docs/source/Window.html diff --git a/docs/source/Window.html b/docs/source/Window.html index 91d0a856..21b4ac13 100644 --- a/docs/source/Window.html +++ b/docs/source/Window.html @@ -1,17 +1,23 @@ - -
-/** + + ++ \ No newline at end of fileThe source code + + + + +/*! + * Ext JS Library 3.0.3 + * Copyright(c) 2006-2009 Ext JS, LLC + * licensing@extjs.com + * http://www.extjs.com/license + */ +/** * @class Ext.Window * @extends Ext.Panel *- +A specialized panel intended for use as an application window. Windows are floated, {@link #resizable}, and * {@link #draggable} by default. Windows can be {@link #maximizable maximized} to fill the viewport, * restored to their prior size, and can be {@link #minimize}d.
- *Windows can also be linked to a {@link Ext.WindowGroup} or managed by the {@link Ext.WindowMgr} to provide + *
Windows can also be linked to a {@link Ext.WindowGroup} or managed by the {@link Ext.WindowMgr} to provide * grouping, activation, to front, to back and other application-specific behavior.
*By default, Windows will be rendered to document.body. To {@link #constrain} a Window to another element * specify {@link Ext.Component#renderTo renderTo}.
@@ -63,15 +69,15 @@ Ext.Window = Ext.extend(Ext.Panel, { */ /** * @cfg {Boolean} collapsed - * True to render the window collapsed, false to render it expanded (defaults to false). Note that if - * {@link #expandOnShow} is true (the default) it will override the collapsed config and the window + * True to render the window collapsed, false to render it expanded (defaults to false). Note that if + * {@link #expandOnShow} is true (the default) it will override the collapsed config and the window * will always be expanded when shown. */ /** * @cfg {Boolean} maximized * True to initially display the window in a maximized state. (Defaults to false). */ - + /** * @cfg {String} baseCls * The base CSS class to apply to this panel's element (defaults to 'x-window'). @@ -123,15 +129,15 @@ Ext.Window = Ext.extend(Ext.Panel, { /** * @cfg {Boolean} constrain * True to constrain the window within its containing element, false to allow it to fall outside of its - * containing element. By default the window will be rendered to document.body. To render and constrain the + * containing element. By default the window will be rendered to document.body. To render and constrain the * window within another element specify {@link #renderTo}. * (defaults to false). Optionally the header only can be constrained using {@link #constrainHeader}. */ constrain : false, /** * @cfg {Boolean} constrainHeader - * True to constrain the window header within its containing element (allowing the window body to fall outside - * of its containing element) or false to allow the header to fall outside its containing element (defaults to + * True to constrain the window header within its containing element (allowing the window body to fall outside + * of its containing element) or false to allow the header to fall outside its containing element (defaults to * false). Optionally the entire window can be constrained using {@link #constrain}. */ constrainHeader : false, @@ -181,8 +187,17 @@ Ext.Window = Ext.extend(Ext.Panel, { /** * @cfg {Boolean} initHidden * True to hide the window until show() is explicitly called (defaults to true). + * @deprecated */ - initHidden : true, + initHidden : undefined, + + /** + * @cfg {Boolean} hidden + * Render this component hidden (default is true). If true, the + * {@link #hide} method will be called internally. + */ + hidden : true, + /** * @cfg {Boolean} monitorResize @hide * This is automatically managed based on the value of constrain and constrainToHeader @@ -202,16 +217,17 @@ Ext.Window = Ext.extend(Ext.Panel, { // private initComponent : function(){ + this.initTools(); Ext.Window.superclass.initComponent.call(this); this.addEvents( /** * @event activate - * Fires after the window has been visually activated via {@link setActive}. + * Fires after the window has been visually activated via {@link #setActive}. * @param {Ext.Window} this */ /** * @event deactivate - * Fires after the window has been visually deactivated via {@link setActive}. + * Fires after the window has been visually deactivated via {@link #setActive}. * @param {Ext.Window} this */ /** @@ -241,10 +257,13 @@ Ext.Window = Ext.extend(Ext.Panel, { */ 'restore' ); - if(this.initHidden === false){ - this.show(); - }else{ + // for backwards compat, this should be removed at some point + if(Ext.isDefined(this.initHidden)){ + this.hidden = this.initHidden; + } + if(this.hidden === false){ this.hidden = true; + this.show(); } }, @@ -276,7 +295,9 @@ Ext.Window = Ext.extend(Ext.Panel, { this.mask.hide(); this.mon(this.mask, 'click', this.focus, this); } - this.initTools(); + if(this.maximizable){ + this.mon(this.header, 'dblclick', this.toggleMaximize, this); + } }, // private @@ -375,7 +396,6 @@ Ext.Window = Ext.extend(Ext.Panel, { handler: this.restore.createDelegate(this, []), hidden:true }); - this.mon(this.header, 'dblclick', this.toggleMaximize, this); } if(this.closable){ this.addTool({ @@ -420,7 +440,6 @@ Ext.Window = Ext.extend(Ext.Panel, { this.updateHandles(); this.saveState(); this.doLayout(); - this.fireEvent('resize', this, box.width, box.height); }, /** @@ -429,10 +448,10 @@ Ext.Window = Ext.extend(Ext.Panel, { */ focus : function(){ var f = this.focusEl, db = this.defaultButton, t = typeof db; - if(t != 'undefined'){ - if(t == 'number' && this.fbar){ + if(Ext.isDefined(db)){ + if(Ext.isNumber(db) && this.fbar){ f = this.fbar.items.get(db); - }else if(t == 'string'){ + }else if(Ext.isString(db)){ f = Ext.getCmp(db); }else{ f = db; @@ -497,7 +516,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.on('show', cb, scope, {single:true}); } this.hidden = false; - if(animateTarget !== undefined){ + if(Ext.isDefined(animateTarget)){ this.setAnimateTarget(animateTarget); } this.beforeShow(); @@ -543,15 +562,15 @@ Ext.Window = Ext.extend(Ext.Panel, { this.proxy.show(); this.proxy.setBox(this.animateTarget.getBox()); this.proxy.setOpacity(0); - var b = this.getBox(false); - b.callback = this.afterShow.createDelegate(this, [true], false); - b.scope = this; - b.duration = 0.25; - b.easing = 'easeNone'; - b.opacity = 0.5; - b.block = true; + var b = this.getBox(); this.el.setStyle('display', 'none'); - this.proxy.shift(b); + this.proxy.shift(Ext.apply(b, { + callback: this.afterShow.createDelegate(this, [true], false), + scope: this, + easing: 'easeNone', + duration: 0.25, + opacity: 0.5 + })); }, /** @@ -605,14 +624,13 @@ Ext.Window = Ext.extend(Ext.Panel, { var tb = this.getBox(false); this.proxy.setBox(tb); this.el.hide(); - var b = this.animateTarget.getBox(); - b.callback = this.afterHide; - b.scope = this; - b.duration = 0.25; - b.easing = 'easeNone'; - b.block = true; - b.opacity = 0; - this.proxy.shift(b); + this.proxy.shift(Ext.apply(this.animateTarget.getBox(), { + callback: this.afterHide, + scope: this, + duration: 0.25, + easing: 'easeNone', + opacity: 0 + })); }, // private @@ -705,12 +723,19 @@ Ext.Window = Ext.extend(Ext.Panel, { */ close : function(){ if(this.fireEvent('beforeclose', this) !== false){ - this.hide(null, function(){ - this.fireEvent('close', this); - this.destroy(); - }, this); + if(this.hidden){ + this.doClose(); + }else{ + this.hide(null, this.doClose, this); + } } }, + + // private + doClose : function(){ + this.fireEvent('close', this); + this.destroy(); + }, /** * Fits the window within its current container and automatically replaces @@ -841,7 +866,7 @@ Ext.Window = Ext.extend(Ext.Panel, { this.alignTo(el, alignment, offsets); }; Ext.EventManager.onWindowResize(this.doAnchor, this); - + var tm = typeof monitorScroll; if(tm != 'undefined'){ Ext.EventManager.on(window, 'scroll', this.doAnchor, this, @@ -867,7 +892,8 @@ Ext.Window = Ext.extend(Ext.Panel, { /** * Makes this the active window by showing its shadow, or deactivates it by hiding its shadow. This method also - * fires the {@link #activate} or {@link #deactivate} event depending on which action occurred. + * fires the {@link #activate} or {@link #deactivate} event depending on which action occurred. This method is + * called internally by {@link Ext.WindowMgr}. * @param {Boolean} active True to activate the window, false to deactivate it (defaults to false) */ setActive : function(active){ @@ -940,6 +966,6 @@ Ext.extend(Ext.Window.DD, Ext.dd.DD, { this.win.saveState(); } }); -