r19141: add a reasonable subset of the qooxdoo runtime environment, and example appli...
[Samba/ekacnet.git] / swat / apps / qooxdoo-examples / test / Window_6.html
blobaf837c4c65a48168f5e2790e5ea90921e32553bd
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>
14 <div id="demoDescription">
15 <p>Dialog with qx.ui.form.TextField and qx.ui.form.TextArea</p>
16 <p>Testing initial focus handling.</p>
17 </div>
20 <script type="text/javascript" language="JavaScript">
23 qx.core.Init.getInstance().defineMain(function() {
25 var d = qx.ui.core.ClientDocument.getInstance();
26 var txtfld;
28 var dialogEditFrage = new qx.ui.window.Window("Edit", "icon/16/editor.png");
31 with(dialogEditFrage) {
32 setSpace(300, 400, 100, 300);
34 setShowClose(false);
36 var qxObj = new qx.ui.basic.Atom('Question');
37 with(qxObj)
39 setHorizontalChildrenAlign('right');
40 set({top:10,left:10,width:'20%'});
42 add(qxObj);
44 qxObj = txtfld = new qx.ui.form.TextArea();
45 with (qxObj) {
46 set({top:10,right:10,width:'70%'})
48 add(qxObj);
50 txtfld.addEventListener("appear", function(e) {
51 this.focus();
52 });
54 qxObj = new qx.ui.basic.Atom('Type');
55 with(qxObj)
57 setHorizontalChildrenAlign('right');
58 set({top:70,left:10,width:'20%'});
60 add(qxObj);
62 qxObj = new qx.ui.form.TextField();
63 with (qxObj) {
64 set({top:70,right:10,width:'70%'})
66 add(qxObj);
69 var btnOK = new qx.ui.form.Button("OK", "icon/16/button-ok.png");
70 var btnCancel = new qx.ui.form.Button("Cancel", "icon/16/button-cancel.png");
71 var btnSetFocus = new qx.ui.form.Button("Set Focus To First Field", "icon/16/reload.png");
73 btnOK.set({ bottom : 10, right : 10 });
74 btnCancel.set({ bottom : 10, left : 10 });
75 btnSetFocus.set({ bottom : 10, left : 100 });
77 btnCancel.addEventListener("execute", function(e) {
78 dialogEditFrage.close();
79 });
80 btnOK.addEventListener("execute", function(e) {
81 dialogEditFrage.close();
82 });
84 btnSetFocus.addEventListener("execute", function(e) {
85 txtfld.focus();
86 });
88 add(btnOK, btnCancel, btnSetFocus);
91 var btnOpen = new qx.ui.form.Button("Open the dialog");
92 btnOpen.set({ top : 50, left : 20 });
93 btnOpen.addEventListener("click", function(e) {
94 dialogEditFrage.open();
95 });
97 var btnRestore = new qx.ui.form.Button("Restore the dialog");
98 btnRestore.set({ top : 80, left : 20 });
99 btnRestore.addEventListener("click", function(e) {
100 dialogEditFrage.restore();
103 d.add(btnOpen,btnRestore,dialogEditFrage);
106 </script>
108 </body>
109 </html>