X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/Window.html diff --git a/docs/source/Window.html b/docs/source/Window.html index 21b4ac13..a22ece55 100644 --- a/docs/source/Window.html +++ b/docs/source/Window.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.Window * @extends Ext.Panel *

A specialized panel intended for use as an application window. Windows are floated, {@link #resizable}, and @@ -57,8 +52,13 @@ Ext.Window = Ext.extend(Ext.Panel, { * A reference to the WindowGroup that should manage this window (defaults to {@link Ext.WindowMgr}). */

/** - * @cfg {String/Number/Button} defaultButton - * The id / index of a button or a button instance to focus when this window received the focus. + * @cfg {String/Number/Component} defaultButton + *

Specifies a Component to receive focus when this Window is focussed.

+ *

This may be one of:

    + *
  • The index of a footer Button.
  • + *
  • The id of a Component.
  • + *
  • A Component.
  • + *
*/
/** * @cfg {Function} onEsc @@ -190,14 +190,14 @@ Ext.Window = Ext.extend(Ext.Panel, { * @deprecated */ 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 @@ -439,7 +439,6 @@ Ext.Window = Ext.extend(Ext.Panel, { this.focus(); this.updateHandles(); this.saveState(); - this.doLayout(); },
/** @@ -498,7 +497,7 @@ Ext.Window = Ext.extend(Ext.Panel, { * @param {String/Element} animateTarget (optional) The target element or id from which the window should * animate while opening (defaults to null with no animation) * @param {Function} callback (optional) A callback function to call after the window is displayed - * @param {Object} scope (optional) The scope in which to execute the callback + * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this Window. * @return {Ext.Window} this */ show : function(animateTarget, cb, scope){ @@ -536,7 +535,7 @@ Ext.Window = Ext.extend(Ext.Panel, { if(this.maximized){ this.fitContainer(); } - if(Ext.isMac && Ext.isGecko){ // work around stupid FF 2.0/Mac scroll bar bug + if(Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug this.cascade(this.setAutoScroll); } @@ -554,6 +553,7 @@ Ext.Window = Ext.extend(Ext.Panel, { var sz = this.getSize(); this.onResize(sz.width, sz.height); } + this.onShow(); this.fireEvent('show', this); }, @@ -578,7 +578,7 @@ Ext.Window = Ext.extend(Ext.Panel, { * @param {String/Element} animateTarget (optional) The target element or id to which the window should * animate while hiding (defaults to null with no animation) * @param {Function} callback (optional) A callback function to call after the window is hidden - * @param {Object} scope (optional) The scope in which to execute the callback + * @param {Object} scope (optional) The scope (this reference) in which the callback is executed. Defaults to this Window. * @return {Ext.Window} this */ hide : function(animateTarget, cb, scope){ @@ -614,6 +614,7 @@ Ext.Window = Ext.extend(Ext.Panel, { if(this.keyMap){ this.keyMap.disable(); } + this.onHide(); this.fireEvent('hide', this); }, @@ -633,6 +634,18 @@ Ext.Window = Ext.extend(Ext.Panel, { })); }, +
/** + * Method that is called immediately before the show event is fired. + * Defaults to Ext.emptyFn. + */ + onShow : Ext.emptyFn, + +
/** + * Method that is called immediately before the hide event is fired. + * Defaults to Ext.emptyFn. + */ + onHide : Ext.emptyFn, + // private onWindowResize : function(){ if(this.maximized){ @@ -690,7 +703,7 @@ Ext.Window = Ext.extend(Ext.Panel, { if(show !== false){ this.el.show(); this.focus(); - if(Ext.isMac && Ext.isGecko){ // work around stupid FF 2.0/Mac scroll bar bug + if(Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug this.cascade(this.setAutoScroll); } } @@ -730,7 +743,7 @@ Ext.Window = Ext.extend(Ext.Panel, { } } }, - + // private doClose : function(){ this.fireEvent('close', this); @@ -780,9 +793,14 @@ Ext.Window = Ext.extend(Ext.Panel, { */ restore : function(){ if(this.maximized){ + var t = this.tools; this.el.removeClass('x-window-maximized'); - this.tools.restore.hide(); - this.tools.maximize.show(); + if(t.restore){ + t.restore.hide(); + } + if(t.maximize){ + t.maximize.show(); + } this.setPosition(this.restorePos[0], this.restorePos[1]); this.setSize(this.restoreSize.width, this.restoreSize.height); delete this.restorePos; @@ -793,8 +811,8 @@ Ext.Window = Ext.extend(Ext.Panel, { if(this.dd){ this.dd.unlock(); } - if(this.collapsible){ - this.tools.toggle.show(); + if(this.collapsible && t.toggle){ + t.toggle.show(); } this.container.removeClass('x-window-maximized-ct'); @@ -815,7 +833,7 @@ Ext.Window = Ext.extend(Ext.Panel, { // private fitContainer : function(){ - var vs = this.container.getViewSize(); + var vs = this.container.getViewSize(false); this.setSize(vs.width, vs.height); }, @@ -838,7 +856,7 @@ Ext.Window = Ext.extend(Ext.Panel, {
/** * Aligns the window to the specified element * @param {Mixed} element The element to align to. - * @param {String} position The position to align to (see {@link Ext.Element#alignTo} for more details). + * @param {String} position (optional, defaults to "tl-bl?") The position to align to (see {@link Ext.Element#alignTo} for more details). * @param {Array} offsets (optional) Offset the positioning by [x, y] * @return {Ext.Window} this */ @@ -966,6 +984,6 @@ Ext.extend(Ext.Window.DD, Ext.dd.DD, { this.win.saveState(); } }); -
- +
+ \ No newline at end of file