X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DependTree%2FWindow.js;h=e6f2d1256d806c9bbadd9186db4a6b60df5b2429;hb=a33c2f259d02e5174c600665013992b64a0e91f4;hp=835771daf0c65c4ddbc2fa4fc3b3a7869bd5bf0d;hpb=f2302f855e62268773e7db498063f9eae065cca8;p=app.Builder.js diff --git a/DependTree/Window.js b/DependTree/Window.js index 835771daf..e6f2d1256 100644 --- a/DependTree/Window.js +++ b/DependTree/Window.js @@ -29,8 +29,10 @@ Window=new XObject({ ls.append( [ v ]); }); var ls = this.get('class-list-store'); + var i =0; for (var c in this.data.methods) { - ls.append( [ c , true ]); + i++; + ls.append( [ c , true , i > 10 ? true : false]); }; @@ -67,25 +69,41 @@ Window=new XObject({ xtype: Gtk.TreeView, items : [ { - xtype: Gtk.ListStore, - id : "class-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.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 @@ -107,7 +125,7 @@ Window=new XObject({ var old = this.list.getValue(path, 1); // print(JSON.stringify(old)); - this.list.setValue(path, 1, !old) + this.list.setValue(path, 1, old ? false : true) @@ -129,17 +147,72 @@ Window=new XObject({ xtype: Gtk.TreeView, items : [ { - xtype: Gtk.ListStore, - id : "method-list-store" + 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 + } + ] } ] } @@ -153,16 +226,56 @@ Window=new XObject({ items : [ { xtype: Gtk.ListStore, - id : "children-list-store" + 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 + } + ] } ] }