summaryrefslogtreecommitdiff
path: root/swat/apps/qooxdoo-examples/test/Atom_2.html
blob: b80d6414cb7af7a106529debe9f78dab801b2139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>qooxdoo &raquo; Demo</title>
  <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
  <!--[if IE]>
  <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
  <![endif]-->
  <script type="text/javascript" src="../../script/qx.js"></script>
</head>
<body>
  <script type="text/javascript" src="../../script/layout.js"></script>

  <div id="demoDescription">
    <p>Example to show correct calculations of qx.ui.basic.Atom sizes. Normally a qx.ui.basic.Atom has only the size of its content.</p>
  </div>

  <script type="text/javascript">
    qx.core.Init.getInstance().defineMain(function()
    {
      var w = qx.ui.core.ClientDocument.getInstance();


      function alertoff() {
        alert(this.getElement().offsetWidth + "x" + this.getElement().offsetHeight);
      };

      var l1 = new qx.ui.layout.CanvasLayout();
      var l2 = new qx.ui.layout.CanvasLayout();

      with(l1)
      {
        setTop(100);
        setLeft(20);
        setWidth(500);
        setHeight(1);
        setBackgroundColor("red");
        setOverflow("hidden");
      };

      with(l2)
      {
        setTop(123);
        setLeft(20);
        setWidth(500);
        setHeight(1);
        setBackgroundColor("red");
        setOverflow("hidden");
      };

      w.add(l1);
      w.add(l2);



      var a1 = new qx.ui.basic.Atom("Pure Text", "icon/22/folder.png");
      var a2 = new qx.ui.basic.Atom(null, "icon/22/folder.png");

      with(a1) {
        setBorder(new qx.renderer.border.Border(1, "solid", "black"));
        setTop(100);
        setLeft(120);
      };

      with(a2) {
        setBorder(new qx.renderer.border.Border(1, "solid", "black"));
        setTop(100);
        setLeft(300);
      };

      w.add(a1);
      w.add(a2);

      a1.addEventListener("click", alertoff);
      a2.addEventListener("click", alertoff);



      var l3 = new qx.ui.layout.CanvasLayout();
      var l4 = new qx.ui.layout.CanvasLayout();

      with(l3)
      {
        setTop(200);
        setLeft(20);
        setWidth(500);
        setHeight(1);
        setBackgroundColor("red");
        setOverflow("hidden");
      };

      with(l4)
      {
        setTop(233);
        setLeft(20);
        setWidth(500);
        setHeight(1);
        setBackgroundColor("red");
        setOverflow("hidden");
      };

      w.add(l3);
      w.add(l4);


      var b1 = new qx.ui.basic.Atom("Pure Text", "icon/32/network.png");
      var b2 = new qx.ui.basic.Atom(null, "icon/32/network.png");

      with(b1) {
        setBorder(new qx.renderer.border.Border(1, "solid", "black"));
        setTop(200);
        setLeft(120);
      };

      with(b2) {
        setBorder(new qx.renderer.border.Border(1, "solid", "black"));
        setTop(200);
        setLeft(300);
      };

      w.add(b1);
      w.add(b2);

      b1.addEventListener("click", alertoff);
      b2.addEventListener("click", alertoff);






      var l5 = new qx.ui.layout.CanvasLayout();
      var l6 = new qx.ui.layout.CanvasLayout();

      with(l5)
      {
        setTop(300);
        setLeft(20);
        setWidth(500);
        setHeight(1);
        setBackgroundColor("red");
        setOverflow("hidden");
      };

      with(l6)
      {
        setTop(317);
        setLeft(20);
        setWidth(500);
        setHeight(1);
        setBackgroundColor("red");
        setOverflow("hidden");
      };

      w.add(l5);
      w.add(l6);


      var c1 = new qx.ui.basic.Atom("Pure Text", "icon/16/network.png");
      var c2 = new qx.ui.basic.Atom(null, "icon/16/network.png");

      with(c1) {
        setBorder(new qx.renderer.border.Border(1, "solid", "black"));
        setTop(300);
        setLeft(120);
      };

      with(c2) {
        setBorder(new qx.renderer.border.Border(1, "solid", "black"));
        setTop(300);
        setLeft(300);
      };

      w.add(c1);
      w.add(c2);

      c1.addEventListener("click", alertoff);
      c2.addEventListener("click", alertoff);





    });
  </script>
</body>
</html>