3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * @class Ext.layout.container.Container
17 * @extends Ext.layout.container.AbstractContainer
18 * <p>This class is intended to be extended or created via the {@link Ext.container.Container#layout layout}
19 * configuration property. See {@link Ext.container.Container#layout} for additional details.</p>
21 Ext.define('Ext.layout.container.Container', {
23 /* Begin Definitions */
25 extend: 'Ext.layout.container.AbstractContainer',
26 alternateClassName: 'Ext.layout.ContainerLayout',
30 layoutItem: function(item, box) {
32 item.doComponentLayout(box.width, box.height);
34 item.doComponentLayout();
38 getLayoutTargetSize : function() {
39 var target = this.getTarget(),
43 ret = target.getViewSize();
45 // IE in will sometimes return a width of 0 on the 1st pass of getViewSize.
46 // Use getStyleSize to verify the 0 width, the adjustment pass will then work properly
48 if (Ext.isIE && ret.width == 0){
49 ret = target.getStyleSize();
52 ret.width -= target.getPadding('lr');
53 ret.height -= target.getPadding('tb');
58 beforeLayout: function() {
59 if (this.owner.beforeLayout(arguments) !== false) {
60 return this.callParent(arguments);
69 * Returns all items that are rendered
70 * @return {Array} All matching items
72 getRenderedItems: function() {
74 target = me.getTarget(),
75 items = me.getLayoutItems(),
80 for (i = 0; i < ln; i++) {
82 if (item.rendered && me.isValidParent(item, target, i)) {
83 renderedItems.push(item);
92 * Returns all items that are both rendered and visible
93 * @return {Array} All matching items
95 getVisibleItems: function() {
96 var target = this.getTarget(),
97 items = this.getLayoutItems(),
102 for (i = 0; i < ln; i++) {
104 if (item.rendered && this.isValidParent(item, target, i) && item.hidden !== true) {
105 visibleItems.push(item);