1c45e108863ebc9f3a1e9229f2f33fe86d2ef82e
[app.Builder.js] / DependTree / Window.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
5 Gio = imports.gi.Gio;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
9 Vte = imports.gi.Vte;
10 GtkClutter = imports.gi.GtkClutter;
11 Gdl = imports.gi.Gdl;
12 console = imports.console;
13 XObject = imports.XObject.XObject;
14 Window=new XObject({
15     xtype: Gtk.Window,
16     listeners : {
17         show : function (self) {
18             print("SHOW");
19             var BuildLists = imports['BuildLists.js'].BuildLists;
20             this.data = new BuildLists();
21             print(JSON.stringify(this.data.allmethods, null,4));
22             
23             var ls = this.get('method-list-store');
24             this.data.allmethods.forEach(function(v) {
25                 ls.append( [ v ]);
26             });
27             var ls = this.get('children-list-store');
28             this.data.allchildren.forEach(function(v) {
29                 ls.append( [ v ]);
30             });
31             var ls = this.get('class-list-store');
32             for (var c in this.data.methods) {
33                 ls.append( [ c , true ]);
34             };
35             
36             
37             
38         }
39     },
40     default_height : 500,
41     default_width : 600,
42     init : function() {
43         XObject.prototype.init.call(this);
44         this.el.show_all();
45     },
46     items : [
47         {
48             xtype: Gtk.VBox,
49             items : [
50                 {
51                     xtype: Gtk.HBox,
52                     pack : "pack_start,false,false",
53                     items : [
54                         {
55                             xtype: Gtk.Button,
56                             label : "Reset"
57                         }
58                     ]
59                 },
60                 {
61                     xtype: Gtk.HBox,
62                     items : [
63                         {
64                             xtype: Gtk.ScrolledWindow,
65                             items : [
66                                 {
67                                     xtype: Gtk.TreeView,
68                                     items : [
69                                         {
70                                             xtype: Gtk.ListStore,
71                                             id : "class-list-store",
72                                             init : function() 
73                                                     {
74                                                         XObject.prototype.init.call(this);
75                                                         this.el.set_column_types ( 6, [
76                                                             GObject.TYPE_STRING, 
77                                                             GObject.TYPE_BOOLEAN, 
78                                                             GObject.TYPE_STRING, 
79                                                             GObject.TYPE_STRING, 
80                                                             GObject.TYPE_STRING, 
81                                                             GObject.TYPE_STRING 
82                                                         ] );
83                                                         
84                                                     }
85                                         },
86                                         {
87                                             xtype: Gtk.TreeViewColumn,
88                                             title : "Class",
89                                             expand : true,
90                                             items : [
91                                                 {
92                                                     xtype: Gtk.CellRendererText
93                                                 }
94                                             ]
95                                         },
96                                         {
97                                             xtype: Gtk.TreeViewColumn,
98                                             title : "Active",
99                                             items : [
100                                                 {
101                                                     xtype: Gtk.CellRendererToggle,
102                                                     listeners : {
103                                                         toggled : function (self, path) {
104                                                             print("TOGGLE");
105                                                             // this.list
106                                                         
107                                                         
108                                                              
109                                                             var old = this.list.getValue(path, 1);
110                                                            // print(JSON.stringify(old));
111                                                             this.list.setValue(path, 1, old ? false : true)
112                                                             
113                                                             
114                                                             
115                                                             
116                                                         }
117                                                     },
118                                                     activatable : true
119                                                 }
120                                             ]
121                                         }
122                                     ]
123                                 }
124                             ]
125                         },
126                         {
127                             xtype: Gtk.ScrolledWindow,
128                             items : [
129                                 {
130                                     xtype: Gtk.TreeView,
131                                     items : [
132                                         {
133                                             xtype: Gtk.ListStore,
134                                             id : "method-list-store",
135                                             init : function() 
136                                                     {
137                                                         XObject.prototype.init.call(this);
138                                                         this.el.set_column_types ( 6, [
139                                                             GObject.TYPE_STRING, 
140                                                             GObject.TYPE_BOOLEAN, 
141                                                             GObject.TYPE_STRING, 
142                                                             GObject.TYPE_STRING, 
143                                                             GObject.TYPE_STRING, 
144                                                             GObject.TYPE_STRING 
145                                                         ] );
146                                                         
147                                                     }
148                                         },
149                                         {
150                                             xtype: Gtk.TreeViewColumn,
151                                             title : "Methods",
152                                             expand : true,
153                                             items : [
154                                                 {
155                                                     xtype: Gtk.CellRendererText
156                                                 }
157                                             ]
158                                         },
159                                         {
160                                             xtype: Gtk.TreeViewColumn,
161                                             title : "Active",
162                                             items : [
163                                                 {
164                                                     xtype: Gtk.CellRendererToggle,
165                                                     listeners : {
166                                                         toggled : function (self, path) {
167                                                             print("TOGGLE");
168                                                             // this.list
169                                                         
170                                                         
171                                                              
172                                                             var old = this.list.getValue(path, 1);
173                                                            // print(JSON.stringify(old));
174                                                             this.list.setValue(path, 1, old ? false : true)
175                                                             
176                                                             
177                                                             
178                                                             
179                                                         }
180                                                     },
181                                                     activatable : true
182                                                 }
183                                             ]
184                                         }
185                                     ]
186                                 }
187                             ]
188                         },
189                         {
190                             xtype: Gtk.ScrolledWindow,
191                             items : [
192                                 {
193                                     xtype: Gtk.TreeView,
194                                     items : [
195                                         {
196                                             xtype: Gtk.ListStore,
197                                             id : "children-list-store",
198                                             init : function() 
199                                                     {
200                                                         XObject.prototype.init.call(this);
201                                                         this.el.set_column_types ( 6, [
202                                                             GObject.TYPE_STRING, 
203                                                             GObject.TYPE_BOOLEAN, 
204                                                             GObject.TYPE_STRING, 
205                                                             GObject.TYPE_STRING, 
206                                                             GObject.TYPE_STRING, 
207                                                             GObject.TYPE_STRING 
208                                                         ] );
209                                                         
210                                                     }
211                                         },
212                                         {
213                                             xtype: Gtk.TreeViewColumn,
214                                             title : "Child classes",
215                                             expand : true,
216                                             items : [
217                                                 {
218                                                     xtype: Gtk.CellRendererText
219                                                 }
220                                             ]
221                                         },
222                                         {
223                                             xtype: Gtk.TreeViewColumn,
224                                             title : "Active",
225                                             items : [
226                                                 {
227                                                     xtype: Gtk.CellRendererToggle,
228                                                     listeners : {
229                                                         toggled : function (self, path) {
230                                                             print("TOGGLE");
231                                                             // this.list
232                                                         
233                                                         
234                                                              
235                                                             var old = this.list.getValue(path, 1);
236                                                            // print(JSON.stringify(old));
237                                                             this.list.setValue(path, 1, old ? false : true)
238                                                             
239                                                             
240                                                             
241                                                             
242                                                         }
243                                                     },
244                                                     activatable : true
245                                                 }
246                                             ]
247                                         }
248                                     ]
249                                 }
250                             ]
251                         }
252                     ]
253                 }
254             ]
255         }
256     ]
257 });
258 Window.init();
259 XObject.cache['/Window'] = Window;