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.HBox
17 * @extends Ext.layout.container.Box
18 * <p>A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal
19 * space between child items containing a numeric <code>flex</code> configuration.</p>
20 * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
21 * {@img Ext.layout.container.HBox/Ext.layout.container.HBox.png Ext.layout.container.HBox container layout}
23 Ext.create('Ext.Panel', {
26 title: "HBoxLayout Panel",
31 renderTo: document.body,
34 title: 'Inner Panel One',
38 title: 'Inner Panel Two',
42 title: 'Inner Panel Three',
47 Ext.define('Ext.layout.container.HBox', {
49 /* Begin Definitions */
51 alias: ['layout.hbox'],
52 extend: 'Ext.layout.container.Box',
53 alternateClassName: 'Ext.layout.HBoxLayout',
59 * Controls how the child items of the container are aligned. Acceptable configuration values for this
61 * <div class="mdetail-params"><ul>
62 * <li><b><tt>top</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned vertically
63 * at the <b>top</b> of the container</div></li>
64 * <li><b><tt>middle</tt></b> : <div class="sub-desc">child items are aligned vertically in the
65 * <b>middle</b> of the container</div></li>
66 * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched vertically to fill
67 * the height of the container</div></li>
68 * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched vertically to
69 * the height of the largest item.</div></li>
72 align: 'top', // top, middle, stretch, strechmax
75 alignCenteringString: 'middle',
79 direction: 'horizontal',
81 // When creating an argument list to setSize, use this order
83 perpendicularSizeIndex: 1,
85 parallelPrefix: 'width',
86 parallelPrefixCap: 'Width',
89 parallelBefore: 'left',
90 parallelBeforeCap: 'Left',
91 parallelAfter: 'right',
92 parallelPosition: 'x',
94 perpendicularPrefix: 'height',
95 perpendicularPrefixCap: 'Height',
98 perpendicularLeftTop: 'top',
99 perpendicularRightBottom: 'bottom',
100 perpendicularPosition: 'y',
101 configureItem: function(item) {
103 item.layoutManagedWidth = 1;
105 item.layoutManagedWidth = 2;
108 if (this.align === 'stretch' || this.align === 'stretchmax') {
109 item.layoutManagedHeight = 1;
111 item.layoutManagedHeight = 2;
113 this.callParent(arguments);