4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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> * A layout that arranges items horizontally across a Container. This layout optionally divides available horizontal
20 * space between child items containing a numeric `flex` configuration.
22 * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
25 * Ext.create('Ext.Panel', {
28 * title: "HBoxLayout Panel",
33 * renderTo: document.body,
36 * title: 'Inner Panel One',
40 * title: 'Inner Panel Two',
44 * title: 'Inner Panel Three',
49 Ext.define('Ext.layout.container.HBox', {
51 /* Begin Definitions */
53 alias: ['layout.hbox'],
54 extend: 'Ext.layout.container.Box',
55 alternateClassName: 'Ext.layout.HBoxLayout',
59 <span id='Ext-layout-container-HBox-cfg-align'> /**
60 </span> * @cfg {String} align
61 * Controls how the child items of the container are aligned. Acceptable configuration values for this property are:
63 * - **top** : **Default** child items are aligned vertically at the **top** of the container
64 * - **middle** : child items are aligned vertically in the **middle** of the container
65 * - **stretch** : child items are stretched vertically to fill the height of the container
66 * - **stretchmax** : child items are stretched vertically to the height of the largest item.
68 align: 'top', // top, middle, stretch, strechmax
71 alignCenteringString: 'middle',
75 direction: 'horizontal',
77 // When creating an argument list to setSize, use this order
79 perpendicularSizeIndex: 1,
81 parallelPrefix: 'width',
82 parallelPrefixCap: 'Width',
85 parallelBefore: 'left',
86 parallelBeforeCap: 'Left',
87 parallelAfter: 'right',
88 parallelPosition: 'x',
90 perpendicularPrefix: 'height',
91 perpendicularPrefixCap: 'Height',
94 perpendicularLeftTop: 'top',
95 perpendicularRightBottom: 'bottom',
96 perpendicularPosition: 'y',
97 configureItem: function(item) {
99 item.layoutManagedWidth = 1;
101 item.layoutManagedWidth = 2;
104 if (this.align === 'stretch' || this.align === 'stretchmax') {
105 item.layoutManagedHeight = 1;
107 item.layoutManagedHeight = 2;
109 this.callParent(arguments);