1 static Xcls_WindowAddProp _WindowAddProp;
3 public class Xcls_WindowAddProp : Object
5 public Gtk.ScrolledWindow el;
6 private Xcls_WindowAddProp _this;
8 public static Xcls_WindowAddProp singleton()
10 if (_WindowAddProp == null) {
11 _WindowAddProp= new Xcls_WindowAddProp();
13 return _WindowAddProp;
15 public Xcls_model model;
16 public Xcls_namecol namecol;
17 public Xcls_namerender namerender;
20 public signal void select (string key, string type, string skel, string etype);
23 public Xcls_WindowAddProp()
26 this.el = new Gtk.ScrolledWindow( null, null );
31 this.el.shadow_type = Gtk.ShadowType.IN;
32 var child_0 = new Xcls_TreeView2( _this );
34 this.el.add ( child_0.el );
38 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
41 // user defined functions
42 public void show (Palete.Palete pal, string etype, string xtype) {
43 this.model.el.clear();
46 var elementList = pal.getPropertiesFor( xtype,etype);
49 //print ("GOT " + elementList.length + " items for " + fullpath + "|" + type);
50 // console.dump(elementList);
52 var miter = elementList.map_iterator();
53 while (miter.next()) {
54 var p = miter.get_value();
56 this.model.el.append(out iter);
58 this.model.el.set(iter,
61 2, "<b>" + p.name +"</b> <i>"+p.type+"</i>\n" +
62 GLib.Markup.escape_text(p.doctxt),
64 4, "<b>" + p.name +"</b> <span size=\"small\"><i>"+p.type+"</i></span>",
69 this.model.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
72 public void clear () {
73 this.model.el.clear();
76 public class Xcls_TreeView2 : Object
78 public Gtk.TreeView el;
79 private Xcls_WindowAddProp _this;
85 public Xcls_TreeView2(Xcls_WindowAddProp _owner )
88 this.el = new Gtk.TreeView();
93 this.el.tooltip_column = 2;
94 this.el.enable_tree_lines = true;
95 this.el.headers_visible = true;
96 var child_0 = new Xcls_model( _this );
98 this.el.set_model ( child_0.el );
99 var child_1 = new Xcls_namecol( _this );
101 this.el.append_column ( child_1.el );
106 var description = new Pango.FontDescription();
107 description.set_size(8000);
108 this.el.override_font(description);
110 this.el.get_selection().set_mode( Gtk.SelectionMode.SINGLE);
119 this.el.row_activated.connect( (path, column) => {
126 m.el.get_iter(out iter,path);
132 var key = m.getValue(iter, 0);
134 var type = m.getValue(iter, 1);
135 var skel = m.getValue(iter, 3);
136 var etype = m.getValue(iter, 5);
139 _this.select(key,etype == "signals" ? "" : type,skel, etype);
144 // user defined functions
146 public class Xcls_model : Object
148 public Gtk.ListStore el;
149 private Xcls_WindowAddProp _this;
155 public Xcls_model(Xcls_WindowAddProp _owner )
159 this.el = new Gtk.ListStore( 6, typeof(string), // 0 real key
160 typeof(string), // 1 real type
161 typeof(string), // 2 docs ?
162 typeof(string), // 3 visable desc
163 typeof(string), // 4 function desc
164 typeof(string) // 5 element type (event|prop)
169 // set gobject values
172 // user defined functions
173 public string getValue (Gtk.TreeIter iter, int col)
177 this.el.get_value(iter, col, out value);
179 return (string)value;
183 public class Xcls_namecol : Object
185 public Gtk.TreeViewColumn el;
186 private Xcls_WindowAddProp _this;
192 public Xcls_namecol(Xcls_WindowAddProp _owner )
195 _this.namecol = this;
196 this.el = new Gtk.TreeViewColumn();
200 // set gobject values
201 this.el.title = "Double click to add";
202 var child_0 = new Xcls_namerender( _this );
204 this.el.pack_start ( child_0.el , true );
208 this.el.add_attribute(_this.namerender.el , "markup", 4 );
211 // user defined functions
213 public class Xcls_namerender : Object
215 public Gtk.CellRendererText el;
216 private Xcls_WindowAddProp _this;
222 public Xcls_namerender(Xcls_WindowAddProp _owner )
225 _this.namerender = this;
226 this.el = new Gtk.CellRendererText();
230 // set gobject values
233 // user defined functions