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

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

index 7033c6f..9c24b5f 100644 (file)
@@ -9,7 +9,7 @@
  "items" : [
   {
    "int height_request" : 800,
-   "id" : "ValaCompileErrors",
+   "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",
      "$ xns" : "Gtk",
      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "items" : [
-      {
-       "xtype" : "Box",
-       "* pack" : "pack_start,false,false,0",
-       "$ xns" : "Gtk",
-       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-       "items" : [
-        {
-         "* pack" : "pack_start,true,true,0",
-         "xtype" : "Button",
-         "$ xns" : "Gtk",
-         "utf8 label" : "Compile and Run "
-        }
-       ]
-      },
       {
        "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
        "* pack" : "pack_end,true,true,0",
index ca26071..ff9b6e5 100644 (file)
@@ -1,16 +1,16 @@
-static Xcls_ValaCompileErrors  _ValaCompileErrors;
+static Xcls_ValaCompileResults  _ValaCompileResults;
 
-public class Xcls_ValaCompileErrors : Object
+public class Xcls_ValaCompileResults : Object
 {
     public Gtk.Popover el;
-    private Xcls_ValaCompileErrors  _this;
+    private Xcls_ValaCompileResults  _this;
 
-    public static Xcls_ValaCompileErrors singleton()
+    public static Xcls_ValaCompileResults singleton()
     {
-        if (_ValaCompileErrors == null) {
-            _ValaCompileErrors= new Xcls_ValaCompileErrors();
+        if (_ValaCompileResults == null) {
+            _ValaCompileResults= new Xcls_ValaCompileResults();
         }
-        return _ValaCompileErrors;
+        return _ValaCompileResults;
     }
     public Xcls_compile_view compile_view;
     public Xcls_compile_tree compile_tree;
@@ -24,7 +24,7 @@ public class Xcls_ValaCompileErrors : Object
     public Json.Object notices;
 
     // ctor
-    public Xcls_ValaCompileErrors()
+    public Xcls_ValaCompileResults()
     {
         _this = this;
         this.el = new Gtk.Popover( null );
@@ -117,13 +117,13 @@ public class Xcls_ValaCompileErrors : Object
     public class Xcls_compile_view : Object
     {
         public Gtk.Box el;
-        private Xcls_ValaCompileErrors  _this;
+        private Xcls_ValaCompileResults  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_compile_view(Xcls_ValaCompileErrors _owner )
+        public Xcls_compile_view(Xcls_ValaCompileResults _owner )
         {
             _this = _owner;
             _this.compile_view = this;
@@ -133,74 +133,23 @@ public class Xcls_ValaCompileErrors : Object
 
             // set gobject values
             this.el.homogeneous = false;
-            var child_0 = new Xcls_Box3( _this );
+            var child_0 = new Xcls_ScrolledWindow3( _this );
             child_0.ref();
-            this.el.pack_start (  child_0.el , false,false,0 );
-            var child_1 = new Xcls_ScrolledWindow5( _this );
-            child_1.ref();
-            this.el.pack_end (  child_1.el , true,true,0 );
-        }
-
-        // user defined functions
-    }
-    public class Xcls_Box3 : Object
-    {
-        public Gtk.Box el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-
-        // ctor
-        public Xcls_Box3(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
-
-            // my vars (dec)
-
-            // set gobject values
-            var child_0 = new Xcls_Button4( _this );
-            child_0.ref();
-            this.el.pack_start (  child_0.el , true,true,0 );
+            this.el.pack_end (  child_0.el , true,true,0 );
         }
 
         // user defined functions
     }
-    public class Xcls_Button4 : Object
-    {
-        public Gtk.Button el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-
-        // ctor
-        public Xcls_Button4(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Button();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.label = "Compile and Run ";
-        }
-
-        // user defined functions
-    }
-
-
-    public class Xcls_ScrolledWindow5 : Object
+    public class Xcls_ScrolledWindow3 : Object
     {
         public Gtk.ScrolledWindow el;
-        private Xcls_ValaCompileErrors  _this;
+        private Xcls_ValaCompileResults  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_ScrolledWindow5(Xcls_ValaCompileErrors _owner )
+        public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
         {
             _this = _owner;
             this.el = new Gtk.ScrolledWindow( null, null );
@@ -226,13 +175,13 @@ public class Xcls_ValaCompileErrors : Object
     public class Xcls_compile_tree : Object
     {
         public Gtk.TreeView el;
-        private Xcls_ValaCompileErrors  _this;
+        private Xcls_ValaCompileResults  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_compile_tree(Xcls_ValaCompileErrors _owner )
+        public Xcls_compile_tree(Xcls_ValaCompileResults _owner )
         {
             _this = _owner;
             _this.compile_tree = this;
@@ -329,13 +278,13 @@ public class Xcls_ValaCompileErrors : Object
     public class Xcls_compile_result_store : Object
     {
         public Gtk.TreeStore el;
-        private Xcls_ValaCompileErrors  _this;
+        private Xcls_ValaCompileResults  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_compile_result_store(Xcls_ValaCompileErrors _owner )
+        public Xcls_compile_result_store(Xcls_ValaCompileResults _owner )
         {
             _this = _owner;
             _this.compile_result_store = this;
@@ -352,13 +301,13 @@ public class Xcls_ValaCompileErrors : Object
     public class Xcls_column : Object
     {
         public Gtk.TreeViewColumn el;
-        private Xcls_ValaCompileErrors  _this;
+        private Xcls_ValaCompileResults  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_column(Xcls_ValaCompileErrors _owner )
+        public Xcls_column(Xcls_ValaCompileResults _owner )
         {
             _this = _owner;
             this.el = new Gtk.TreeViewColumn();
@@ -384,13 +333,13 @@ public class Xcls_ValaCompileErrors : Object
     public class Xcls_renderer : Object
     {
         public Gtk.CellRendererText el;
-        private Xcls_ValaCompileErrors  _this;
+        private Xcls_ValaCompileResults  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_renderer(Xcls_ValaCompileErrors _owner )
+        public Xcls_renderer(Xcls_ValaCompileResults _owner )
         {
             _this = _owner;
             _this.renderer = this;