src/Builder4/config1.builder
[app.Builder.js] / src / Builder4 / ValaCompileErrors.vala
index c9b99c1..7989b43 100644 (file)
@@ -35,20 +35,12 @@ public class Xcls_ValaCompileErrors : Object
         // set gobject values
         this.el.width_request = 900;
         this.el.height_request = 800;
-        this.el.modal = false;
+        this.el.hexpand = false;
+        this.el.modal = true;
         this.el.position = Gtk.PositionType.TOP;
         var child_0 = new Xcls_compile_view( _this );
         child_0.ref();
         this.el.add (  child_0.el  );
-
-        //listeners
-        this.el.closed.connect( () => {
-          /*  if (this.active) {
-                this.el.show();
-                return;
-            }
-           */
-        });
     }
 
     // user defined functions
@@ -76,7 +68,7 @@ public class Xcls_ValaCompileErrors : Object
                 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);
+                store.set(iter, 0, file, 1, -1, 2, title, 3, file,-1);
                 
                 lines.foreach_member((obja, line, nodea) => {
                     var msg  = "";
@@ -125,7 +117,7 @@ public class Xcls_ValaCompileErrors : Object
     }
     public class Xcls_compile_view : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_ValaCompileErrors  _this;
 
 
@@ -136,34 +128,36 @@ public class Xcls_ValaCompileErrors : Object
         {
             _this = _owner;
             _this.compile_view = this;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_HBox3( _this );
+            this.el.homogeneous = false;
+            this.el.hexpand = false;
+            var child_0 = new Xcls_Box3( _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.add (  child_1.el  );
+            this.el.pack_end (  child_1.el , true,true,0 );
         }
 
         // user defined functions
     }
-    public class Xcls_HBox3 : Object
+    public class Xcls_Box3 : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Xcls_ValaCompileErrors  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_HBox3(Xcls_ValaCompileErrors _owner )
+        public Xcls_Box3(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
@@ -261,37 +255,36 @@ public class Xcls_ValaCompileErrors : Object
             {
              var description = new Pango.FontDescription();
                 description.set_size(8000);
-                this.el.modify_font(description);
+                this.el.override_font(description);
             
             }
 
             //listeners
-            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  ;
-                }
+            this.el.button_press_event.connect( ( ev)  => {
+             
+                Gtk.TreeViewColumn col;
+                int cell_x;
+                int cell_y;
+                Gtk.TreePath path;
+                if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {
+                    print("nothing selected on click");
                     
-                    //console.log('changed');
-                 
-                 Gtk.TreeIter iter;
-                 Gtk.TreeModel mod;
-                sel.get_selected(out mod, out iter);
-                /*
-                 store.set(citer, 
-                        0, file + ":" + line, 
-                        1, int.parse(line), 
-                        2, GLib.Markup.escape_text(line + ": " + msg), 
-                        3, file,-1);
-                
-                });
-                */
+                    return false; //not on a element.
+                }
                 
+                 
+                 // right click.
+                 if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    
+                    // show popup!.   
+                        
+                     
+                    return false;
+                }
+                Gtk.TreeIter iter;
+                 var mod = _this.compile_result_store.el;
+                mod.get_iter (out iter, path);
                 
+                  
                 
                 // var val = "";
                 GLib.Value value;
@@ -301,19 +294,38 @@ public class Xcls_ValaCompileErrors : Object
                 _this.compile_result_store.el.get_value(iter, 1, out lvalue);
                 var line = (int) lvalue;
                 
+                print("open %s @ %d\n", fname, line);
                 
                 
-             
+               var  bjsf = "";
+                try {             
+                   var  regex = new Regex("\\.vala$");
                 
+                 
+                    bjsf = regex.replace(fname,fname.length , 0 , ".bjs");
+                 } catch (GLib.RegexError e) {
+                    return false;
+                }   
+                var p = _this.window.project;
+                    
+                    
+                    
+                var jsr = p.getByPath(bjsf);
+                if (jsr != null) {
+                    _this.window.windowstate.fileViewOpen(jsr, line);
+                    
+                    return false;
                 
-                print ("loadfile %s : %d", fname,line);
+                }
                 
-               // _this.sourceview.loadFile(fname, line);
+                var pf = JsRender.JsRender.factory("PlainFile", p, fname);
+                _this.window.windowstate.fileViewOpen(pf,line);
                 
+                // try hiding the left nav..
+             
+                return false;
                 
-                        
-                        
-            });
+              });
         }
 
         // user defined functions