X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DependTree%2FWindow.js;h=e6f2d1256d806c9bbadd9186db4a6b60df5b2429;hb=a33c2f259d02e5174c600665013992b64a0e91f4;hp=22674e10332d4e3d6d90db355fe2354686c859c7;hpb=9f1b0fd90d21fccd6dcbdc037c0e32ed4d935c4e;p=app.Builder.js diff --git a/DependTree/Window.js b/DependTree/Window.js index 22674e103..e6f2d1256 100644 --- a/DependTree/Window.js +++ b/DependTree/Window.js @@ -13,40 +13,273 @@ console = imports.console; XObject = imports.XObject.XObject; Window=new XObject({ xtype: Gtk.Window, + listeners : { + show : function (self) { + print("SHOW"); + var BuildLists = imports['BuildLists.js'].BuildLists; + this.data = new BuildLists(); + print(JSON.stringify(this.data.allmethods, null,4)); + + var ls = this.get('method-list-store'); + this.data.allmethods.forEach(function(v) { + ls.append( [ v ]); + }); + var ls = this.get('children-list-store'); + this.data.allchildren.forEach(function(v) { + ls.append( [ v ]); + }); + var ls = this.get('class-list-store'); + var i =0; + for (var c in this.data.methods) { + i++; + ls.append( [ c , true , i > 10 ? true : false]); + }; + + + + } + }, + default_height : 500, + default_width : 600, init : function() { XObject.prototype.init.call(this); this.el.show_all(); }, items : [ { - xtype: Gtk.HBox, + xtype: Gtk.VBox, items : [ { - xtype: Gtk.ScrolledWindow, + xtype: Gtk.HBox, + pack : "pack_start,false,false", items : [ { - xtype: Gtk.TreeView, - items : [ - { - xtype: Gtk.ListStore - } - ] + xtype: Gtk.Button, + label : "Reset" } ] }, { - xtype: Gtk.ScrolledWindow, + xtype: Gtk.HBox, items : [ { - xtype: Gtk.TreeView - } - ] - }, - { - xtype: Gtk.ScrolledWindow, - items : [ + xtype: Gtk.ScrolledWindow, + items : [ + { + xtype: Gtk.TreeView, + items : [ + { + xtype: Gtk.TreeModelFilter, + init : function() { + this.items[0].pack = false; + this.items[0].init(); + this.list = this.items[0]; + this.el = new Gtk.TreeModelFilter.c_new(this.items[0].el, null); + this.el.set_visible_column(2); + XObject.prototype.init.call(this); + + }, + items : [ + { + xtype: Gtk.ListStore, + id : "class-list-store", + pack : false, + init : function() + { + XObject.prototype.init.call(this); + this.el.set_column_types ( 6, [ + GObject.TYPE_STRING, + GObject.TYPE_BOOLEAN, + GObject.TYPE_BOOLEAN, + GObject.TYPE_STRING, + GObject.TYPE_STRING, + GObject.TYPE_STRING + ] ); + + } + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + title : "Class", + expand : true, + items : [ + { + xtype: Gtk.CellRendererText + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + title : "Active", + items : [ + { + xtype: Gtk.CellRendererToggle, + listeners : { + toggled : function (self, path) { + print("TOGGLE"); + // this.list + + + + var old = this.list.getValue(path, 1); + // print(JSON.stringify(old)); + this.list.setValue(path, 1, old ? false : true) + + + + + } + }, + activatable : true + } + ] + } + ] + } + ] + }, + { + xtype: Gtk.ScrolledWindow, + items : [ + { + xtype: Gtk.TreeView, + items : [ + { + xtype: Gtk.TreeModelFilter, + init : function() { + this.items[0].pack = false; + this.items[0].init(); + this.list = this.items[0]; + this.el = new Gtk.TreeModelFilter.c_new(this.items[0].el, null); + this.el.set_visible_column(2); + XObject.prototype.init.call(this); + + }, + items : [ + { + xtype: Gtk.ListStore, + id : "method-list-store", + init : function() + { + XObject.prototype.init.call(this); + this.el.set_column_types ( 6, [ + GObject.TYPE_STRING, + GObject.TYPE_BOOLEAN, + GObject.TYPE_STRING, + GObject.TYPE_STRING, + GObject.TYPE_STRING, + GObject.TYPE_STRING + ] ); + + }, + pack : false + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + title : "Methods", + expand : true, + items : [ + { + xtype: Gtk.CellRendererText + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + title : "Active", + items : [ + { + xtype: Gtk.CellRendererToggle, + listeners : { + toggled : function (self, path) { + print("TOGGLE"); + // this.list + + + + var old = this.list.getValue(path, 1); + // print(JSON.stringify(old)); + this.list.setValue(path, 1, old ? false : true) + + + + + } + }, + activatable : true + } + ] + } + ] + } + ] + }, { - xtype: Gtk.TreeView + xtype: Gtk.ScrolledWindow, + items : [ + { + xtype: Gtk.TreeView, + items : [ + { + xtype: Gtk.ListStore, + id : "children-list-store", + init : function() + { + XObject.prototype.init.call(this); + this.el.set_column_types ( 6, [ + GObject.TYPE_STRING, + GObject.TYPE_BOOLEAN, + GObject.TYPE_STRING, + GObject.TYPE_STRING, + GObject.TYPE_STRING, + GObject.TYPE_STRING + ] ); + + } + }, + { + xtype: Gtk.TreeViewColumn, + title : "Child classes", + expand : true, + items : [ + { + xtype: Gtk.CellRendererText + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + title : "Active", + items : [ + { + xtype: Gtk.CellRendererToggle, + listeners : { + toggled : function (self, path) { + print("TOGGLE"); + // this.list + + + + var old = this.list.getValue(path, 1); + // print(JSON.stringify(old)); + this.list.setValue(path, 1, old ? false : true) + + + + + } + }, + activatable : true + } + ] + } + ] + } + ] } ] }