X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=blobdiff_plain;f=src%2FBuilder4%2FWindowRooView.bjs;h=49110632076c88be5b2e521472c1fb6af7aa0102;hp=a6d6da75fd41af784ea3281929663addfca512a8;hb=ab5668e940f7c7a6bc67535fd3db3c4706a26a0f;hpb=d0eab5e2c3593c65da11db26d722b41fcee685c9 diff --git a/src/Builder4/WindowRooView.bjs b/src/Builder4/WindowRooView.bjs index a6d6da75f..491106320 100644 --- a/src/Builder4/WindowRooView.bjs +++ b/src/Builder4/WindowRooView.bjs @@ -158,7 +158,7 @@ { "listeners" : { "button_release_event" : "() => {\n\tthis.onCursorChanged();\n\n\treturn false;\n}", - "key_press_event" : "() => {\n\tthis.onCursorChanged();\n\treturn false;\n}" + "key_press_event" : "() => {\n\tthis.onCursorChanged();\n\treturn false; \n}" }, "gboolean show_line_marks" : true, "| void onCursorChanged" : "(/*ParamSpec ps*/) {\n\t if (this.loading) {\n return;\n }\n // if (ps.name != \"cursor-position\") {\n // return;\n // }\n\n var buf = this.el.get_buffer();\n print(\"cursor changed : %d\\n\", buf.cursor_position);\n Gtk.TextIter cpos;\n buf.get_iter_at_offset(out cpos, buf.cursor_position);\n \n var ln = cpos.get_line();\n\t\tprint(\"cursor changed line : %d\\n\", ln);\n var node = _this.file.lineToNode(ln+1);\n \n if (node == null) {\n print(\"can not find node\\n\");\n return;\n }\n var prop = node.lineToProp(ln+1);\n print(\"prop : %s\", prop == null ? \"???\" : prop);\n \n \n \n \n // ---------- this selects the tree's node...\n \n var ltree = _this.main_window.windowstate.left_tree;\n var tp = ltree.model.treePathFromNode(node);\n print(\"got tree path %s\\n\", tp);\n if (tp != \"\") {\n\t this.allow_node_scroll = false; /// block node scrolling..\n\t \n\t \n\t //print(\"changing cursor on tree..\\n\");\n\t \n \n \n // let's try allowing editing on the methods.\n // a little klunky at present..\n this.prop_selected = \"\";\n if (prop != null) {\n \t\t//see if we can find it..\n \t\tvar kv = prop.split(\":\");\n \t\tif (kv[0] == \"p\") {\n \t\t\n\t \t\t//var k = prop.get_key(kv[1]);\n\t \t\t// fixme -- need to determine if it's an editable property...\n\t \t\tthis.prop_selected = prop;\n\t \t\t\n \t\t} else if (kv[0] == \"l\") {\n \t\t\t this.prop_selected = prop;\n \t\t\t\n \t\t}\n }\n ltree.view.setCursor(tp, \"editor\");\n // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); \n this.nodeSelected(node,false);\n \n // scrolling is disabled... as node selection calls scroll 10ms after it changes.\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n\t this.allow_node_scroll = true;\n\t return false;\n });\n }\n \n // highlight the node..\n}\n ",