src/Builder4/ValaCompileResults.bjs
[app.Builder.js] / src / Builder4 / ValaCompileResults.bjs
1 {
2  "name" : "ValaCompileResults",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/ValaCompileResults.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "",
9  "items" : [
10   {
11    "int height_request" : 800,
12    "id" : "ValaCompileResults",
13    "Xcls_MainWindow window" : "",
14    "| 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",
15    "xtype" : "Popover",
16    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
17    "bool active" : false,
18    "int width_request" : 900,
19    "$ xns" : "Gtk",
20    "JsRender.JsRender? file" : "",
21    "Json.Object notices" : "",
22    "bool modal" : true,
23    "items" : [
24     {
25      "id" : "compile_view",
26      "* pack" : "add",
27      "xtype" : "Box",
28      "gboolean homogeneous" : false,
29      "$ xns" : "Gtk",
30      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
31      "items" : [
32       {
33        "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
34        "* pack" : "pack_end,true,true,0",
35        "xtype" : "ScrolledWindow",
36        "$ xns" : "Gtk",
37        "items" : [
38         {
39          "xtype" : "SourceView",
40          "$ xns" : "Gtk"
41         }
42        ]
43       }
44      ]
45     }
46    ]
47   }
48  ]
49 }