4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-layout-container-HBox'>/**
19 </span> * @class Ext.layout.container.HBox
20 * @extends Ext.layout.container.Box
21 * <p>A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal
22 * space between child items containing a numeric <code>flex</code> configuration.</p>
23 * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
24 * {@img Ext.layout.container.HBox/Ext.layout.container.HBox.png Ext.layout.container.HBox container layout}
26 Ext.create('Ext.Panel', {
29 title: "HBoxLayout Panel",
34 renderTo: document.body,
37 title: 'Inner Panel One',
41 title: 'Inner Panel Two',
45 title: 'Inner Panel Three',
50 Ext.define('Ext.layout.container.HBox', {
52 /* Begin Definitions */
54 alias: ['layout.hbox'],
55 extend: 'Ext.layout.container.Box',
56 alternateClassName: 'Ext.layout.HBoxLayout',
60 <span id='Ext-layout-container-HBox-cfg-align'> /**
61 </span> * @cfg {String} align
62 * Controls how the child items of the container are aligned. Acceptable configuration values for this
64 * <div class="mdetail-params"><ul>
65 * <li><b><tt>top</tt></b> : <b>Default</b><div class="sub-desc">child items are aligned vertically
66 * at the <b>top</b> of the container</div></li>
67 * <li><b><tt>middle</tt></b> : <div class="sub-desc">child items are aligned vertically in the
68 * <b>middle</b> of the container</div></li>
69 * <li><b><tt>stretch</tt></b> : <div class="sub-desc">child items are stretched vertically to fill
70 * the height of the container</div></li>
71 * <li><b><tt>stretchmax</tt></b> : <div class="sub-desc">child items are stretched vertically to
72 * the height of the largest item.</div></li>
73 * </ul></div>
75 align: 'top', // top, middle, stretch, strechmax
78 alignCenteringString: 'middle',
82 direction: 'horizontal',
84 // When creating an argument list to setSize, use this order
86 perpendicularSizeIndex: 1,
88 parallelPrefix: 'width',
89 parallelPrefixCap: 'Width',
92 parallelBefore: 'left',
93 parallelBeforeCap: 'Left',
94 parallelAfter: 'right',
95 parallelPosition: 'x',
97 perpendicularPrefix: 'height',
98 perpendicularPrefixCap: 'Height',
100 perpendicularRB: 'b',
101 perpendicularLeftTop: 'top',
102 perpendicularRightBottom: 'bottom',
103 perpendicularPosition: 'y',
104 configureItem: function(item) {
106 item.layoutManagedWidth = 1;
108 item.layoutManagedWidth = 2;
111 if (this.align === 'stretch' || this.align === 'stretchmax') {
112 item.layoutManagedHeight = 1;
114 item.layoutManagedHeight = 2;
116 this.callParent(arguments);