public Xcls_MainWindow window;
public string activeEditor;
public int pos_root_x;
+ public JsRender.JsRender? file;
public int pos_root_y;
public string ptype;
public int last_search_end;
- public JsRender.JsRender? file;
public string key;
public Gtk.SourceSearchContext searchcontext;
public bool pos;
// my vars (dec)
this.window = null;
this.activeEditor = "";
+ this.file = null;
this.ptype = "";
this.last_search_end = 0;
- this.file = null;
this.key = "";
this.searchcontext = null;
this.pos = false;
"* pack" : "add",
"items" : [
{
- "$ columns" : "typeof(string),typeof(string)",
+ "$ columns" : "typeof(string),typeof(string),typeof(Gdk.Pixbuf)",
"$ xns" : "Gtk",
"* pack" : "set_model",
"id" : "model",
- "n_columns" : 2,
+ "n_columns" : 3,
"xtype" : "ListStore",
"| string getValue" : [
" (Gtk.TreeIter iter, int col) {",
{
"$ xns" : "Gtk",
"* init" : [
- " this.el.add_attribute(_this.txtrender.el , \"markup\", 1 );",
- " ",
+ "this.el.add_attribute(_this.txtrender.el , \"markup\", 1 );",
+ "this.el.add_attribute(_this.iconrender.el , \"pixbuf\", 2 );",
""
],
"* pack" : "append_column",
"items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "pack_start,true",
+ "id" : "iconrender",
+ "xtype" : "CellRendererPixbuf"
+ },
{
"$ xns" : "Gtk",
"* pack" : "pack_start,true",
"",
"",
" Gtk.TreeIter citer;",
+ " var ic = Gtk.IconTheme.get_default();",
+ "\tvar pixdef = ic.load_icon(\"emblem-new\", 16,0);",
"",
" for(var i =0 ; i < tr.length; i++) {",
" this.model.el.append(out citer); ",
" var dname = tr[i];",
+ " var clsname = dname;",
" if (dname.contains(\":\")) {",
"\t\t\tvar ar = dname.split(\":\");",
"\t\t\tdname = \"<b>\" + ar[1] +\"</b> - <i>\"+ar[0]+\"</i>\";",
+ "\t\t\tclsname = ar[0]; /// possibly?",
"\t\t}",
" ",
" this.model.el.set_value(citer, 0, tr[i] ); // used data. ",
" this.model.el.set_value(citer, 1, dname ); // displayed value.",
" ",
+ " var clsb = clsname.split(\".\");",
+ " var sub = clsb.length > 1 ? clsb[1].down() : \"\";",
+ " ",
+ " var pix = pixdef;",
+ " var fn = \"/usr/share/glade/pixmaps/hicolor/16x16/actions/widget-gtk-\" + sub + \".png\";",
+ " if (FileUtils.test (fn, FileTest.IS_REGULAR)) {",
+ "\t pix = new Gdk.Pixbuf.from_file (fn);",
+ " }",
+ " ",
+ " ",
+ " this.model.el.set_value(citer, 2, pix );",
+ " ",
+ " ",
" }",
" this.model.el.set_sort_column_id(1,Gtk.SortType.ASCENDING);",
" ",
return _PopoverAddObject;
}
public Xcls_model model;
+ public Xcls_iconrender iconrender;
public Xcls_txtrender txtrender;
// my vars (def)
Gtk.TreeIter citer;
+ var ic = Gtk.IconTheme.get_default();
+ var pixdef = ic.load_icon("emblem-new", 16,0);
for(var i =0 ; i < tr.length; i++) {
this.model.el.append(out citer);
var dname = tr[i];
+ var clsname = dname;
if (dname.contains(":")) {
var ar = dname.split(":");
dname = "<b>" + ar[1] +"</b> - <i>"+ar[0]+"</i>";
+ clsname = ar[0]; /// possibly?
}
this.model.el.set_value(citer, 0, tr[i] ); // used data.
this.model.el.set_value(citer, 1, dname ); // displayed value.
+ var clsb = clsname.split(".");
+ var sub = clsb.length > 1 ? clsb[1].down() : "";
+
+ var pix = pixdef;
+ var fn = "/usr/share/glade/pixmaps/hicolor/16x16/actions/widget-gtk-" + sub + ".png";
+ if (FileUtils.test (fn, FileTest.IS_REGULAR)) {
+ pix = new Gdk.Pixbuf.from_file (fn);
+ }
+
+
+ this.model.el.set_value(citer, 2, pix );
+
+
}
this.model.el.set_sort_column_id(1,Gtk.SortType.ASCENDING);
{
_this = _owner;
_this.model = this;
- this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
+ this.el = new Gtk.ListStore( 3, typeof(string),typeof(string),typeof(Gdk.Pixbuf) );
// my vars (dec)
// set gobject values
this.el.title = "Drag to add Object";
- var child_0 = new Xcls_txtrender( _this );
+ var child_0 = new Xcls_iconrender( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true );
+ var child_1 = new Xcls_txtrender( _this );
+ child_1.ref();
+ this.el.pack_start ( child_1.el , true );
// init method
this.el.add_attribute(_this.txtrender.el , "markup", 1 );
+ this.el.add_attribute(_this.iconrender.el , "pixbuf", 2 );
}
// user defined functions
}
+ public class Xcls_iconrender : Object
+ {
+ public Gtk.CellRendererPixbuf el;
+ private Xcls_PopoverAddObject _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_iconrender(Xcls_PopoverAddObject _owner )
+ {
+ _this = _owner;
+ _this.iconrender = this;
+ this.el = new Gtk.CellRendererPixbuf();
+
+ // my vars (dec)
+
+ // set gobject values
+ }
+
+ // user defined functions
+ }
+
public class Xcls_txtrender : Object
{
public Gtk.CellRendererText el;
{
"# DialogTemplateSelect template_select" : "null",
"# string activePath" : "\"\"",
- "$ columns" : "typeof(string),typeof(string),typeof(Object)",
+ "$ columns" : "typeof(string),typeof(string),typeof(Object),typeof(Gdk.Pixbuf)",
"$ listAllTypes" : [
"function() {",
" var s = this.get('/LeftTree.view').selection;",
"* pack" : "set_model",
"currentTree" : false,
"id" : "model",
- "n_columns" : 3,
+ "n_columns" : 4,
"xtype" : "TreeStore",
"| JsRender.Node pathToNode" : [
"(string path) {",
"{",
" Gtk.TreeIter citer;",
" //this.insert(citer,iter,0);",
+ " var ic = Gtk.IconTheme.get_default();",
+ " var pixdef = ic.load_icon(\"emblem-new\", 16,0);",
+ " ",
" for(var i =0 ; i < tr.size; i++) {",
" if (iter != null) {",
" this.el.insert(out citer,iter,-1); // why not append?",
" ",
" this.el.set_value(citer, 2, o);",
" ",
+ " var clsname = tr.get(i).fqn();",
+ " ",
+ " var clsb = clsname.split(\".\");",
+ " var sub = clsb.length > 1 ? clsb[1].down() : \"\";",
+ " ",
+ " var pix = pixdef;",
+ " var fn = \"/usr/share/glade/pixmaps/hicolor/16x16/actions/widget-gtk-\" + sub + \".png\";",
+ " if (FileUtils.test (fn, FileTest.IS_REGULAR)) {",
+ "\t pix = new Gdk.Pixbuf.from_file (fn);",
+ " }",
+ " ",
+ " ",
+ " this.el.set_value(citer, 3, pix );",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
" if (tr.get(i).items.size > 0) {",
" this.load(tr.get(i).items, citer);",
" }",
"$ xns" : "Gtk",
"* init" : [
" this.el.add_attribute(_this.renderer.el , \"markup\", 0 );",
+ " this.el.add_attribute(_this.iconrender.el , \"pixbuf\", 3 );",
" "
],
"* pack" : "append_column",
"items" : [
+ {
+ "$ xns" : "Gtk",
+ "* pack" : "pack_start,true",
+ "id" : "iconrender",
+ "xtype" : "CellRendererPixbuf"
+ },
{
"$ xns" : "Gtk",
"* pack" : "pack_start,true",
}
public Xcls_view view;
public Xcls_model model;
+ public Xcls_iconrender iconrender;
public Xcls_renderer renderer;
public Xcls_LeftTreeMenu LeftTreeMenu;
{
_this = _owner;
_this.model = this;
- this.el = new Gtk.TreeStore( 3, typeof(string),typeof(string),typeof(Object) );
+ this.el = new Gtk.TreeStore( 4, typeof(string),typeof(string),typeof(Object),typeof(Gdk.Pixbuf) );
// my vars (dec)
this.template_select = null;
{
Gtk.TreeIter citer;
//this.insert(citer,iter,0);
+ var ic = Gtk.IconTheme.get_default();
+ var pixdef = ic.load_icon("emblem-new", 16,0);
+
for(var i =0 ; i < tr.size; i++) {
if (iter != null) {
this.el.insert(out citer,iter,-1); // why not append?
this.el.set_value(citer, 2, o);
+ var clsname = tr.get(i).fqn();
+
+ var clsb = clsname.split(".");
+ var sub = clsb.length > 1 ? clsb[1].down() : "";
+
+ var pix = pixdef;
+ var fn = "/usr/share/glade/pixmaps/hicolor/16x16/actions/widget-gtk-" + sub + ".png";
+ if (FileUtils.test (fn, FileTest.IS_REGULAR)) {
+ pix = new Gdk.Pixbuf.from_file (fn);
+ }
+
+
+ this.el.set_value(citer, 3, pix );
+
+
+
+
+
if (tr.get(i).items.size > 0) {
this.load(tr.get(i).items, citer);
}
// set gobject values
this.el.title = "test";
- var child_0 = new Xcls_renderer( _this );
+ var child_0 = new Xcls_iconrender( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true );
+ var child_1 = new Xcls_renderer( _this );
+ child_1.ref();
+ this.el.pack_start ( child_1.el , true );
// init method
this.el.add_attribute(_this.renderer.el , "markup", 0 );
+ this.el.add_attribute(_this.iconrender.el , "pixbuf", 3 );
+ }
+
+ // user defined functions
+ }
+ public class Xcls_iconrender : Object
+ {
+ public Gtk.CellRendererPixbuf el;
+ private Xcls_WindowLeftTree _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_iconrender(Xcls_WindowLeftTree _owner )
+ {
+ _this = _owner;
+ _this.iconrender = this;
+ this.el = new Gtk.CellRendererPixbuf();
+
+ // my vars (dec)
+
+ // set gobject values
}
// user defined functions
}
+
public class Xcls_renderer : Object
{
public Gtk.CellRendererText el;
// my vars (dec)
// set gobject values
- var child_0 = new Xcls_MenuItem10( _this );
+ var child_0 = new Xcls_MenuItem11( _this );
child_0.ref();
this.el.add ( child_0.el );
- var child_1 = new Xcls_MenuItem11( _this );
+ var child_1 = new Xcls_MenuItem12( _this );
child_1.ref();
this.el.add ( child_1.el );
- var child_2 = new Xcls_MenuItem12( _this );
+ var child_2 = new Xcls_MenuItem13( _this );
child_2.ref();
this.el.add ( child_2.el );
}
// user defined functions
}
- public class Xcls_MenuItem10 : Object
+ public class Xcls_MenuItem11 : Object
{
public Gtk.MenuItem el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_MenuItem10(Xcls_WindowLeftTree _owner )
+ public Xcls_MenuItem11(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem11 : Object
+ public class Xcls_MenuItem12 : Object
{
public Gtk.MenuItem el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_MenuItem11(Xcls_WindowLeftTree _owner )
+ public Xcls_MenuItem12(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();
// user defined functions
}
- public class Xcls_MenuItem12 : Object
+ public class Xcls_MenuItem13 : Object
{
public Gtk.MenuItem el;
private Xcls_WindowLeftTree _this;
// my vars (def)
// ctor
- public Xcls_MenuItem12(Xcls_WindowLeftTree _owner )
+ public Xcls_MenuItem13(Xcls_WindowLeftTree _owner )
{
_this = _owner;
this.el = new Gtk.MenuItem();