change property type dialog to use dropdown (has bug with popover autohide, but added...
[roobuilder] / src / Builder4 / WindowLeftTree.vala
index 04c747e..322f5ff 100644 (file)
@@ -41,7 +41,7 @@ public class Xcls_WindowLeftTree : Object
                // set gobject values
                this.el.hexpand = true;
                this.el.vexpand = true;
-               var child_1 = new Xcls_ListView2( _this );
+               var child_1 = new Xcls_ListView1( _this );
                child_1.ref();
                this.el.append( child_1.el );
                new Xcls_viewwin( _this );
@@ -51,8 +51,12 @@ public class Xcls_WindowLeftTree : Object
        // user defined functions
        public void updateErrors () {
                var file = this.getActiveFile();
+               if (file == null) {
+                       return;
+               }
+               
                var ar = file.getErrors();
-                       if (ar.size < 1) {
+               if (ar == null || ar.size < 1) {
                        if (this.last_error_counter != file.error_counter) {
                                this.removeErrors();
                        }
@@ -128,7 +132,7 @@ public class Xcls_WindowLeftTree : Object
                         
                                
                                reading_header = false;
-                                
+                                continue;
                    }
                    
                        if (child.has_css_class("node-err")) {
@@ -157,7 +161,7 @@ public class Xcls_WindowLeftTree : Object
        public JsRender.JsRender getActiveFile () {
            return this.main_window.windowstate.file;
        }
-       public class Xcls_ListView2 : Object
+       public class Xcls_ListView1 : Object
        {
                public Gtk.ListView el;
                private Xcls_WindowLeftTree  _this;
@@ -166,10 +170,10 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_ListView2(Xcls_WindowLeftTree _owner )
+               public Xcls_ListView1(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_SignalListItemFactory3( _this );
+                       var child_1 = new Xcls_SignalListItemFactory2( _this );
                        child_1.ref();
                        this.el = new Gtk.ListView( null, child_1.el );
 
@@ -180,7 +184,7 @@ public class Xcls_WindowLeftTree : Object
 
                // user defined functions
        }
-       public class Xcls_SignalListItemFactory3 : Object
+       public class Xcls_SignalListItemFactory2 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_WindowLeftTree  _this;
@@ -189,7 +193,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SignalListItemFactory3(Xcls_WindowLeftTree _owner )
+               public Xcls_SignalListItemFactory2(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.SignalListItemFactory();
@@ -266,16 +270,16 @@ public class Xcls_WindowLeftTree : Object
                        this.el.name = "left-tree-view";
                        this.el.hexpand = false;
                        this.el.vexpand = true;
-                       var child_2 = new Xcls_GestureClick6( _this );
+                       var child_2 = new Xcls_GestureClick5( _this );
                        child_2.ref();
                        this.el.add_controller(  child_2.el );
-                       var child_3 = new Xcls_GestureClick7( _this );
+                       var child_3 = new Xcls_GestureClick6( _this );
                        child_3.ref();
                        this.el.add_controller(  child_3.el );
-                       var child_4 = new Xcls_DragSource8( _this );
+                       var child_4 = new Xcls_DragSource7( _this );
                        child_4.ref();
                        this.el.add_controller(  child_4.el );
-                       var child_5 = new Xcls_EventControllerKey9( _this );
+                       var child_5 = new Xcls_EventControllerKey8( _this );
                        child_5.ref();
                        this.el.add_controller(  child_5.el );
                        new Xcls_keystate( _this );
@@ -284,7 +288,7 @@ public class Xcls_WindowLeftTree : Object
                        this.el.add_controller(  _this.drop.el );
                        new Xcls_maincol( _this );
                        this.el.append_column ( _this.maincol.el  );
-                       var child_9 = new Xcls_ColumnViewColumn16( _this );
+                       var child_9 = new Xcls_ColumnViewColumn15( _this );
                        child_9.ref();
                        this.el.append_column ( child_9.el  );
 
@@ -368,7 +372,7 @@ public class Xcls_WindowLeftTree : Object
                        var reading_header = true;
                         
                        while (child != null) {
-                                       GLib.debug("Got %s", child.get_type().name());
+                                       //GLib.debug("Got %s", child.get_type().name());
                           
                           if (reading_header) {
                                                
@@ -401,36 +405,36 @@ public class Xcls_WindowLeftTree : Object
                
                 }
                public int getColAt (double x,  double y) {
-               /*
-                       
-               from            https://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465
-                         
-                       */
-                               //Gtk.Allocation alloc = { 0, 0, 0, 0 };
-                               //GLib.debug("Cehck %d, %d", x,y);
-                       var  child = this.el.get_first_child(); 
-                        
-                       var col = 0;
-                       var offx = 0;
-                       while (child != null) {
-                                       
-                                       if (child.get_type().name() == "GtkColumnViewRowWidget") {
-                                               child = child.get_first_child();
-                                               continue;
-                                       }
+                       /*
                                        
-                                       //child.get_allocation(out alloc);
-                                       if (x <  (child.get_width() + offx)) {
-                                               return col;
-                                       }
-                                       return 1;
-                                       //offx += child.get_width();
-                                       //col++;
-                                       //child = child.get_next_sibling();
+                       from            https://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465
+                         
+                       */
+                       //Gtk.Allocation alloc = { 0, 0, 0, 0 };
+                       //GLib.debug("Cehck %d, %d", x,y);
+                   var  child = this.el.get_first_child(); 
+                        
+                       var col = 0;
+                       var offx = 0;
+                       while (child != null) {
+                               
+                               if (child.get_type().name() == "GtkColumnViewRowWidget") {
+                                       child = child.get_first_child();
+                                       continue;
                                }
-                            
-                                         
-                       return -1;
+                               
+                               //child.get_allocation(out alloc);
+                               if (x <  (child.get_width() + offx)) {
+                                       return col;
+                               }
+                               return 1;
+                               //offx += child.get_width();
+                               //col++;
+                               //child = child.get_next_sibling();
+                       }
+                            
+                                 
+                   return -1;
                
                 }
                public int getRowAt (double x,  double in_y, out string pos) {
@@ -450,7 +454,7 @@ public class Xcls_WindowLeftTree : Object
                        */
                                 
                                
-                               //GLib.debug("offset = %d  y = %d", (int) voff, (int) in_y);
+                               GLib.debug("get Widget At Row x = %d  y = %d", (int) x, (int) in_y);
                        var y = in_y + _this.viewwin.el.vadjustment.value; 
                        var  child = this.el.get_first_child(); 
                        //Gtk.Allocation alloc = { 0, 0, 0, 0 };
@@ -591,7 +595,7 @@ public class Xcls_WindowLeftTree : Object
                
                 }
        }
-       public class Xcls_GestureClick6 : Object
+       public class Xcls_GestureClick5 : Object
        {
                public Gtk.GestureClick el;
                private Xcls_WindowLeftTree  _this;
@@ -600,7 +604,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_GestureClick6(Xcls_WindowLeftTree _owner )
+               public Xcls_GestureClick5(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.GestureClick();
@@ -677,7 +681,7 @@ public class Xcls_WindowLeftTree : Object
                // user defined functions
        }
 
-       public class Xcls_GestureClick7 : Object
+       public class Xcls_GestureClick6 : Object
        {
                public Gtk.GestureClick el;
                private Xcls_WindowLeftTree  _this;
@@ -686,7 +690,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_GestureClick7(Xcls_WindowLeftTree _owner )
+               public Xcls_GestureClick6(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.GestureClick();
@@ -748,7 +752,7 @@ public class Xcls_WindowLeftTree : Object
                // user defined functions
        }
 
-       public class Xcls_DragSource8 : Object
+       public class Xcls_DragSource7 : Object
        {
                public Gtk.DragSource el;
                private Xcls_WindowLeftTree  _this;
@@ -757,7 +761,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_DragSource8(Xcls_WindowLeftTree _owner )
+               public Xcls_DragSource7(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.DragSource();
@@ -838,7 +842,7 @@ public class Xcls_WindowLeftTree : Object
                // user defined functions
        }
 
-       public class Xcls_EventControllerKey9 : Object
+       public class Xcls_EventControllerKey8 : Object
        {
                public Gtk.EventControllerKey el;
                private Xcls_WindowLeftTree  _this;
@@ -847,7 +851,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_EventControllerKey9(Xcls_WindowLeftTree _owner )
+               public Xcls_EventControllerKey8(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerKey();
@@ -1291,7 +1295,7 @@ public class Xcls_WindowLeftTree : Object
                                        
                                         var m = (GLib.ListStore) _this.model.el.model;
                                _this.main_window.windowstate.file.tree = dropNode;  
-                           
+                               dropNode.updated_count++;
                           
                                        m.append(dropNode);
                                        _this.model.selectNode(dropNode);       
@@ -1351,7 +1355,7 @@ public class Xcls_WindowLeftTree : Object
                                                        _this.view.dragNode.remove();
                                                }
                                                        
-                                               
+                                               dropNode.updated_count++;
                                                _this.model.selectNode(dropNode); 
                                                
                                                _this.changed();                                                
@@ -1365,7 +1369,7 @@ public class Xcls_WindowLeftTree : Object
                                                        _this.model.selectNode(null);                   
                                                        _this.view.dragNode.remove();
                                                }
-                               
+                                               dropNode.updated_count++;
                                                _this.model.selectNode(dropNode);                       
                                                _this.changed();
                                                return true;
@@ -1379,6 +1383,7 @@ public class Xcls_WindowLeftTree : Object
                                
                                                
                                                node.parent.insertAfter(dropNode, node);
+                                               dropNode.updated_count++;
                                                _this.model.selectNode(dropNode);       
                                                _this.changed();
                                                // select it
@@ -1591,7 +1596,7 @@ public class Xcls_WindowLeftTree : Object
                        for (var i = 0; i < s.n_items; i++) {
                                //GLib.debug("check node %s", s.get_item(i).get_type().name());
                                var lr = s.get_item(i) as Gtk.TreeListRow;
-                               GLib.debug("check node %s", lr.get_item().get_type().name());
+                               //GLib.debug("check node %s", lr.get_item().get_type().name());
                                if ((lr.get_item() as JsRender.Node).oid == node.oid) {
                                        return i;
                                        
@@ -1716,7 +1721,7 @@ public class Xcls_WindowLeftTree : Object
                {
                        _this = _owner;
                        _this.maincol = this;
-                       var child_1 = new Xcls_SignalListItemFactory15( _this );
+                       var child_1 = new Xcls_SignalListItemFactory14( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnViewColumn( "Property", child_1.el );
 
@@ -1730,7 +1735,7 @@ public class Xcls_WindowLeftTree : Object
 
                // user defined functions
        }
-       public class Xcls_SignalListItemFactory15 : Object
+       public class Xcls_SignalListItemFactory14 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_WindowLeftTree  _this;
@@ -1739,7 +1744,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SignalListItemFactory15(Xcls_WindowLeftTree _owner )
+               public Xcls_SignalListItemFactory14(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.SignalListItemFactory();
@@ -1840,7 +1845,7 @@ public class Xcls_WindowLeftTree : Object
        }
 
 
-       public class Xcls_ColumnViewColumn16 : Object
+       public class Xcls_ColumnViewColumn15 : Object
        {
                public Gtk.ColumnViewColumn el;
                private Xcls_WindowLeftTree  _this;
@@ -1849,10 +1854,10 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_ColumnViewColumn16(Xcls_WindowLeftTree _owner )
+               public Xcls_ColumnViewColumn15(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_SignalListItemFactory17( _this );
+                       var child_1 = new Xcls_SignalListItemFactory16( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnViewColumn( "Add", child_1.el );
 
@@ -1864,7 +1869,7 @@ public class Xcls_WindowLeftTree : Object
 
                // user defined functions
        }
-       public class Xcls_SignalListItemFactory17 : Object
+       public class Xcls_SignalListItemFactory16 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_WindowLeftTree  _this;
@@ -1873,7 +1878,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SignalListItemFactory17(Xcls_WindowLeftTree _owner )
+               public Xcls_SignalListItemFactory16(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.SignalListItemFactory();
@@ -1936,13 +1941,13 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (dec)
 
                        // set gobject values
-                       var child_1 = new Xcls_Box19( _this );
+                       var child_1 = new Xcls_Box18( _this );
                        this.el.child = child_1.el;
                }
 
                // user defined functions
        }
-       public class Xcls_Box19 : Object
+       public class Xcls_Box18 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowLeftTree  _this;
@@ -1951,7 +1956,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box19(Xcls_WindowLeftTree _owner )
+               public Xcls_Box18(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
@@ -1959,20 +1964,20 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (dec)
 
                        // set gobject values
-                       var child_1 = new Xcls_Button20( _this );
+                       var child_1 = new Xcls_Button19( _this );
                        child_1.ref();
                        this.el.append( child_1.el );
-                       var child_2 = new Xcls_Button21( _this );
+                       var child_2 = new Xcls_Button20( _this );
                        child_2.ref();
                        this.el.append( child_2.el );
-                       var child_3 = new Xcls_Button22( _this );
+                       var child_3 = new Xcls_Button21( _this );
                        child_3.ref();
                        this.el.append( child_3.el );
                }
 
                // user defined functions
        }
-       public class Xcls_Button20 : Object
+       public class Xcls_Button19 : Object
        {
                public Gtk.Button el;
                private Xcls_WindowLeftTree  _this;
@@ -1981,7 +1986,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Button20(Xcls_WindowLeftTree _owner )
+               public Xcls_Button19(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Button();
@@ -1989,6 +1994,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (dec)
 
                        // set gobject values
+                       this.el.has_frame = false;
                        this.el.label = "Delete Element";
 
                        //listeners
@@ -2002,7 +2008,7 @@ public class Xcls_WindowLeftTree : Object
                // user defined functions
        }
 
-       public class Xcls_Button21 : Object
+       public class Xcls_Button20 : Object
        {
                public Gtk.Button el;
                private Xcls_WindowLeftTree  _this;
@@ -2011,7 +2017,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Button21(Xcls_WindowLeftTree _owner )
+               public Xcls_Button20(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Button();
@@ -2019,6 +2025,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (dec)
 
                        // set gobject values
+                       this.el.has_frame = false;
                        this.el.label = "Save as Template";
 
                        //listeners
@@ -2037,7 +2044,7 @@ public class Xcls_WindowLeftTree : Object
                // user defined functions
        }
 
-       public class Xcls_Button22 : Object
+       public class Xcls_Button21 : Object
        {
                public Gtk.Button el;
                private Xcls_WindowLeftTree  _this;
@@ -2046,7 +2053,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Button22(Xcls_WindowLeftTree _owner )
+               public Xcls_Button21(Xcls_WindowLeftTree _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Button();
@@ -2054,6 +2061,7 @@ public class Xcls_WindowLeftTree : Object
                        // my vars (dec)
 
                        // set gobject values
+                       this.el.has_frame = false;
                        this.el.label = "Save as Module";
 
                        //listeners