HBox.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  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; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  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.
  21. *
  22. * This layout may also be used to set the heights of child items by configuring it with the {@link #align} option.
  23. *
  24. * @example
  25. * Ext.create('Ext.Panel', {
  26. * width: 500,
  27. * height: 300,
  28. * title: &quot;HBoxLayout Panel&quot;,
  29. * layout: {
  30. * type: 'hbox',
  31. * align: 'stretch'
  32. * },
  33. * renderTo: document.body,
  34. * items: [{
  35. * xtype: 'panel',
  36. * title: 'Inner Panel One',
  37. * flex: 2
  38. * },{
  39. * xtype: 'panel',
  40. * title: 'Inner Panel Two',
  41. * flex: 1
  42. * },{
  43. * xtype: 'panel',
  44. * title: 'Inner Panel Three',
  45. * flex: 1
  46. * }]
  47. * });
  48. */
  49. Ext.define('Ext.layout.container.HBox', {
  50. /* Begin Definitions */
  51. alias: ['layout.hbox'],
  52. extend: 'Ext.layout.container.Box',
  53. alternateClassName: 'Ext.layout.HBoxLayout',
  54. /* End Definitions */
  55. <span id='Ext-layout-container-HBox-cfg-align'> /**
  56. </span> * @cfg {String} align
  57. * Controls how the child items of the container are aligned. Acceptable configuration values for this property are:
  58. *
  59. * - **top** : **Default** child items are aligned vertically at the **top** of the container
  60. * - **middle** : child items are aligned vertically in the **middle** of the container
  61. * - **stretch** : child items are stretched vertically to fill the height of the container
  62. * - **stretchmax** : child items are stretched vertically to the height of the largest item.
  63. */
  64. align: 'top', // top, middle, stretch, strechmax
  65. type : 'hbox',
  66. direction: 'horizontal',
  67. horizontal: true,
  68. names: {
  69. // parallel
  70. lr: 'lr',
  71. left: 'left',// 'before',
  72. leftCap: 'Left',
  73. right: 'right',// 'after',
  74. position: 'left',
  75. width: 'width',
  76. contentWidth: 'contentWidth',
  77. minWidth: 'minWidth',
  78. maxWidth: 'maxWidth',
  79. widthCap: 'Width',
  80. widthModel: 'widthModel',
  81. widthIndex: 0,
  82. x: 'x',
  83. scrollLeft: 'scrollLeft',
  84. overflowX: 'overflowX',
  85. hasOverflowX: 'hasOverflowX',
  86. invalidateScrollX: 'invalidateScrollX',
  87. // perpendicular
  88. center: 'middle',
  89. top: 'top',
  90. topPosition: 'top',
  91. bottom: 'bottom',
  92. height: 'height',
  93. contentHeight: 'contentHeight',
  94. minHeight: 'minHeight',
  95. maxHeight: 'maxHeight',
  96. heightCap: 'Height',
  97. heightModel: 'heightModel',
  98. heightIndex: 1,
  99. y: 'y',
  100. scrollTop: 'scrollTop',
  101. overflowY: 'overflowY',
  102. hasOverflowY: 'hasOverflowY',
  103. invalidateScrollY: 'invalidateScrollY',
  104. // Methods
  105. getWidth: 'getWidth',
  106. getHeight: 'getHeight',
  107. setWidth: 'setWidth',
  108. setHeight: 'setHeight',
  109. gotWidth: 'gotWidth',
  110. gotHeight: 'gotHeight',
  111. setContentWidth: 'setContentWidth',
  112. setContentHeight: 'setContentHeight',
  113. setWidthInDom: 'setWidthInDom',
  114. setHeightInDom: 'setHeightInDom'
  115. },
  116. sizePolicy: {
  117. flex: {
  118. '': {
  119. setsWidth: 1,
  120. setsHeight: 0
  121. },
  122. stretch: {
  123. setsWidth: 1,
  124. setsHeight: 1
  125. },
  126. stretchmax: {
  127. readsHeight: 1,
  128. setsWidth: 1,
  129. setsHeight: 1
  130. }
  131. },
  132. '': {
  133. setsWidth: 0,
  134. setsHeight: 0
  135. },
  136. stretch: {
  137. setsWidth: 0,
  138. setsHeight: 1
  139. },
  140. stretchmax: {
  141. readsHeight: 1,
  142. setsWidth: 0,
  143. setsHeight: 1
  144. }
  145. }
  146. });
  147. </pre>
  148. </body>
  149. </html>