src/Builder4/WindowRooView.bjs
[app.Builder.js] / src / Builder4 / WindowRooView.vala
index 538be3f..bac02b5 100644 (file)
@@ -933,8 +933,8 @@ public class Xcls_WindowRooView : Object
             // my vars (def)
         public bool loading;
         public bool allow_node_scroll;
+        public string prop_selected;
         public JsRender.Node? node_selected;
-        public string propSelected;
 
         // ctor
         public Xcls_sourceview(Xcls_WindowRooView _owner )
@@ -946,8 +946,8 @@ public class Xcls_WindowRooView : Object
             // my vars (dec)
             this.loading = true;
             this.allow_node_scroll = true;
+            this.prop_selected = "";
             this.node_selected = null;
-            this.propSelected = "";
 
             // set gobject values
             this.el.editable = false;
@@ -1061,7 +1061,7 @@ public class Xcls_WindowRooView : Object
                 
                 
                 
-                
+                // ---------- this selects the tree's node...
                 
                 var ltree = _this.main_window.windowstate.left_tree;
                 var tp = ltree.model.treePathFromNode(node);
@@ -1076,7 +1076,7 @@ public class Xcls_WindowRooView : Object
                     
                     // let's try allowing editing on the methods.
                     // a little klunky at present..
-                    this.propSelected = "";
+                    this.prop_selected = "";
                     if (prop != null) {
                                //see if we can find it..
                                var kv = prop.split(":");
@@ -1084,10 +1084,10 @@ public class Xcls_WindowRooView : Object
                                
                                        //var k = prop.get_key(kv[1]);
                                        // fixme -- need to determine if it's an editable property...
-                                       this.propSelected = prop;
+                                       this.prop_selected = prop;
                                        
                                } else if (kv[0] == "l") {
-                                        this.propSelected = prop;
+                                        this.prop_selected = prop;
                                        
                                }
                     }
@@ -1103,6 +1103,18 @@ public class Xcls_WindowRooView : Object
                 }
                 
                 // highlight the node..
+        }
+        public void clearGreySelection () {
+         // clear all the marks..
+            var sbuf = (GtkSource.TextBuffer)this.el.buffer;
+            
+            Gtk.TextIter start;
+            Gtk.TextIter end;     
+                
+            sbuf.get_bounds (out start, out end);
+            sbuf.remove_source_marks (start, end, "grey");
+            
+            
         }
         public void nodeSelected (JsRender.Node? sel, bool scroll ) {
           
@@ -1116,21 +1128,17 @@ public class Xcls_WindowRooView : Object
                 Gtk.main_iteration();
             }
             
-            this.nodeSelected = sel;
+            this.node_selected = sel;
         
             print("node selected\n");
             var buf = this.el.get_buffer();
             var sbuf = (Gtk.SourceBuffer) buf;
         
            
-            // clear all the marks..
-            Gtk.TextIter start;
-            Gtk.TextIter end;     
-                
-            sbuf.get_bounds (out start, out end);
-            sbuf.remove_source_marks (start, end, "grey");
-            
-            
+           this.clearGreySelection();
+           
+           
+           
              if (sel == null) {
                     print("no selected node\n");
                 // no highlighting..
@@ -1166,10 +1174,10 @@ public class Xcls_WindowRooView : Object
             var colon_pos = 0;
             
             // now if we have selected a property...
-            if (this.propSelected.length> 0 ) {
+            if (this.prop_selected.length> 0 ) {
         
                        int nstart, nend;
-                       if (sel.getPropertyRange(this.propSelected, out nstart, out nend) && nend > nstart) {
+                       if (sel.getPropertyRange(this.prop_selected, out nstart, out nend) && nend > nstart) {
                                start_line = nstart;
                                end_line = nend;
                                this.el.editable = true;
@@ -1205,7 +1213,7 @@ public class Xcls_WindowRooView : Object
                                
                                
                        }
-                       print("propSelected = %s range  %d -> %d\n", this.propSelected, start_line, end_line);          
+                       print("propSelected = %s range  %d -> %d\n", this.prop_selected, start_line, end_line);         
                        
                        
             }