src/Builder4/ValaCompileErrors.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 20 May 2015 05:57:09 +0000 (13:57 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 20 May 2015 05:57:09 +0000 (13:57 +0800)
src/Builder4/ValaCompileErrors.vala

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

index 68f5b39..b8ed2c7 100644 (file)
@@ -26,8 +26,8 @@
    "items" : [
     {
      "id" : "compile_view",
-     "xtype" : "VBox",
      "* pack" : "add",
+     "xtype" : "VBox",
      "gboolean homogeneous" : false,
      "$ xns" : "Gtk",
      "items" : [
       },
       {
        "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
-       "xtype" : "ScrolledWindow",
        "* pack" : "add",
+       "xtype" : "ScrolledWindow",
        "$ xns" : "Gtk",
        "items" : [
         {
          "listeners" : {
-          "button_press_event" : "  ( ev)  => {\n \n    Gtk.TreeViewColumn col;\n    int cell_x;\n    int cell_y;\n    Gtk.TreePath path;\n    if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n        print(\"nothing selected on click\");\n        \n        return false; //not on a element.\n    }\n    \n     \n     // right click.\n     if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    \n        // show popup!.   \n            \n         \n        return false;\n    }\n    Gtk.TreeIter iter;\n     var mod = _this.compile_result_store.el;\n    mod.get_iter (out iter, path);\n    \n     \n    \n    \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    //GLib.Value lvalue;\n    //_this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    //var line = (int) lvalue;\n    \n    \n   var  bjsf = \"\";\n    try {             \n       var  regex = new Regex(\"\\\\.vala$\");\n    \n     \n        bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");\n     } catch (GLib.RegexError e) {\n        return false;\n    }   \n    var p = _this.window.project;\n        \n        \n        \n    var jsr = p.getByPath(bjsf);\n    if (jsr != null) {\n        _this.window.windowstate.fileViewOpen(jsr);\n        \n        return false;\n    \n    }\n     return false;\n    \n  }\n    ",
-          "cursor_changed" : "() => {\n    var sel = this.el.get_selection();\n\n    if (sel.count_selected_rows() < 1) {\n\n        print(\"selected rows < 1\\n\");\n        //??this.mo \n        return  ;\n    }\n        \n        //console.log('changed');\n     \n     Gtk.TreeIter iter;\n     Gtk.TreeModel mod;\n    sel.get_selected(out mod, out iter);\n     \n    \n    \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    GLib.Value lvalue;\n    _this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    var line = (int) lvalue;\n    \n    \n    \n \n    \n    \n    print (\"loadfile %s : %d\", fname,line);\n    \n   // _this.sourceview.loadFile(fname, line);\n    /*\n        var f = _this.sourceview.curfname;\n                \n        Regex regex = new Regex(\"\\\\.vala$\");\n    \n        var bjsf = regex.replace(f,f.length , 0 , \".bjs\");\n        \n        var p = _this.window.project;\n        \n        \n        \n        var jsr = p.getByPath(bjsf);\n        if (jsr != null) {\n            _this.window.windowstate.fileViewOpen(jsr);\n            \n            return;\n        \n        }\n         */   \n            \n}\n             "
+          "button_press_event" : "  ( ev)  => {\n \n    Gtk.TreeViewColumn col;\n    int cell_x;\n    int cell_y;\n    Gtk.TreePath path;\n    if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n        print(\"nothing selected on click\");\n        \n        return false; //not on a element.\n    }\n    \n     \n     // right click.\n     if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    \n        // show popup!.   \n            \n         \n        return false;\n    }\n    Gtk.TreeIter iter;\n     var mod = _this.compile_result_store.el;\n    mod.get_iter (out iter, path);\n    \n     \n    \n    \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    //GLib.Value lvalue;\n    //_this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    //var line = (int) lvalue;\n    \n    \n   var  bjsf = \"\";\n    try {             \n       var  regex = new Regex(\"\\\\.vala$\");\n    \n     \n        bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");\n     } catch (GLib.RegexError e) {\n        return false;\n    }   \n    var p = _this.window.project;\n        \n        \n        \n    var jsr = p.getByPath(bjsf);\n    if (jsr != null) {\n        _this.window.windowstate.fileViewOpen(jsr);\n        \n        return false;\n    \n    }\n     return false;\n    \n  }\n    "
          },
          "id" : "compile_tree",
          "* init" : "{\n var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.modify_font(description);\n\n}\n",
@@ -79,8 +78,8 @@
            "items" : [
             {
              "id" : "renderer",
-             "* pack" : "pack_start,true",
              "xtype" : "CellRendererText",
+             "* pack" : "pack_start,true",
              "$ xns" : "Gtk"
             }
            ]
index a1bb917..87bd00a 100644 (file)
@@ -326,62 +326,6 @@ public class Xcls_ValaCompileErrors : Object
                  return false;
                 
               });
-            this.el.cursor_changed.connect( () => {
-                var sel = this.el.get_selection();
-            
-                if (sel.count_selected_rows() < 1) {
-            
-                    print("selected rows < 1\n");
-                    //??this.mo 
-                    return  ;
-                }
-                    
-                    //console.log('changed');
-                 
-                 Gtk.TreeIter iter;
-                 Gtk.TreeModel mod;
-                sel.get_selected(out mod, out iter);
-                 
-                
-                
-                
-                // var val = "";
-                GLib.Value value;
-                _this.compile_result_store.el.get_value(iter, 3, out value);
-                var fname = (string)value;
-                GLib.Value lvalue;
-                _this.compile_result_store.el.get_value(iter, 1, out lvalue);
-                var line = (int) lvalue;
-                
-                
-                
-             
-                
-                
-                print ("loadfile %s : %d", fname,line);
-                
-               // _this.sourceview.loadFile(fname, line);
-                /*
-                    var f = _this.sourceview.curfname;
-                            
-                    Regex regex = new Regex("\\.vala$");
-                
-                    var bjsf = regex.replace(f,f.length , 0 , ".bjs");
-                    
-                    var p = _this.window.project;
-                    
-                    
-                    
-                    var jsr = p.getByPath(bjsf);
-                    if (jsr != null) {
-                        _this.window.windowstate.fileViewOpen(jsr);
-                        
-                        return;
-                    
-                    }
-                     */   
-                        
-            });
         }
 
         // user defined functions