blob: 97b63d1e4494dc0188d64ca7a84fd30e942917f0 (
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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>qooxdoo » 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">
Some advanced tests for qx.ui.basic.Image. Click on the fourth and fifth image to test the reflow possibilities.
The debug log gives you information of the preferred dimensions.
</div>
<script type="text/javascript">
qx.core.Init.getInstance().defineMain(function()
{
var d = qx.ui.core.ClientDocument.getInstance();
var frame = new qx.ui.layout.CanvasLayout;
frame.setBorder(qx.renderer.border.BorderPresets.getInstance().ridge);
frame.setWidth("auto");
frame.setHeight("auto");
frame.setPadding(8);
frame.setLeft(20);
frame.setTop(48);
d.add(frame);
var out = new qx.ui.layout.CanvasLayout;
out.setBorder(qx.renderer.border.BorderPresets.getInstance().inset);
out.setWidth("auto");
out.setHeight("auto");
out.setPadding(8);
frame.add(out);
var bar = new qx.ui.layout.CanvasLayout;
bar.setBorder(qx.renderer.border.BorderPresets.getInstance().outset);
bar.setWidth("auto");
bar.setHeight("auto");
bar.setPadding(4);
bar.setBackgroundColor(new qx.renderer.color.Color("white"));
out.add(bar);
var part, icon;
var icons = [ "reload", "bookmark", "run" ];
for (var j=0; j<5; j++)
{
part = new qx.ui.layout.CanvasLayout;
part.setWidth("auto");
part.setHeight("auto");
part.setBorder(qx.renderer.border.BorderPresets.getInstance().outset);
part.setLeft(j*90);
part.setTop(0);
part.setBackgroundColor(new qx.renderer.color.ColorObject("Threedface"));
part.setPadding(4);
for (var i=0; i<icons.length; i++)
{
icon = new qx.ui.basic.Image("icon/22/" + icons[i] + ".png");
icon.setTop(0);
icon.setLeft(26 * i);
icon.setPadding(2);
part.add(icon);
};
bar.add(part);
};
bar.addEventListener("click", function(e)
{
var parts = bar.getChildren();
var icons;
var m;
var s = (new Date).valueOf();
for (var j=0; j<parts.length; j++)
{
icons = parts[j].getChildren();
for (var i=0; i<icons.length; i++)
{
m = icons[i].getSource().indexOf("/22/") != -1;
icons[i].setSource(m ? icons[i].getSource().replace("/22/", "/32/") : icons[i].getSource().replace("/32/", "/22/"));
icons[i].setLeft(m ? 36 * i : 26 * i);
};
parts[j].setLeft(m ? j * 120 : j * 90);
};
// this.debug("Change Duration: " + ((new Date).valueOf() - s));
});
});
</script>
</body>
</html>
|