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
|
<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">
<p>Some tests for some of the most used properties of qx.ui.core.Widget (coordinates, dimensions, backgroundColor, opacity, ...).</p>
<p>Also here are the first test of some widgets which extend qx.ui.core.Widget: qx.ui.form.TextField and qx.ui.form.PasswordField. These extended
widgets also interacts like the basic QxWidgets 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();
function textChange(e) {
this.debug("Text changed: " + e.getData());
}
var t1 = new qx.ui.form.TextField;
t1.setValue("textfield");
t1.setTop(48);
t1.setLeft(20);
t1.addEventListener("changeValue", textChange);
t1.addEventListener("input", function(e) {
this.debug("Input: " + e.getData());
});
d.add(t1);
var t2 = new qx.ui.form.PasswordField;
t2.setValue("passwordfield");
t2.setTop(80);
t2.setLeft(20);
t2.addEventListener("changeValue", textChange);
d.add(t2);
var t3 = new qx.ui.form.TextArea;
t3.setValue("textarea");
t3.setTop(110);
t3.setLeft(20);
t3.setWidth(300);
t3.setHeight(60);
t3.addEventListener("changeValue", textChange);
d.add(t3);
var t4 = new qx.ui.form.TextField;
t4.setValue("textfield");
t4.setTop(200);
t4.setLeft(20);
t4.setWidth(200);
t4.setMaxLength(100);
t4.setReadOnly(true);
t4.addEventListener("changeValue", textChange);
d.add(t4);
var t5 = new qx.ui.form.TextField;
t5.setValue("You are foo!");
t5.setTop(240);
t5.setLeft(20);
t5.addEventListener("changeValue", textChange);
d.add(t5);
var t6 = new qx.ui.form.TextField;
t6.setTop(270);
t6.setLeft(20);
t6.addEventListener("changeText", textChange);
t6.addEventListener("input", function(e) {
this.debug("Input: " + e.getData());
});
t6.addEventListener("keydown", function(e) {
this.debug("Keypress: " + e.getKeyCode());
});
d.add(t6);
});
</script>
</body>
</html>
|