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 * A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal
17 * space between child items containing a numeric `flex` configuration.
19 * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
22 * Ext.create('Ext.Panel', {
25 * title: "HBoxLayout Panel",
30 * renderTo: document.body,
33 * title: 'Inner Panel One',
37 * title: 'Inner Panel Two',
41 * title: 'Inner Panel Three',
46 Ext.define('Ext.layout.container.HBox', {
48 /* Begin Definitions */
50 alias: ['layout.hbox'],
51 extend: 'Ext.layout.container.Box',
52 alternateClassName: 'Ext.layout.HBoxLayout',
58 * Controls how the child items of the container are aligned. Acceptable configuration values for this property are:
60 * - **top** : **Default** child items are aligned vertically at the **top** of the container
61 * - **middle** : child items are aligned vertically in the **middle** of the container
62 * - **stretch** : child items are stretched vertically to fill the height of the container
63 * - **stretchmax** : child items are stretched vertically to the height of the largest item.
65 align: 'top', // top, middle, stretch, strechmax
68 alignCenteringString: 'middle',
72 direction: 'horizontal',
74 // When creating an argument list to setSize, use this order
76 perpendicularSizeIndex: 1,
78 parallelPrefix: 'width',
79 parallelPrefixCap: 'Width',
82 parallelBefore: 'left',
83 parallelBeforeCap: 'Left',
84 parallelAfter: 'right',
85 parallelPosition: 'x',
87 perpendicularPrefix: 'height',
88 perpendicularPrefixCap: 'Height',
91 perpendicularLeftTop: 'top',
92 perpendicularRightBottom: 'bottom',
93 perpendicularPosition: 'y',
94 configureItem: function(item) {
96 item.layoutManagedWidth = 1;
98 item.layoutManagedWidth = 2;
101 if (this.align === 'stretch' || this.align === 'stretchmax') {
102 item.layoutManagedHeight = 1;
104 item.layoutManagedHeight = 2;
106 this.callParent(arguments);