src/Builder4/ValaCompileResults.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 28 May 2015 08:21:36 +0000 (16:21 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 28 May 2015 08:21:36 +0000 (16:21 +0800)
src/Builder4/ValaCompileResults.vala

src/Builder4/ValaCompileResults.bjs
src/Builder4/ValaCompileResults.vala

index 4210888..3114b0a 100644 (file)
    "int height_request" : 800,
    "id" : "ValaCompileResults",
    "Xcls_MainWindow window" : "",
-   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        \n        this.file = null;\n        this.notices = tree;\n       \n         //print(\"looking for %s\\n\", id);\n        // loop through parent childnre\n          \n        \n        var store = this.compile_result_store.el;    \n        \n        store.clear();\n     \n        \n        tree.foreach_member((obj, file, node) => {\n            // id line \"display text\", file\n            \n            var title = GLib.Path.get_basename(GLib.Path.get_dirname( file)) + \"/\" +  GLib.Path.get_basename( file) ;\n            Gtk.TreeIter iter;\n            print(\"Add file %s\", title);\n            store.append(out iter, null);\n            var lines = tree.get_object_member(file);\n            title += \" (\" + lines.get_size().to_string() + \")\";\n            store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);\n            \n            lines.foreach_member((obja, line, nodea) => {\n                var msg  = \"\";\n                var ar = lines.get_array_member(line);\n                for (var i = 0 ; i < ar.get_length(); i++) {\n    \t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n    \t\t    msg += ar.get_string_element(i);\n\t        }\n                Gtk.TreeIter citer;  \n                print(\"Add line %s\", line);\n                store.append(out citer, iter);\n                store.set(citer, \n                    0, file + \":\" + line, \n                    1, int.parse(line), \n                    2, GLib.Markup.escape_text(line + \": \" + msg), \n                    3, file,-1);\n            \n            });\n            \n            \n        \n        });\n        \n    int w,h;\n    this.window.el.get_size(out w, out h);\n    \n    // left tree = 250, editor area = 500?\n    \n    var new_w = int.min(250, w-100);\n    if (new_w > (w-100)) {\n        new_w = w-100;\n    }\n    this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));\n\n    \n\n    if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n   \n    while(Gtk.events_pending()) { \n            Gtk.main_iteration();\n    }       \n //   this.hpane.el.set_position( 0);\n}\n",
    "xtype" : "Popover",
    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
    "bool active" : false,
    "int width_request" : 900,
    "$ xns" : "Gtk",
-   "JsRender.JsRender? file" : "",
    "Json.Object notices" : "",
    "bool modal" : true,
    "items" : [
index c51dd35..9747cfb 100644 (file)
@@ -17,7 +17,6 @@ public class Xcls_ValaCompileResults : Object
         // my vars (def)
     public Xcls_MainWindow window;
     public bool active;
-    public JsRender.JsRender? file;
     public Json.Object notices;
 
     // ctor
@@ -40,77 +39,6 @@ public class Xcls_ValaCompileResults : Object
     }
 
     // user defined functions
-    public void show (Json.Object tree, Gtk.Widget onbtn) {
-    
-            
-            this.file = null;
-            this.notices = tree;
-           
-             //print("looking for %s\n", id);
-            // loop through parent childnre
-              
-            
-            var store = this.compile_result_store.el;    
-            
-            store.clear();
-         
-            
-            tree.foreach_member((obj, file, node) => {
-                // id line "display text", file
-                
-                var title = GLib.Path.get_basename(GLib.Path.get_dirname( file)) + "/" +  GLib.Path.get_basename( file) ;
-                Gtk.TreeIter iter;
-                print("Add file %s", title);
-                store.append(out iter, null);
-                var lines = tree.get_object_member(file);
-                title += " (" + lines.get_size().to_string() + ")";
-                store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);
-                
-                lines.foreach_member((obja, line, nodea) => {
-                    var msg  = "";
-                    var ar = lines.get_array_member(line);
-                    for (var i = 0 ; i < ar.get_length(); i++) {
-                           msg += (msg.length > 0) ? "\n" : "";
-                           msg += ar.get_string_element(i);
-               }
-                    Gtk.TreeIter citer;  
-                    print("Add line %s", line);
-                    store.append(out citer, iter);
-                    store.set(citer, 
-                        0, file + ":" + line, 
-                        1, int.parse(line), 
-                        2, GLib.Markup.escape_text(line + ": " + msg), 
-                        3, file,-1);
-                
-                });
-                
-                
-            
-            });
-            
-        int w,h;
-        this.window.el.get_size(out w, out h);
-        
-        // left tree = 250, editor area = 500?
-        
-        var new_w = int.min(250, w-100);
-        if (new_w > (w-100)) {
-            new_w = w-100;
-        }
-        this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
-    
-        
-    
-        if (this.el.relative_to == null) {
-            this.el.set_relative_to(onbtn);
-        }
-        this.el.show_all();
-       
-        while(Gtk.events_pending()) { 
-                Gtk.main_iteration();
-        }       
-     //   this.hpane.el.set_position( 0);
-    }
     public class Xcls_compile_view : Object
     {
         public Gtk.Box el;