Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

371 lines
16 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <title>HBox Layout</title>
  4. <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css"/>
  5. <!-- GC -->
  6. <!-- LIBS -->
  7. <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
  8. <!-- ENDLIBS -->
  9. <script type="text/javascript" src="../../ext-all.js"></script>
  10. <style type="text/css">
  11. html, body {
  12. font: normal 12px verdana;
  13. margin: 0;
  14. padding: 0;
  15. border: 0 none;
  16. }
  17. </style>
  18. <script type="text/javascript">
  19. Ext.onReady(function() {
  20. var currentName;
  21. var replace = function(config, name) {
  22. var btns = Ext.getCmp('btns');
  23. if (name && name != currentName) {
  24. currentName = name;
  25. btns.remove(0);
  26. btns.add(Ext.apply(config, {
  27. layout:'hbox'
  28. }));
  29. };
  30. btns.doLayout();
  31. }
  32. var viewport = new Ext.Viewport({
  33. layout:'border',
  34. items: [{
  35. id:'btns',
  36. region:'north',
  37. baseCls:'x-plain',
  38. split:true,
  39. height:50,
  40. minHeight: 40,
  41. maxHeight: 85,
  42. layout:'fit',
  43. margins: '5 5 0 5',
  44. items: {
  45. baseCls: 'x-plain',
  46. html: '<p style="padding:10px;color:#556677;">Select a configuration below:</p>'
  47. }
  48. }, {
  49. region:'center',
  50. margins: '0 5 5 5',
  51. layout:'anchor',
  52. items:[{
  53. anchor:'100%',
  54. baseCls:'x-plain',
  55. layout:'hbox',
  56. layoutConfig: {
  57. padding: 10
  58. },
  59. defaults:{
  60. margins:'0 5 0 0',
  61. pressed: false,
  62. toggleGroup:'btns',
  63. allowDepress: false
  64. },
  65. items: [{
  66. xtype:'button',
  67. text: 'Spaced',
  68. handler: function(){
  69. replace({
  70. layoutConfig: {
  71. padding:'5',
  72. align:'top'
  73. },
  74. defaults:{margins:'0 5 0 0'},
  75. items:[{
  76. xtype:'button',
  77. text: 'Button 1'
  78. },{
  79. xtype:'spacer',
  80. flex:1
  81. },{
  82. xtype:'button',
  83. text: 'Button 2'
  84. },{
  85. xtype:'button',
  86. text: 'Button 3'
  87. },{
  88. xtype:'button',
  89. text: 'Button 4',
  90. margins:'0'
  91. }]
  92. }, 'spaced');
  93. }
  94. },{
  95. xtype:'button',
  96. text: 'Align: top',
  97. handler: function(){
  98. replace({
  99. layoutConfig: {
  100. padding:'5',
  101. align:'top'
  102. },
  103. defaults:{margins:'0 5 0 0'},
  104. items:[{
  105. xtype:'button',
  106. text: 'Button 1'
  107. },{
  108. xtype:'button',
  109. text: 'Button 2'
  110. },{
  111. xtype:'button',
  112. text: 'Button 3'
  113. },{
  114. xtype:'button',
  115. text: 'Button 4'
  116. }]
  117. }, 'align top');
  118. }
  119. },{
  120. xtype:'button',
  121. text: 'Align: middle',
  122. handler: function(){
  123. replace({
  124. layoutConfig: {
  125. padding:'5',
  126. align:'middle'
  127. },
  128. defaults:{margins:'0 5 0 0'},
  129. items:[{
  130. xtype:'button',
  131. text: 'Button 1'
  132. },{
  133. xtype:'button',
  134. text: 'Button 2'
  135. },{
  136. xtype:'button',
  137. text: 'Button 3'
  138. },{
  139. xtype:'button',
  140. text: 'Button 4'
  141. }]
  142. }, 'align middle');
  143. }
  144. },{
  145. xtype:'button',
  146. text: 'Align: stretch',
  147. handler: function(){
  148. replace({
  149. layoutConfig: {
  150. padding:'5',
  151. align:'stretch'
  152. },
  153. defaults:{margins:'0 5 0 0'},
  154. items:[{
  155. xtype:'button',
  156. text: 'Button 1'
  157. },{
  158. xtype:'button',
  159. text: 'Button 2'
  160. },{
  161. xtype:'button',
  162. text: 'Button 3'
  163. },{
  164. xtype:'button',
  165. text: 'Button 4'
  166. }]
  167. }, 'align stretch');
  168. }
  169. },{
  170. xtype:'button',
  171. text: 'Align: stretchmax',
  172. handler: function(){
  173. replace({
  174. layoutConfig: {
  175. padding:'5',
  176. align:'stretchmax'
  177. },
  178. defaults:{margins:'0 5 0 0'},
  179. items:[{
  180. xtype:'button',
  181. text: 'Button 1'
  182. },{
  183. xtype:'button',
  184. text: 'Button 2'
  185. },{
  186. xtype:'button',
  187. text: 'Button 3'
  188. },{
  189. xtype:'button',
  190. text: 'Button 4'
  191. }]
  192. }, 'align stretchmax');
  193. }
  194. }]
  195. },{
  196. anchor:'100%',
  197. baseCls:'x-plain',
  198. layout:'hbox',
  199. layoutConfig: {
  200. padding: '0 10 10'
  201. },
  202. defaults:{
  203. margins:'0 5 0 0',
  204. pressed: false,
  205. toggleGroup:'btns',
  206. allowDepress: false
  207. },
  208. items: [{
  209. xtype:'button',
  210. text: 'Flex: All even / Align: middle',
  211. handler: function(){
  212. replace({
  213. layoutConfig: {
  214. padding:'5',
  215. align:'middle'
  216. },
  217. defaults:{margins:'0 5 0 0'},
  218. items:[{
  219. xtype:'button',
  220. text: 'Button 1',
  221. flex:1
  222. },{
  223. xtype:'button',
  224. text: 'Button 2',
  225. flex:1
  226. },{
  227. xtype:'button',
  228. text: 'Button 3',
  229. flex:1
  230. },{
  231. xtype:'button',
  232. text: 'Button 4',
  233. flex:1,
  234. margins:'0'
  235. }]
  236. }, 'flex all even');
  237. }
  238. },{
  239. xtype:'button',
  240. text: 'Flex: Ratio / Align: top',
  241. handler: function(){
  242. replace({
  243. layoutConfig: {
  244. padding:'5',
  245. align:'top'
  246. },
  247. defaults:{margins:'0 5 0 0'},
  248. items:[{
  249. xtype:'button',
  250. text: 'Button 1',
  251. flex:1
  252. },{
  253. xtype:'button',
  254. text: 'Button 2',
  255. flex:1
  256. },{
  257. xtype:'button',
  258. text: 'Button 3',
  259. flex:1
  260. },{
  261. xtype:'button',
  262. text: 'Button 4',
  263. flex:3,
  264. margins:'0'
  265. }]
  266. }, 'flex ratio');
  267. }
  268. },{
  269. xtype:'button',
  270. text: 'Pack: start / Align: middle',
  271. handler: function(){
  272. replace({
  273. layoutConfig: {
  274. padding:'5',
  275. pack:'start',
  276. align:'middle'
  277. },
  278. defaults:{margins:'0 5 0 0'},
  279. items:[{
  280. xtype:'button',
  281. text: 'Button 1'
  282. },{
  283. xtype:'button',
  284. text: 'Button 2'
  285. },{
  286. xtype:'button',
  287. text: 'Button 3'
  288. },{
  289. xtype:'button',
  290. text: 'Button 4'
  291. }]
  292. }, 'pack start');
  293. }
  294. },{
  295. xtype:'button',
  296. text: 'Pack: center / Align: middle',
  297. handler: function(){
  298. replace({
  299. layoutConfig: {
  300. padding:'5',
  301. pack:'center',
  302. align:'middle'
  303. },
  304. defaults:{margins:'0 5 0 0'},
  305. items:[{
  306. xtype:'button',
  307. text: 'Button 1'
  308. },{
  309. xtype:'button',
  310. text: 'Button 2'
  311. },{
  312. xtype:'button',
  313. text: 'Button 3'
  314. },{
  315. xtype:'button',
  316. text: 'Button 4',
  317. margins:'0'
  318. }]
  319. }, 'pack center');
  320. }
  321. },{
  322. xtype:'button',
  323. text: 'Pack: end / Align: middle',
  324. handler: function(){
  325. replace({
  326. layoutConfig: {
  327. padding:'5',
  328. pack:'end',
  329. align:'middle'
  330. },
  331. defaults:{margins:'0 5 0 0'},
  332. items:[{
  333. xtype:'button',
  334. text: 'Button 1'
  335. },{
  336. xtype:'button',
  337. text: 'Button 2'
  338. },{
  339. xtype:'button',
  340. text: 'Button 3'
  341. },{
  342. xtype:'button',
  343. text: 'Button 4',
  344. margins:'0'
  345. }]
  346. }, 'pack end');
  347. }
  348. }]
  349. }]
  350. }]
  351. });
  352. });
  353. </script>
  354. </head>
  355. <body>
  356. </body>
  357. </html>