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.

445 lines
20 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <title>VBox 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(config);
  27. };
  28. // console.profile();
  29. btns.doLayout();
  30. // console.profileEnd();
  31. }
  32. var viewport = new Ext.Viewport({
  33. layout:'border',
  34. items: [{
  35. id:'btns',
  36. region:'west',
  37. baseCls:'x-plain',
  38. split:true,
  39. width:150,
  40. minWidth: 100,
  41. maxWidth: 250,
  42. layout:'fit',
  43. margins: '5 0 5 5',
  44. items: {
  45. baseCls: 'x-plain',
  46. html: '<p style="padding:10px;color:#556677;font-size:11px;">Select a configuration to the right &raquo;</p>'
  47. }
  48. }, {
  49. region:'center',
  50. margins: '5 5 5 0',
  51. layout: 'anchor',
  52. items:[{
  53. anchor: '100%',
  54. baseCls:'x-plain',
  55. layout: {
  56. type:'hbox',
  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 / Align: left',
  68. handler: function(){
  69. replace({
  70. layout: {
  71. type:'vbox',
  72. padding:'5',
  73. align:'left'
  74. },
  75. defaults:{margins:'0 0 5 0'},
  76. items:[{
  77. xtype:'button',
  78. text: 'Button 1'
  79. },{
  80. xtype:'spacer',
  81. flex:1
  82. },{
  83. xtype:'button',
  84. text: 'Button 2'
  85. },{
  86. xtype:'button',
  87. text: 'Button 3'
  88. },{
  89. xtype:'button',
  90. text: 'Button 4',
  91. margins:'0'
  92. }]
  93. }, 'spaced');
  94. }
  95. },{
  96. xtype:'button',
  97. text: 'Multi-Spaced / Align: left',
  98. handler: function(){
  99. replace({
  100. layout: {
  101. type:'vbox',
  102. padding:'5',
  103. align:'left'
  104. },
  105. defaults:{margins:'0 0 5 0'},
  106. items:[{
  107. xtype:'button',
  108. text: 'Button 1'
  109. },{
  110. xtype:'spacer',
  111. flex:1
  112. },{
  113. xtype:'button',
  114. text: 'Button 2'
  115. },{
  116. xtype:'spacer',
  117. flex:1
  118. },{
  119. xtype:'button',
  120. text: 'Button 3'
  121. },{
  122. xtype:'spacer',
  123. flex:1
  124. },{
  125. xtype:'button',
  126. text: 'Button 4',
  127. margins:'0'
  128. }]
  129. }, 'multi spaced - align left');
  130. }
  131. },{
  132. xtype:'button',
  133. text: 'Align: left',
  134. handler: function(){
  135. replace({
  136. layout: {
  137. type:'vbox',
  138. padding:'5',
  139. align:'left'
  140. },
  141. defaults:{margins:'0 0 5 0'},
  142. items:[{
  143. xtype:'button',
  144. text: 'Button 1'
  145. },{
  146. xtype:'button',
  147. text: 'Button 2'
  148. },{
  149. xtype:'button',
  150. text: 'Button 3'
  151. },{
  152. xtype:'button',
  153. text: 'Button 4'
  154. }]
  155. }, 'align left');
  156. }
  157. },{
  158. xtype:'button',
  159. text: 'Align: center',
  160. handler: function(){
  161. replace({
  162. layout: {
  163. type:'vbox',
  164. padding:'5',
  165. align:'center'
  166. },
  167. defaults:{margins:'0 0 5 0'},
  168. items:[{
  169. xtype:'button',
  170. text: 'Button 1'
  171. },{
  172. xtype:'button',
  173. text: 'Button 2'
  174. },{
  175. xtype:'button',
  176. text: 'Button 3'
  177. },{
  178. xtype:'button',
  179. text: 'Button 4'
  180. }]
  181. }, 'align center');
  182. }
  183. },{
  184. xtype:'button',
  185. text: 'Align: stretch',
  186. handler: function(){
  187. replace({
  188. layout: {
  189. type:'vbox',
  190. padding:'5',
  191. align:'stretch'
  192. },
  193. defaults:{margins:'0 0 5 0'},
  194. items:[{
  195. xtype:'button',
  196. text: 'Button 1'
  197. },{
  198. xtype:'button',
  199. text: 'Button 2'
  200. },{
  201. xtype:'button',
  202. text: 'Button 3'
  203. },{
  204. xtype:'button',
  205. text: 'Button 4'
  206. }]
  207. }, 'align stretch');
  208. }
  209. },{
  210. xtype:'button',
  211. text: 'Align: stretchmax',
  212. handler: function(){
  213. replace({
  214. layout: {
  215. type:'vbox',
  216. padding:'5',
  217. align:'stretchmax'
  218. },
  219. defaults:{margins:'0 0 5 0'},
  220. items:[{
  221. xtype:'button',
  222. text: 'Button 1'
  223. },{
  224. xtype:'button',
  225. text: 'Button 2'
  226. },{
  227. xtype:'button',
  228. text: 'Button 3'
  229. },{
  230. xtype:'button',
  231. text: 'Button 4'
  232. }]
  233. }, 'align stretchmax');
  234. }
  235. }]
  236. },{
  237. anchor: '100%',
  238. baseCls:'x-plain',
  239. layout: {
  240. type:'hbox',
  241. padding: '0 10 10'
  242. },
  243. defaults:{
  244. margins:'0 5 0 0',
  245. pressed: false,
  246. toggleGroup:'btns',
  247. allowDepress: false
  248. },
  249. items: [{
  250. xtype:'button',
  251. text: 'Flex: Even / Align: center',
  252. handler: function(){
  253. replace({
  254. layout: {
  255. type:'vbox',
  256. padding:'5',
  257. align:'center'
  258. },
  259. defaults:{margins:'0 0 5 0'},
  260. items:[{
  261. xtype:'button',
  262. text: 'Button 1',
  263. flex:1
  264. },{
  265. xtype:'button',
  266. text: 'Button 2',
  267. flex:1
  268. },{
  269. xtype:'button',
  270. text: 'Button 3',
  271. flex:1
  272. },{
  273. xtype:'button',
  274. text: 'Button 4',
  275. flex:1,
  276. margins:'0'
  277. }]
  278. }, 'align flex even');
  279. }
  280. },{
  281. xtype:'button',
  282. text: 'Flex: Ratio / Align: center',
  283. handler: function(){
  284. replace({
  285. layout: {
  286. type:'vbox',
  287. padding:'5',
  288. align:'center'
  289. },
  290. defaults:{margins:'0 0 5 0'},
  291. items:[{
  292. xtype:'button',
  293. text: 'Button 1',
  294. flex:1
  295. },{
  296. xtype:'button',
  297. text: 'Button 2',
  298. flex:1
  299. },{
  300. xtype:'button',
  301. text: 'Button 3',
  302. flex:1
  303. },{
  304. xtype:'button',
  305. text: 'Button 4',
  306. flex:3,
  307. margins:'0'
  308. }]
  309. }, 'align flex ratio');
  310. }
  311. },{
  312. xtype:'button',
  313. text: 'Flex + Stretch',
  314. handler: function(){
  315. replace({
  316. layout: {
  317. type:'vbox',
  318. padding:'5',
  319. align:'stretch'
  320. },
  321. defaults:{margins:'0 0 5 0'},
  322. items:[{
  323. xtype:'button',
  324. text: 'Button 1',
  325. flex:1
  326. },{
  327. xtype:'button',
  328. text: 'Button 2',
  329. flex:1
  330. },{
  331. xtype:'button',
  332. text: 'Button 3',
  333. flex:1
  334. },{
  335. xtype:'button',
  336. text: 'Button 4',
  337. flex:3,
  338. margins:'0'
  339. }]
  340. }, 'align flex + stretch');
  341. }
  342. },{
  343. xtype:'button',
  344. text: 'Pack: start / Align: center',
  345. handler: function(){
  346. replace({
  347. layout: {
  348. type:'vbox',
  349. padding:'5',
  350. pack:'start',
  351. align:'center'
  352. },
  353. defaults:{margins:'0 0 5 0'},
  354. items:[{
  355. xtype:'button',
  356. text: 'Button 1'
  357. },{
  358. xtype:'button',
  359. text: 'Button 2'
  360. },{
  361. xtype:'button',
  362. text: 'Button 3'
  363. },{
  364. xtype:'button',
  365. text: 'Button 4'
  366. }]
  367. }, 'align pack start + align center');
  368. }
  369. },{
  370. xtype:'button',
  371. text: 'Pack: center / Align: center',
  372. handler: function(){
  373. replace({
  374. layout: {
  375. type:'vbox',
  376. padding:'5',
  377. pack:'center',
  378. align:'center'
  379. },
  380. defaults:{margins:'0 0 5 0'},
  381. items:[{
  382. xtype:'button',
  383. text: 'Button 1'
  384. },{
  385. xtype:'button',
  386. text: 'Button 2'
  387. },{
  388. xtype:'button',
  389. text: 'Button 3'
  390. },{
  391. xtype:'button',
  392. text: 'Button 4',
  393. margins:'0'
  394. }]
  395. }, 'align pack center + align center');
  396. }
  397. },{
  398. xtype:'button',
  399. text: 'Pack: end / Align: center',
  400. handler: function(){
  401. replace({
  402. layout: {
  403. type:'vbox',
  404. padding:'5',
  405. pack:'end',
  406. align:'center'
  407. },
  408. defaults:{margins:'0 0 5 0'},
  409. items:[{
  410. xtype:'button',
  411. text: 'Button 1'
  412. },{
  413. xtype:'button',
  414. text: 'Button 2'
  415. },{
  416. xtype:'button',
  417. text: 'Button 3'
  418. },{
  419. xtype:'button',
  420. text: 'Button 4',
  421. margins:'0'
  422. }]
  423. }, 'align pack end + align center');
  424. }
  425. }]
  426. }]
  427. }]
  428. });
  429. });
  430. </script>
  431. </head>
  432. <body>
  433. </body>
  434. </html>