r19141: add a reasonable subset of the qooxdoo runtime environment, and example appli...
[jra/samba/.git] / swat / apps / qooxdoo-examples / test / GridLayout_9.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4   <title>qooxdoo &raquo; Demo</title>
5   <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
6   <!--[if IE]>
7   <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
8   <![endif]-->
9   <script type="text/javascript" src="../../script/qx.js"></script>
10 </head>
11 <body>
12   <script type="text/javascript" src="../../script/layout.js"></script>
13
14   <div id="demoDescription">
15     <p>Test for qx.ui.layout.GridLayout. Now with cells which are merged with others.</p>
16     <p>Added spacing in combination with spans.</p>
17     <p>Added padding in combination with spans.</p>
18   </div>
19
20   <script type="text/javascript">
21   qx.core.Init.getInstance().defineMain(function()
22   {
23     var gl = new qx.ui.layout.GridLayout;
24     
25     gl.setLocation(20, 48);
26     gl.setDimension("auto", "auto");
27     gl.setBorder(qx.renderer.border.BorderPresets.getInstance().outset);
28     gl.setPadding(2, 4);
29     gl.setColumnCount(4);
30     gl.setRowCount(2);
31     gl.setHorizontalSpacing(10);
32     gl.setVerticalSpacing(10);
33     gl.setCellPaddingTop(4);
34     gl.setCellPaddingRight(4);
35     gl.setCellPaddingBottom(4);
36     gl.setCellPaddingLeft(4);
37     
38     gl.setColumnWidth(0, 100);
39     gl.setColumnWidth(1, 200);
40     gl.setColumnWidth(2, 50);
41     gl.setColumnWidth(3, 100);
42     
43     gl.setRowHeight(0, 40);
44     gl.setRowHeight(1, 80);
45     
46     qx.ui.core.ClientDocument.getInstance().add(gl);
47     
48     // start-col, start-row, col-length, row-length
49     gl.debug("Merge: 1, 1, 2, 1");
50     gl.mergeCells(1, 1, 2, 1);   
51     
52     gl.debug("Span-Start (0, 1): " + gl.isSpanStart(0, 1));
53     gl.debug("Span-Start (0, 2): " + gl.isSpanStart(0, 2));
54     gl.debug("Span-Start (1, 1): " + gl.isSpanStart(1, 1));
55     gl.debug("Span-Start (1, 2): " + gl.isSpanStart(1, 2));
56     gl.debug("Span-Start (2, 1): " + gl.isSpanStart(2, 1));
57     gl.debug("Span-Start (2, 2): " + gl.isSpanStart(2, 2));
58     gl.debug("Span-Start (3, 1): " + gl.isSpanStart(3, 1));
59     gl.debug("Span-Start (3, 2): " + gl.isSpanStart(3, 2));
60     
61     gl.debug("Span-Cell (0, 1): " + gl.isSpanCell(0, 1));
62     gl.debug("Span-Cell (0, 2): " + gl.isSpanCell(0, 2));
63     gl.debug("Span-Cell (1, 1): " + gl.isSpanCell(1, 1));
64     gl.debug("Span-Cell (1, 2): " + gl.isSpanCell(1, 2));
65     gl.debug("Span-Cell (2, 1): " + gl.isSpanCell(2, 1));
66     gl.debug("Span-Cell (2, 2): " + gl.isSpanCell(2, 2));
67     gl.debug("Span-Cell (3, 1): " + gl.isSpanCell(3, 1));
68     gl.debug("Span-Cell (3, 2): " + gl.isSpanCell(3, 2));
69
70     gl.debug("Fill-Cell (0, 1): " + gl.isFillCell(0, 1));
71     gl.debug("Fill-Cell (0, 2): " + gl.isFillCell(0, 2));
72     gl.debug("Fill-Cell (1, 1): " + gl.isFillCell(1, 1));
73     gl.debug("Fill-Cell (1, 2): " + gl.isFillCell(1, 2));
74     gl.debug("Fill-Cell (2, 1): " + gl.isFillCell(2, 1));
75     gl.debug("Fill-Cell (2, 2): " + gl.isFillCell(2, 2));
76     gl.debug("Fill-Cell (3, 1): " + gl.isFillCell(3, 1));
77     gl.debug("Fill-Cell (3, 2): " + gl.isFillCell(3, 2));
78     
79     /*
80     // both should be impossible
81     gl.debug("Merge 1, 1, 2, 1");
82     gl.mergeCells(1, 1, 2, 1);
83
84     gl.debug("Merge 0, 0, 3, 4");
85     gl.mergeCells(0, 0, 3, 4);
86     */
87     
88     gl.debug("Merge 0, 0, 1, 2");
89     gl.mergeCells(0, 0, 1, 2);
90     
91     gl.debug("Merge 2, 0, 2, 1");
92     gl.mergeCells(2, 0, 2, 1);
93     
94     
95     
96     
97     var term1 = new qx.ui.basic.Terminator;
98     term1.setBackgroundColor("yellow");
99     gl.add(term1, 0, 0);
100     
101     var term2 = new qx.ui.basic.Terminator;
102     term2.setBackgroundColor("red");
103     gl.add(term2, 1, 0);
104     
105     var term3 = new qx.ui.basic.Terminator;
106     term3.setBackgroundColor("green");
107     gl.add(term3, 2, 0);
108
109     var term6 = new qx.ui.basic.Terminator;
110     term6.setBackgroundColor("olive");
111     gl.add(term6, 1, 1);    
112   
113     var term8 = new qx.ui.basic.Terminator;
114     term8.setBackgroundColor("navy");
115     gl.add(term8, 3, 1);            
116   });
117   </script> 
118
119 </body>
120 </html>