X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DependTree%2FWindow.js;h=984b8b5492c909103e64c28160b4dd4167bdbe25;hb=119290bc3234e9ece1c64dbd72ca486d9633b5b7;hp=2a88509378c2734069b5dbbb870c98791a2c6dc2;hpb=d768de9c003337cc1eeb4865a43662b0ec8dd6d4;p=app.Builder.js diff --git a/DependTree/Window.js b/DependTree/Window.js index 2a8850937..984b8b549 100644 --- a/DependTree/Window.js +++ b/DependTree/Window.js @@ -22,16 +22,20 @@ Window=new XObject({ var ls = this.get('method-list-store'); this.data.allmethods.forEach(function(v) { - ls.append( [ v ]); + ls.append( [ v , true, true ]); }); + var ls = this.get('children-list-store'); this.data.allchildren.forEach(function(v) { - ls.append( [ v ]); + ls.append( [ v , true, true ]); }); 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 , true]); }; + print(JSON.stringify(this.data.methods['Gtk.AccelGroup'])); @@ -39,6 +43,7 @@ Window=new XObject({ }, default_height : 500, default_width : 600, + id : "window", init : function() { XObject.prototype.init.call(this); this.el.show_all(); @@ -65,27 +70,90 @@ Window=new XObject({ items : [ { xtype: Gtk.TreeView, + listeners : { + cursor_changed : function (self) { + + var sel = this.el.get_selection(); + + + var iter = new Gtk.TreeIter(); + sel.get_selected(this.model.el, iter); + + var tp = this.model.el.get_path(iter).to_string(); + print(tp); + // + var cls = this.model.getValue(tp, 0); + print(cls); + var data = this.get('/window').data; + + + // hide all the rows in the methods list. + var tp = false; + var cstore = this.get('/window.children-list-store'); + var meths = []; + while (false !== (tp = cstore.nextPath(tp))) { + var mname = cstore.getValue(tp, 0); + var show = typeof(data.methods[cls][mname]) == 'undefined' ? false :true; + if (show) { + meths.push.apply(meths, data.methods[cls][mname]); + } + cstore.setValue(tp, 2, show); // hide.. + + + } + print(JSON.stringify(meths)); + + tp = false; + var mstore = this.get('/window.method-list-store'); + while (false !== (tp = mstore.nextPath(tp))) { + var mname = mstore.getValue(tp, 0); + var show = meths.indexOf(mname) > -1 ? true :false; + + mstore.setValue(tp, 2, show); // hide.. + } + + + + } + }, 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); + this.parent.model = 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 @@ -98,6 +166,22 @@ Window=new XObject({ 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 } ] @@ -113,17 +197,71 @@ 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_BOOLEAN, + GObject.TYPE_STRING, + GObject.TYPE_STRING, + GObject.TYPE_STRING + ] ); + + } + } + ] }, { 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 + } + ] } ] } @@ -136,17 +274,72 @@ Window=new XObject({ xtype: Gtk.TreeView, items : [ { - xtype: Gtk.ListStore, - id : "children-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 : "children-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 : "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 + } + ] } ] }