r20446: rename swat directory to swat.obsolete; keeping it around since there is...
[samba.git] / swat.obsolete / apps / qooxdoo-examples / test / Builder_2.xml
1 <qx.client.builder.Container>
2   <qx.ui.form.Button id='btn' label='Click Me!!!' location='20,50'>
3       
4     <!-- function body event listener -->
5     <qx.client.builder.EventListener type='click' args='event'>
6       btn.setLabel(btn.getLabel() + ".");
7       alert(event + "\n\nClicked on: " + this.getLabel()); 
8     </qx.client.builder.EventListener>
9
10     <!-- 
11       global object.method delegation
12       when the button is clicked, d.click(event) will be called
13       -->
14     <qx.client.builder.EventListener type='click' delegate='d.click'/>
15     
16     <!-- 
17       global function delegation
18       when the button is clicked, f(event) will be called
19       -->
20     <qx.client.builder.EventListener type='click' delegate='f'/>
21     
22   </qx.ui.form.Button>
23   <qx.ui.basic.Atom id='atom1' label='Test No #1' icon='icon/16/penguin.png' border='qx.renderer.border.Border.presets.black' location='20,90'/>
24
25   <qx.ui.form.Button label='Test No #2' icon='icon/16/penguin.png' location='20,120'>
26       <qx.client.builder.EventListener type='click'>
27         atom1.setLabel(atom1.getLabel() + ".");
28       </qx.client.builder.EventListener>
29   </qx.ui.form.Button>
30   
31   <qx.ui.basic.Atom label='Test No #3' icon='icon/16/penguin.png' location='20,160'/>
32
33    <qx.ui.basic.Atom label='a' icon='icon/16/penguin.png' location='20,200'/>
34   <qx.ui.basic.Atom label='b' icon='icon/16/penguin.png' location='20,240'/>
35   
36   
37   <qx.client.builder.Script>        
38     // test delegate function
39     var f = function(e) {
40         alert(e + '\n\nclick received at delegate function\n\n');
41     }
42   
43     // test delegate object
44     var d = {
45       hello : 'world',
46       click : function(e) {
47         alert(e + '\n\nclick received at delegate object\n\n' + this.hello);
48       }
49     }   
50   </qx.client.builder.Script>
51 </qx.client.builder.Container>