sync
[app.Builder.js] / oldbuilder / LeftProps.js
1 //<Script type="text/javascript">
2 Gio = imports.gi.Gio;
3 Gtk = imports.gi.Gtk;
4 Gdk = imports.gi.Gdk;
5 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 Pango = imports.gi.Pango ;
8
9
10 XObject = imports.XObject.XObject;
11 console = imports.console;
12
13
14 MidPropTree = imports.Builder.MidPropTree.MidPropTree;
15 AddPropertyPopup = imports.Builder.AddPropertyPopup.AddPropertyPopup; 
16
17
18 /**
19  * 
20  * Properties and events pulldowns..
21  * 
22  */
23
24 LeftProps = new XObject({
25         
26         xtype: Gtk.HBox,
27         pack : [ 'pack_start', false, true, 0 ],
28         items : [       
29             {
30                 
31                 
32                 xtype: Gtk.Button,
33                  
34                 listeners : {
35                     // pressed...
36                     'button-press-event' : function(w, ev ){
37                         console.log('pressed');
38                         MidPropTree.get('model').showData('props');
39                         return true;
40                         // show the MidPropTree..
41                     }
42                   
43                 },
44                 items : [
45                     {
46                         
47                         xtype: Gtk.HBox,
48                         pack : ['add'],
49                         items : [
50                             {
51                                 
52                                 xtype: Gtk.Image,
53                                 'stock' : Gtk.STOCK_ADD,
54                                 'icon-size' : Gtk.IconSize.MENU,
55                                 
56                                 pack : ['add']
57                                 
58                             },
59                             {
60                                 
61                                 xtype: Gtk.Label,
62                                 pack : ['add'],
63                                 label: "Property"
64                                 
65                             }
66                         
67                         ]
68                     }
69                          
70                 ]
71             },
72              {
73                 
74                 
75                 xtype: Gtk.Button,
76                  
77                 
78                 
79                 listeners : {
80                     // pressed...
81                     'button-press-event' : function(w, ev ){
82                         console.log('pressed');
83                         MidPropTree.get('model').showData('events');
84                         return true;
85                         // show the MidPropTree..
86                     }
87                   
88                 },
89                 items : [
90                     {
91                         
92                         xtype: Gtk.HBox,
93                         pack : ['add'],
94                         items : [
95                             {
96                                 
97                                 xtype: Gtk.Image,
98                                 'stock' : Gtk.STOCK_ADD,
99                                 'icon-size' : Gtk.IconSize.MENU,
100                                 
101                                 pack : ['add']
102                                 
103                             },
104                             {
105                                 
106                                 xtype: Gtk.Label,
107                                 pack : ['add'],
108                                 label: 'Handler'
109                                 
110                             }
111                         
112                         ]
113                     }
114                          
115                 ]
116             },
117               {
118                 
119                 
120                 xtype: Gtk.Button,
121                  
122                 
123                 
124                 listeners : {
125                     // pressed...
126                     'button-press-event' : function(w, ev ){
127                         // show the menu..
128                         if (!AddPropertyPopup.el) {
129                             AddPropertyPopup.init();
130                         }
131                         AddPropertyPopup.el.set_screen(Gdk.Screen.get_default());
132                         AddPropertyPopup.el.show_all();
133                         AddPropertyPopup.el.popup(null, null, null, null, 3, ev.button.time);
134                         //console.log('pressed');
135                         //Builder.MidPropTree._model.showData('events');
136                         return true;
137                         // show the MidPropTree..
138                     }
139                   
140                 },
141                 items : [
142                     {
143                         
144                         xtype: Gtk.HBox,
145                         pack : ['add'],
146                         items : [
147                             {
148                                 
149                                 xtype: Gtk.Image,
150                                 'stock' : Gtk.STOCK_ADD,
151                                 'icon-size' : Gtk.IconSize.MENU,
152                                 
153                                 pack : ['add']
154                                 
155                             },
156                             {
157                                 
158                                 xtype: Gtk.Label,
159                                 pack : ['add'],
160                                 label: 'Other'
161                                 
162                             }
163                         
164                         ]
165                     } 
166              
167                          
168                 ]
169             }
170         ]
171         
172              
173     }
174
175
176 )
177