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

src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala

index 846e292..c341039 100644 (file)
@@ -11,7 +11,7 @@
    "int height_request" : 800,
    "id" : "ValaCompileErrors",
    "Xcls_MainWindow window" : "",
-   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        this.notices = tree;\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    this.el.set_size_request( int.max(100, w- 100), int.max(100, h-100));\n\n    \n    this.hpane.el.set_position(250);\n   if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n          \n\n}\n",
+   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        this.notices = tree;\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    var new_w = int.min(250+ 500, w-100);\n    new_w = int.max(new_w, w - 100);\n    \n    this.el.set_size_request( int.max(100, new_w), int.max(100, h-100));\n\n    \n    this.hpane.el.set_position(250);\n   if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n          \n\n}\n",
    "xtype" : "Popover",
    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
    "int width_request" : 900,
@@ -47,6 +47,7 @@
          "utf8 label" : "Edit"
         },
         {
+         "id" : "save_btn",
          "* pack" : "pack_start,true,true,0",
          "xtype" : "Button",
          "$ xns" : "Gtk",
index ffdc64f..3eb8a4f 100644 (file)
@@ -13,6 +13,7 @@ public class Xcls_ValaCompileErrors : Object
         return _ValaCompileErrors;
     }
     public Xcls_compile_view compile_view;
+    public Xcls_save_btn save_btn;
     public Xcls_hpane hpane;
     public Xcls_compile_tree compile_tree;
     public Xcls_compile_result_store compile_result_store;
@@ -89,7 +90,12 @@ public class Xcls_ValaCompileErrors : Object
             
         int w,h;
         this.window.el.get_size(out w, out h);
-        this.el.set_size_request( int.max(100, w- 100), int.max(100, h-100));
+        
+        // left tree = 250, editor area = 500?
+        var new_w = int.min(250+ 500, w-100);
+        new_w = int.max(new_w, w - 100);
+        
+        this.el.set_size_request( int.max(100, new_w), int.max(100, h-100));
     
         
         this.hpane.el.set_position(250);
@@ -151,7 +157,7 @@ public class Xcls_ValaCompileErrors : Object
             var child_1 = new Xcls_Button5( _this );
             child_1.ref();
             this.el.pack_start (  child_1.el , true,true,0 );
-            var child_2 = new Xcls_Button6( _this );
+            var child_2 = new Xcls_save_btn( _this );
             child_2.ref();
             this.el.pack_start (  child_2.el , true,true,0 );
         }
@@ -227,7 +233,7 @@ public class Xcls_ValaCompileErrors : Object
 
         // user defined functions 
     }
-    public class Xcls_Button6 : Object 
+    public class Xcls_save_btn : Object 
     {
         public Gtk.Button el;
         private Xcls_ValaCompileErrors  _this;
@@ -236,9 +242,10 @@ public class Xcls_ValaCompileErrors : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_Button6(Xcls_ValaCompileErrors _owner )
+        public Xcls_save_btn(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
+            _this.save_btn = this;
             this.el = new Gtk.Button();
 
             // my vars (dec)