src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 29 Apr 2015 13:32:47 +0000 (21:32 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 29 Apr 2015 13:32:47 +0000 (21:32 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index 6fe2bd7..53967a8 100644 (file)
@@ -20,7 +20,7 @@
    "xtype" : "VPaned",
    "# JsRender.JsRender file" : "null",
    "int height" : 0,
-   "| void compileNotice" : "( string  type,   string file,   int line,   string  message) {\n    // if type = \"START\"... then we reset the tree?\n    // the issue is that the compiler is continually going..\n    // so editing a file etc.. may change things.?\n    // probably not an issue.\n    print(\"err %s / %s:%d / %s\\n\", type,file,line,message);\n    var cs = _this.compile_result_store;    \n    if (type ==\"START\") {\n        // reset the tree;\n        cs.el.clear();   \n        cs.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);   \n        return;\n    }\n\n    \n    var top = 0;\n    var title = \"\";\n    switch(type) {\n        case \"ERR\":\n            title = \"Errors\";\n            top =0;\n            break;\n        \n        case \"WARN\":\n            title = \"Warnings\";\n            top =1;\n            break;\n            \n        case \"DEPR\":\n            title = \"Depricated\";\n            top=2;\n            break;\n        \n        default:\n            title = type;\n            top =3;\n            break;\n    }\n            \n    \n     var tv = cs.nodeFindOrCreate(null, top.to_string(), title);\n     var ftv = cs.nodeFindOrCreate(tv, \"%d:%s\".printf(top, file), GLib.Path.get_basename( file) );\n     \n      cs.nodeAppendOrCreate(ftv, \"%d:%s:%d\".printf(top, file,line), file,line, message);\n    \n}\n ",
+   "| void compileNotice" : "( string  type,   string file,   int line,   string  message) {\n    // if type = \"START\"... then we reset the tree?\n    // the issue is that the compiler is continually going..\n    // so editing a file etc.. may change things.?\n    // probably not an issue.\n    print(\"err %s / %s:%d / %s\\n\", type,file,line,message);\n    var cs = _this.compile_result_store;    \n    if (type ==\"START\") {\n        // reset the tree;\n        cs.el.clear();   \n        cs.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);   \n        return;\n    }\n\n    \n    var top = 0;\n    var title = \"\";\n    switch(type) {\n        case \"ERR\":\n            title = \"Errors\";\n            top =0;\n            break;\n        \n        case \"WARN\":\n            title = \"Warnings\";\n            top =1;\n            break;\n            \n        case \"DEPR\":\n            title = \"Depricated\";\n            top=2;\n            break;\n        \n        default:\n            title = type;\n            top =3;\n            break;\n    }\n            \n    \n     var tv = cs.nodeFindOrCreate(null, top.to_string(), title);\n     tv = cs.nodeFindOrCreate(tv, \"%d:%s\".printf(top, file), GLib.Path.get_basename( file) );\n      cs.nodeAppendOrCreate(tv, \"%d:%s:%d\".printf(top, file,line), file,line, message);\n    \n}\n ",
    "$ xns" : "Gtk",
    "items" : [
     {
@@ -76,6 +76,7 @@
          "$ xns" : "Gtk",
          "items" : [
           {
+           "id" : "compile_tree",
            "* pack" : "add",
            "xtype" : "TreeView",
            "$ xns" : "Gtk",
index 2cd1cd4..a71c244 100644 (file)
@@ -15,6 +15,7 @@ public class Xcls_GtkView : Object
     public Xcls_view_layout view_layout;
     public Xcls_container container;
     public Xcls_compile_view compile_view;
+    public Xcls_compile_tree compile_tree;
     public Xcls_compile_result_store compile_result_store;
     public Xcls_renderer renderer;
 
@@ -179,9 +180,8 @@ public class Xcls_GtkView : Object
                 
         
          var tv = cs.nodeFindOrCreate(null, top.to_string(), title);
-         var ftv = cs.nodeFindOrCreate(tv, "%d:%s".printf(top, file), GLib.Path.get_basename( file) );
-         
-          cs.nodeAppendOrCreate(ftv, "%d:%s:%d".printf(top, file,line), file,line, message);
+         tv = cs.nodeFindOrCreate(tv, "%d:%s".printf(top, file), GLib.Path.get_basename( file) );
+          cs.nodeAppendOrCreate(tv, "%d:%s:%d".printf(top, file,line), file,line, message);
         
     }
     public class Xcls_ScrolledWindow2 : Object 
@@ -373,7 +373,7 @@ public class Xcls_GtkView : Object
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_TreeView10( _this );
+            var child_0 = new Xcls_compile_tree( _this );
             child_0.ref();
             this.el.add (  child_0.el  );
 
@@ -388,7 +388,7 @@ public class Xcls_GtkView : Object
 
         // user defined functions 
     }
-    public class Xcls_TreeView10 : Object 
+    public class Xcls_compile_tree : Object 
     {
         public Gtk.TreeView el;
         private Xcls_GtkView  _this;
@@ -397,9 +397,10 @@ public class Xcls_GtkView : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_TreeView10(Xcls_GtkView _owner )
+        public Xcls_compile_tree(Xcls_GtkView _owner )
         {
             _this = _owner;
+            _this.compile_tree = this;
             this.el = new Gtk.TreeView();
 
             // my vars (dec)