tvheadend/vendor/ext-3.4.1/docs/source/BoxComponent.html
Adam Sutton bafcfff42d webui: restructure webui/extjs source files
I want to keep the 3rd-party packages away from the main source
where possible.
2013-06-03 17:11:01 +01:00

604 lines
28 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-BoxComponent-method-constructor'><span id='Ext-BoxComponent'>/**
</span></span> * @class Ext.BoxComponent
* @extends Ext.Component
* &lt;p&gt;Base class for any {@link Ext.Component Component} that is to be sized as a box, using width and height.&lt;/p&gt;
* &lt;p&gt;BoxComponent provides automatic box model adjustments for sizing and positioning and will work correctly
* within the Component rendering model.&lt;/p&gt;
* &lt;p&gt;A BoxComponent may be created as a custom Component which encapsulates any HTML element, either a pre-existing
* element, or one that is created to your specifications at render time. Usually, to participate in layouts,
* a Component will need to be a &lt;b&gt;Box&lt;/b&gt;Component in order to have its width and height managed.&lt;/p&gt;
* &lt;p&gt;To use a pre-existing element as a BoxComponent, configure it so that you preset the &lt;b&gt;el&lt;/b&gt; property to the
* element to reference:&lt;pre&gt;&lt;code&gt;
var pageHeader = new Ext.BoxComponent({
el: 'my-header-div'
});&lt;/code&gt;&lt;/pre&gt;
* This may then be {@link Ext.Container#add added} to a {@link Ext.Container Container} as a child item.&lt;/p&gt;
* &lt;p&gt;To create a BoxComponent based around a HTML element to be created at render time, use the
* {@link Ext.Component#autoEl autoEl} config option which takes the form of a
* {@link Ext.DomHelper DomHelper} specification:&lt;pre&gt;&lt;code&gt;
var myImage = new Ext.BoxComponent({
autoEl: {
tag: 'img',
src: '/images/my-image.jpg'
}
});&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
* @constructor
* @param {Ext.Element/String/Object} config The configuration options.
* @xtype box
*/
Ext.BoxComponent = Ext.extend(Ext.Component, {
// Configs below are used for all Components when rendered by BoxLayout.
<span id='Ext-BoxComponent-cfg-flex'> /**
</span> * @cfg {Number} flex
* &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this Component is rendered
* by a Container which has been configured to use a &lt;b&gt;{@link Ext.layout.BoxLayout BoxLayout}.&lt;/b&gt;
* Each child Component with a &lt;code&gt;flex&lt;/code&gt; property will be flexed either vertically (by a VBoxLayout)
* or horizontally (by an HBoxLayout) according to the item's &lt;b&gt;relative&lt;/b&gt; &lt;code&gt;flex&lt;/code&gt; value
* compared to the sum of all Components with &lt;code&gt;flex&lt;/code&gt; value specified. Any child items that have
* either a &lt;code&gt;flex = 0&lt;/code&gt; or &lt;code&gt;flex = undefined&lt;/code&gt; will not be 'flexed' (the initial size will not be changed).
*/
// Configs below are used for all Components when rendered by AnchorLayout.
<span id='Ext-BoxComponent-cfg-anchor'> /**
</span> * @cfg {String} anchor &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this Component is rendered
* by a Container which has been configured to use an &lt;b&gt;{@link Ext.layout.AnchorLayout AnchorLayout} (or subclass thereof).&lt;/b&gt;
* based layout manager, for example:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
* &lt;li&gt;{@link Ext.form.FormPanel}&lt;/li&gt;
* &lt;li&gt;specifying &lt;code&gt;layout: 'anchor' // or 'form', or 'absolute'&lt;/code&gt;&lt;/li&gt;
* &lt;/ul&gt;&lt;/div&gt;&lt;/p&gt;
* &lt;p&gt;See {@link Ext.layout.AnchorLayout}.{@link Ext.layout.AnchorLayout#anchor anchor} also.&lt;/p&gt;
*/
// tabTip config is used when a BoxComponent is a child of a TabPanel
<span id='Ext-BoxComponent-cfg-tabTip'> /**
</span> * @cfg {String} tabTip
* &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this BoxComponent is a child item of a TabPanel.&lt;/p&gt;
* A string to be used as innerHTML (html tags are accepted) to show in a tooltip when mousing over
* the associated tab selector element. {@link Ext.QuickTips}.init()
* must be called in order for the tips to render.
*/
// Configs below are used for all Components when rendered by BorderLayout.
<span id='Ext-BoxComponent-cfg-region'> /**
</span> * @cfg {String} region &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this BoxComponent is rendered
* by a Container which has been configured to use the &lt;b&gt;{@link Ext.layout.BorderLayout BorderLayout}&lt;/b&gt;
* layout manager (e.g. specifying &lt;tt&gt;layout:'border'&lt;/tt&gt;).&lt;/p&gt;&lt;br&gt;
* &lt;p&gt;See {@link Ext.layout.BorderLayout} also.&lt;/p&gt;
*/
// margins config is used when a BoxComponent is rendered by BorderLayout or BoxLayout.
<span id='Ext-BoxComponent-cfg-margins'> /**
</span> * @cfg {Object} margins &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this BoxComponent is rendered
* by a Container which has been configured to use the &lt;b&gt;{@link Ext.layout.BorderLayout BorderLayout}&lt;/b&gt;
* or one of the two &lt;b&gt;{@link Ext.layout.BoxLayout BoxLayout} subclasses.&lt;/b&gt;&lt;/p&gt;
* &lt;p&gt;An object containing margins to apply to this BoxComponent in the
* format:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
{
top: (top margin),
right: (right margin),
bottom: (bottom margin),
left: (left margin)
}&lt;/code&gt;&lt;/pre&gt;
* &lt;p&gt;May also be a string containing space-separated, numeric margin values. The order of the
* sides associated with each value matches the way CSS processes margin values:&lt;/p&gt;
* &lt;p&gt;&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
* &lt;li&gt;If there is only one value, it applies to all sides.&lt;/li&gt;
* &lt;li&gt;If there are two values, the top and bottom borders are set to the first value and the
* right and left are set to the second.&lt;/li&gt;
* &lt;li&gt;If there are three values, the top is set to the first value, the left and right are set
* to the second, and the bottom is set to the third.&lt;/li&gt;
* &lt;li&gt;If there are four values, they apply to the top, right, bottom, and left, respectively.&lt;/li&gt;
* &lt;/ul&gt;&lt;/div&gt;&lt;/p&gt;
* &lt;p&gt;Defaults to:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
* {top:0, right:0, bottom:0, left:0}
* &lt;/code&gt;&lt;/pre&gt;
*/
<span id='Ext-BoxComponent-cfg-x'> /**
</span> * @cfg {Number} x
* The local x (left) coordinate for this component if contained within a positioning container.
*/
<span id='Ext-BoxComponent-cfg-y'> /**
</span> * @cfg {Number} y
* The local y (top) coordinate for this component if contained within a positioning container.
*/
<span id='Ext-BoxComponent-cfg-pageX'> /**
</span> * @cfg {Number} pageX
* The page level x coordinate for this component if contained within a positioning container.
*/
<span id='Ext-BoxComponent-cfg-pageY'> /**
</span> * @cfg {Number} pageY
* The page level y coordinate for this component if contained within a positioning container.
*/
<span id='Ext-BoxComponent-cfg-height'> /**
</span> * @cfg {Number} height
* The height of this component in pixels (defaults to auto).
* &lt;b&gt;Note&lt;/b&gt; to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
*/
<span id='Ext-BoxComponent-cfg-width'> /**
</span> * @cfg {Number} width
* The width of this component in pixels (defaults to auto).
* &lt;b&gt;Note&lt;/b&gt; to express this dimension as a percentage or offset see {@link Ext.Component#anchor}.
*/
<span id='Ext-BoxComponent-cfg-boxMinHeight'> /**
</span> * @cfg {Number} boxMinHeight
* &lt;p&gt;The minimum value in pixels which this BoxComponent will set its height to.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; This will override any size management applied by layout managers.&lt;/p&gt;
*/
<span id='Ext-BoxComponent-cfg-boxMinWidth'> /**
</span> * @cfg {Number} boxMinWidth
* &lt;p&gt;The minimum value in pixels which this BoxComponent will set its width to.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; This will override any size management applied by layout managers.&lt;/p&gt;
*/
<span id='Ext-BoxComponent-cfg-boxMaxHeight'> /**
</span> * @cfg {Number} boxMaxHeight
* &lt;p&gt;The maximum value in pixels which this BoxComponent will set its height to.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; This will override any size management applied by layout managers.&lt;/p&gt;
*/
<span id='Ext-BoxComponent-cfg-boxMaxWidth'> /**
</span> * @cfg {Number} boxMaxWidth
* &lt;p&gt;The maximum value in pixels which this BoxComponent will set its width to.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; This will override any size management applied by layout managers.&lt;/p&gt;
*/
<span id='Ext-BoxComponent-cfg-autoHeight'> /**
</span> * @cfg {Boolean} autoHeight
* &lt;p&gt;True to use height:'auto', false to use fixed height (or allow it to be managed by its parent
* Container's {@link Ext.Container#layout layout manager}. Defaults to false.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: Although many components inherit this config option, not all will
* function as expected with a height of 'auto'. Setting autoHeight:true means that the
* browser will manage height based on the element's contents, and that Ext will not manage it at all.&lt;/p&gt;
* &lt;p&gt;If the &lt;i&gt;browser&lt;/i&gt; is managing the height, be aware that resizes performed by the browser in response
* to changes within the structure of the Component cannot be detected. Therefore changes to the height might
* result in elements needing to be synchronized with the new height. Example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
var w = new Ext.Window({
title: 'Window',
width: 600,
autoHeight: true,
items: {
title: 'Collapse Me',
height: 400,
collapsible: true,
border: false,
listeners: {
beforecollapse: function() {
w.el.shadow.hide();
},
beforeexpand: function() {
w.el.shadow.hide();
},
collapse: function() {
w.syncShadow();
},
expand: function() {
w.syncShadow();
}
}
}
}).show();
&lt;/code&gt;&lt;/pre&gt;
*/
<span id='Ext-BoxComponent-cfg-autoWidth'> /**
</span> * @cfg {Boolean} autoWidth
* &lt;p&gt;True to use width:'auto', false to use fixed width (or allow it to be managed by its parent
* Container's {@link Ext.Container#layout layout manager}. Defaults to false.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: Although many components inherit this config option, not all will
* function as expected with a width of 'auto'. Setting autoWidth:true means that the
* browser will manage width based on the element's contents, and that Ext will not manage it at all.&lt;/p&gt;
* &lt;p&gt;If the &lt;i&gt;browser&lt;/i&gt; is managing the width, be aware that resizes performed by the browser in response
* to changes within the structure of the Component cannot be detected. Therefore changes to the width might
* result in elements needing to be synchronized with the new width. For example, where the target element is:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;div id='grid-container' style='margin-left:25%;width:50%'&gt;&amp;lt;/div&gt;
&lt;/code&gt;&lt;/pre&gt;
* A Panel rendered into that target element must listen for browser window resize in order to relay its
* child items when the browser changes its width:&lt;pre&gt;&lt;code&gt;
var myPanel = new Ext.Panel({
renderTo: 'grid-container',
monitorResize: true, // relay on browser resize
title: 'Panel',
height: 400,
autoWidth: true,
layout: 'hbox',
layoutConfig: {
align: 'stretch'
},
defaults: {
flex: 1
},
items: [{
title: 'Box 1',
}, {
title: 'Box 2'
}, {
title: 'Box 3'
}],
});
&lt;/code&gt;&lt;/pre&gt;
*/
<span id='Ext-BoxComponent-cfg-autoScroll'> /**
</span> * @cfg {Boolean} autoScroll
* &lt;code&gt;true&lt;/code&gt; to use overflow:'auto' on the components layout element and show scroll bars automatically when
* necessary, &lt;code&gt;false&lt;/code&gt; to clip any overflowing content (defaults to &lt;code&gt;false&lt;/code&gt;).
*/
/* // private internal config
* {Boolean} deferHeight
* True to defer height calculations to an external component, false to allow this component to set its own
* height (defaults to false).
*/
<span id='Ext-BoxComponent-method-initComponent'> // private
</span> initComponent : function(){
Ext.BoxComponent.superclass.initComponent.call(this);
this.addEvents(
<span id='Ext-BoxComponent-event-resize'> /**
</span> * @event resize
* Fires after the component is resized.
* @param {Ext.Component} this
* @param {Number} adjWidth The box-adjusted width that was set
* @param {Number} adjHeight The box-adjusted height that was set
* @param {Number} rawWidth The width that was originally specified
* @param {Number} rawHeight The height that was originally specified
*/
'resize',
<span id='Ext-BoxComponent-event-move'> /**
</span> * @event move
* Fires after the component is moved.
* @param {Ext.Component} this
* @param {Number} x The new x position
* @param {Number} y The new y position
*/
'move'
);
},
<span id='Ext-BoxComponent-property-boxReady'> // private, set in afterRender to signify that the component has been rendered
</span> boxReady : false,
<span id='Ext-BoxComponent-property-deferHeight'> // private, used to defer height settings to subclasses
</span> deferHeight: false,
<span id='Ext-BoxComponent-method-setSize'> /**
</span> * Sets the width and height of this BoxComponent. This method fires the {@link #resize} event. This method can accept
* either width and height as separate arguments, or you can pass a size object like &lt;code&gt;{width:10, height:20}&lt;/code&gt;.
* @param {Mixed} width The new width to set. This may be one of:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
* &lt;li&gt;A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).&lt;/li&gt;
* &lt;li&gt;A String used to set the CSS width style.&lt;/li&gt;
* &lt;li&gt;A size object in the format &lt;code&gt;{width: widthValue, height: heightValue}&lt;/code&gt;.&lt;/li&gt;
* &lt;li&gt;&lt;code&gt;undefined&lt;/code&gt; to leave the width unchanged.&lt;/li&gt;
* &lt;/ul&gt;&lt;/div&gt;
* @param {Mixed} height The new height to set (not required if a size object is passed as the first arg).
* This may be one of:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
* &lt;li&gt;A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).&lt;/li&gt;
* &lt;li&gt;A String used to set the CSS height style. Animation may &lt;b&gt;not&lt;/b&gt; be used.&lt;/li&gt;
* &lt;li&gt;&lt;code&gt;undefined&lt;/code&gt; to leave the height unchanged.&lt;/li&gt;
* &lt;/ul&gt;&lt;/div&gt;
* @return {Ext.BoxComponent} this
*/
setSize : function(w, h){
// support for standard size objects
if(typeof w == 'object'){
h = w.height;
w = w.width;
}
if (Ext.isDefined(w) &amp;&amp; Ext.isDefined(this.boxMinWidth) &amp;&amp; (w &lt; this.boxMinWidth)) {
w = this.boxMinWidth;
}
if (Ext.isDefined(h) &amp;&amp; Ext.isDefined(this.boxMinHeight) &amp;&amp; (h &lt; this.boxMinHeight)) {
h = this.boxMinHeight;
}
if (Ext.isDefined(w) &amp;&amp; Ext.isDefined(this.boxMaxWidth) &amp;&amp; (w &gt; this.boxMaxWidth)) {
w = this.boxMaxWidth;
}
if (Ext.isDefined(h) &amp;&amp; Ext.isDefined(this.boxMaxHeight) &amp;&amp; (h &gt; this.boxMaxHeight)) {
h = this.boxMaxHeight;
}
// not rendered
if(!this.boxReady){
this.width = w;
this.height = h;
return this;
}
// prevent recalcs when not needed
if(this.cacheSizes !== false &amp;&amp; this.lastSize &amp;&amp; this.lastSize.width == w &amp;&amp; this.lastSize.height == h){
return this;
}
this.lastSize = {width: w, height: h};
var adj = this.adjustSize(w, h),
aw = adj.width,
ah = adj.height,
rz;
if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters
rz = this.getResizeEl();
if(!this.deferHeight &amp;&amp; aw !== undefined &amp;&amp; ah !== undefined){
rz.setSize(aw, ah);
}else if(!this.deferHeight &amp;&amp; ah !== undefined){
rz.setHeight(ah);
}else if(aw !== undefined){
rz.setWidth(aw);
}
this.onResize(aw, ah, w, h);
this.fireEvent('resize', this, aw, ah, w, h);
}
return this;
},
<span id='Ext-BoxComponent-method-setWidth'> /**
</span> * Sets the width of the component. This method fires the {@link #resize} event.
* @param {Mixed} width The new width to set. This may be one of:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
* &lt;li&gt;A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit defaultUnit}s (by default, pixels).&lt;/li&gt;
* &lt;li&gt;A String used to set the CSS width style.&lt;/li&gt;
* &lt;/ul&gt;&lt;/div&gt;
* @return {Ext.BoxComponent} this
*/
setWidth : function(width){
return this.setSize(width);
},
<span id='Ext-BoxComponent-method-setHeight'> /**
</span> * Sets the height of the component. This method fires the {@link #resize} event.
* @param {Mixed} height The new height to set. This may be one of:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
* &lt;li&gt;A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit defaultUnit}s (by default, pixels).&lt;/li&gt;
* &lt;li&gt;A String used to set the CSS height style.&lt;/li&gt;
* &lt;li&gt;&lt;i&gt;undefined&lt;/i&gt; to leave the height unchanged.&lt;/li&gt;
* &lt;/ul&gt;&lt;/div&gt;
* @return {Ext.BoxComponent} this
*/
setHeight : function(height){
return this.setSize(undefined, height);
},
<span id='Ext-BoxComponent-method-getSize'> /**
</span> * Gets the current size of the component's underlying element.
* @return {Object} An object containing the element's size {width: (element width), height: (element height)}
*/
getSize : function(){
return this.getResizeEl().getSize();
},
<span id='Ext-BoxComponent-method-getWidth'> /**
</span> * Gets the current width of the component's underlying element.
* @return {Number}
*/
getWidth : function(){
return this.getResizeEl().getWidth();
},
<span id='Ext-BoxComponent-method-getHeight'> /**
</span> * Gets the current height of the component's underlying element.
* @return {Number}
*/
getHeight : function(){
return this.getResizeEl().getHeight();
},
<span id='Ext-BoxComponent-method-getOuterSize'> /**
</span> * Gets the current size of the component's underlying element, including space taken by its margins.
* @return {Object} An object containing the element's size {width: (element width + left/right margins), height: (element height + top/bottom margins)}
*/
getOuterSize : function(){
var el = this.getResizeEl();
return {width: el.getWidth() + el.getMargins('lr'),
height: el.getHeight() + el.getMargins('tb')};
},
<span id='Ext-BoxComponent-method-getPosition'> /**
</span> * Gets the current XY position of the component's underlying element.
* @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
* @return {Array} The XY position of the element (e.g., [100, 200])
*/
getPosition : function(local){
var el = this.getPositionEl();
if(local === true){
return [el.getLeft(true), el.getTop(true)];
}
return this.xy || el.getXY();
},
<span id='Ext-BoxComponent-method-getBox'> /**
</span> * Gets the current box measurements of the component's underlying element.
* @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
* @return {Object} box An object in the format {x, y, width, height}
*/
getBox : function(local){
var pos = this.getPosition(local);
var s = this.getSize();
s.x = pos[0];
s.y = pos[1];
return s;
},
<span id='Ext-BoxComponent-method-updateBox'> /**
</span> * Sets the current box measurements of the component's underlying element.
* @param {Object} box An object in the format {x, y, width, height}
* @return {Ext.BoxComponent} this
*/
updateBox : function(box){
this.setSize(box.width, box.height);
this.setPagePosition(box.x, box.y);
return this;
},
<span id='Ext-BoxComponent-method-getResizeEl'> /**
</span> * &lt;p&gt;Returns the outermost Element of this Component which defines the Components overall size.&lt;/p&gt;
* &lt;p&gt;&lt;i&gt;Usually&lt;/i&gt; this will return the same Element as &lt;code&gt;{@link #getEl}&lt;/code&gt;,
* but in some cases, a Component may have some more wrapping Elements around its main
* active Element.&lt;/p&gt;
* &lt;p&gt;An example is a ComboBox. It is encased in a &lt;i&gt;wrapping&lt;/i&gt; Element which
* contains both the &lt;code&gt;&amp;lt;input&gt;&lt;/code&gt; Element (which is what would be returned
* by its &lt;code&gt;{@link #getEl}&lt;/code&gt; method, &lt;i&gt;and&lt;/i&gt; the trigger button Element.
* This Element is returned as the &lt;code&gt;resizeEl&lt;/code&gt;.
* @return {Ext.Element} The Element which is to be resized by size managing layouts.
*/
getResizeEl : function(){
return this.resizeEl || this.el;
},
<span id='Ext-BoxComponent-method-setAutoScroll'> /**
</span> * Sets the overflow on the content element of the component.
* @param {Boolean} scroll True to allow the Component to auto scroll.
* @return {Ext.BoxComponent} this
*/
setAutoScroll : function(scroll){
if(this.rendered){
this.getContentTarget().setOverflow(scroll ? 'auto' : '');
}
this.autoScroll = scroll;
return this;
},
<span id='Ext-BoxComponent-method-setPosition'> /**
</span> * Sets the left and top of the component. To set the page XY position instead, use {@link #setPagePosition}.
* This method fires the {@link #move} event.
* @param {Number} left The new left
* @param {Number} top The new top
* @return {Ext.BoxComponent} this
*/
setPosition : function(x, y){
if(x &amp;&amp; typeof x[1] == 'number'){
y = x[1];
x = x[0];
}
this.x = x;
this.y = y;
if(!this.boxReady){
return this;
}
var adj = this.adjustPosition(x, y);
var ax = adj.x, ay = adj.y;
var el = this.getPositionEl();
if(ax !== undefined || ay !== undefined){
if(ax !== undefined &amp;&amp; ay !== undefined){
el.setLeftTop(ax, ay);
}else if(ax !== undefined){
el.setLeft(ax);
}else if(ay !== undefined){
el.setTop(ay);
}
this.onPosition(ax, ay);
this.fireEvent('move', this, ax, ay);
}
return this;
},
<span id='Ext-BoxComponent-method-setPagePosition'> /**
</span> * Sets the page XY position of the component. To set the left and top instead, use {@link #setPosition}.
* This method fires the {@link #move} event.
* @param {Number} x The new x position
* @param {Number} y The new y position
* @return {Ext.BoxComponent} this
*/
setPagePosition : function(x, y){
if(x &amp;&amp; typeof x[1] == 'number'){
y = x[1];
x = x[0];
}
this.pageX = x;
this.pageY = y;
if(!this.boxReady){
return;
}
if(x === undefined || y === undefined){ // cannot translate undefined points
return;
}
var p = this.getPositionEl().translatePoints(x, y);
this.setPosition(p.left, p.top);
return this;
},
<span id='Ext-BoxComponent-method-afterRender'> // private
</span> afterRender : function(){
Ext.BoxComponent.superclass.afterRender.call(this);
if(this.resizeEl){
this.resizeEl = Ext.get(this.resizeEl);
}
if(this.positionEl){
this.positionEl = Ext.get(this.positionEl);
}
this.boxReady = true;
Ext.isDefined(this.autoScroll) &amp;&amp; this.setAutoScroll(this.autoScroll);
this.setSize(this.width, this.height);
if(this.x || this.y){
this.setPosition(this.x, this.y);
}else if(this.pageX || this.pageY){
this.setPagePosition(this.pageX, this.pageY);
}
},
<span id='Ext-BoxComponent-method-syncSize'> /**
</span> * Force the component's size to recalculate based on the underlying element's current height and width.
* @return {Ext.BoxComponent} this
*/
syncSize : function(){
delete this.lastSize;
this.setSize(this.autoWidth ? undefined : this.getResizeEl().getWidth(), this.autoHeight ? undefined : this.getResizeEl().getHeight());
return this;
},
<span id='Ext-BoxComponent-method-onResize'> /* // protected
</span> * Called after the component is resized, this method is empty by default but can be implemented by any
* subclass that needs to perform custom logic after a resize occurs.
* @param {Number} adjWidth The box-adjusted width that was set
* @param {Number} adjHeight The box-adjusted height that was set
* @param {Number} rawWidth The width that was originally specified
* @param {Number} rawHeight The height that was originally specified
*/
onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
},
<span id='Ext-BoxComponent-method-onPosition'> /* // protected
</span> * Called after the component is moved, this method is empty by default but can be implemented by any
* subclass that needs to perform custom logic after a move occurs.
* @param {Number} x The new x position
* @param {Number} y The new y position
*/
onPosition : function(x, y){
},
<span id='Ext-BoxComponent-method-adjustSize'> // private
</span> adjustSize : function(w, h){
if(this.autoWidth){
w = 'auto';
}
if(this.autoHeight){
h = 'auto';
}
return {width : w, height: h};
},
<span id='Ext-BoxComponent-method-adjustPosition'> // private
</span> adjustPosition : function(x, y){
return {x : x, y: y};
}
});
Ext.reg('box', Ext.BoxComponent);
<span id='Ext-Spacer-method-constructor'><span id='Ext-Spacer'>/**
</span></span> * @class Ext.Spacer
* @extends Ext.BoxComponent
* &lt;p&gt;Used to provide a sizable space in a layout.&lt;/p&gt;
* @constructor
* @param {Object} config
*/
Ext.Spacer = Ext.extend(Ext.BoxComponent, {
<span id='Ext-Spacer-cfg-autoEl'> autoEl:'div'
</span>});
Ext.reg('spacer', Ext.Spacer);</pre>
</body>
</html>