blob: 772718afe87bf80415c6a46a0a45527488354ce4 (
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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>qooxdoo » Demo » Sample</title>
<link type="text/css" rel="stylesheet" href="../../css/layout.css"/>
<!--[if IE]>
<link type="text/css" rel="stylesheet" href="../../css/layout_ie.css"/>
<![endif]-->
<script type="text/javascript" src="../../script/sample.js"></script>
</head>
<body>
<script type="text/javascript" src="../../script/layout.js"></script>
<div id="demoDescription">
<p>Some tests for some of the most used properties of qx.ui.basic.Terminator (coordinates, dimensions, backgroundColor, opacity, ...).</p>
<p>Also here are the first test of some widgets which extend qx.ui.basic.Terminator: qx.ui.form.TextField and qx.ui.form.PasswordField. These extended
widgets also interacts like the basic QxTerminators with the qx.event.handler.FocusHandler.</p>
</div>
<script type="text/javascript">
qx.core.Init.getInstance().defineMain(function()
{
var d = qx.ui.core.ClientDocument.getInstance();
var c1 = new qx.ui.basic.Terminator;
d.add(c1);
c1.setTabIndex(1);
c1.setHeight(60);
c1.setWidth(60);
c1.setTop(48);
c1.setLeft(20);
c1.setBackgroundColor("blue");
c1.setOpacity(0.5);
c1.addEventListener("keydown", function(e){
if (e.getKeyIdentifier() != "Space") {
return;
};
this.setBackgroundColor("rgb(" + Math.round(Math.random()*255) + "," + Math.round(Math.random()*255) + "," + Math.round(Math.random()*255) + ")");
});
var c2 = new qx.ui.basic.Terminator;
d.add(c2);
c2.setTabIndex(2);
c2.setHeight(60);
c2.setWidth(60);
c2.setTop(68);
c2.setLeft(40);
c2.setBackgroundColor("orange");
c2.setOpacity(0.5);
c2.addEventListener("keydown", function(e){
if (e.getKeyIdentifier() != "Space") {
return;
};
this.setBackgroundColor("rgb(" + Math.round(Math.random()*255) + "," + Math.round(Math.random()*255) + "," + Math.round(Math.random()*255) + ")");
});
var t1 = new qx.ui.form.TextField;
t1.setValue("textfield");
t1.setTop(140);
t1.setLeft(20);
t1.setTabIndex(3);
d.add(t1);
var t2 = new qx.ui.form.PasswordField;
t2.setValue("passwordfield");
t2.setTop(170);
t2.setLeft(20);
t2.setTabIndex(4);
d.add(t2);
var t3 = new qx.ui.form.TextArea;
t3.setValue("textarea");
t3.setTop(200);
t3.setLeft(20);
t3.setWidth(300);
t3.setHeight(60);
t3.setTabIndex(5);
d.add(t3);
var t4 = new qx.ui.form.TextField;
t4.setValue("textfield");
t4.setTop(300);
t4.setLeft(20);
t4.setWidth(200);
t4.setMaxLength(100);
t4.setReadOnly(true);
t4.setTabIndex(6);
d.add(t4);
});
</script>
</body>
</html>
|