2 "build_module" : "builder",
5 "# JsRender.JsRender file" : "",
6 "# JsRender.Node node" : "",
7 "# Xcls_MainWindow main_window" : "null",
8 "# bool allow_edit" : false,
9 "$ homogeneous" : "false ",
11 "@ bool stop_editor" : "()",
12 "@ void changed" : "()",
13 "@ void show_add_props" : "(string type)",
14 "@ void show_editor" : "(JsRender.JsRender file, JsRender.Node node, string type, string key)",
15 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
20 "* pack" : "pack_start,false,true,0",
21 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
26 "int margin_left" : 5,
27 "int margin_right" : 5,
28 "string label" : "Add:",
34 "bool hexpand" : true,
39 "id" : "AddPropertyPopup",
44 "label" : "id: _this.{ID} (Vala)",
48 " _this.addProp( \"prop\", \"id\", \"\", \"\");",
52 "tooltip_markup" : "Using _this.{ID} will map to this element",
58 "label" : "pack: Pack method (Vala)",
63 " _this.addProp( \"prop\", \"pack\",\"add\", \"*\");",
67 "tooltip_markup" : "how to pack this element onto parent, (method, 2nd arg, 3rd arg) .. the 1st argument is filled by the element",
73 "label" : "ctor: Alterative to default contructor (Vala)",
78 " _this.addProp( \"prop\", \"ctor\",\"\", \"*\");",
85 "new Clutter.Image.from_file(.....)"
92 "label" : "init: initialziation code (vala)",
97 " _this.addProp( \"prop\", \"init\", \"{\\n\\n}\\n\", \"*\" );",
101 "tooltip_markup" : "This code is called after the ctor",
107 "label" : "cms-id: (Roo JS/Pman library)",
111 " _this.addProp( \"prop\", \"cms-id\", \"\", \"string\");",
116 "set the cms-id for this element, when converted to javascript, the html value will be wrapped with Pman.Cms.content({cms-id},{original-html})",
124 "xtype" : "SeparatorMenuItem"
134 " _this.addProp( \"prop\", \"XXXX\", \"\",\"# string\");",
139 "tooltip_markup" : "Add a user defined string property",
150 " _this.addProp(\"prop\", \"XXX\", \"0\", \"int\");",
154 "tooltip_markup" : "Add a user defined number property",
165 " _this.addProp( \"prop\", \"XXX\", \"true\", \"bool\");",
169 "tooltip_markup" : "Add a user defined boolean property",
175 "xtype" : "SeparatorMenuItem"
180 "label" : "Javascript Function",
185 " _this.addProp(\"prop\", \"XXXX\", \"function() { }\", \"| function\");",
189 "tooltip_markup" : "Add a user function boolean property",
195 "label" : "Vala Method",
200 " _this.addProp( \"prop\", \"XXXX\", \"() {\\n\\n}\\n\", \"| void\");",
204 "tooltip_markup" : "Add a user function boolean property",
210 "label" : "Vala Signal",
215 " _this.addProp( \"prop\", \"XXXX\", \"()\", \"@ void\");",
219 "tooltip_markup" : "Add a vala signal",
225 "xtype" : "SeparatorMenuItem"
230 "label" : "Flexy - If",
235 " _this.addProp(\"prop\", \"flexy:if\", \"value_or_condition\", \"string\");",
239 "tooltip_markup" : "Add a flexy if (for HTML templates)",
245 "label" : "Flexy - Include",
250 " _this.addProp(\"prop\", \"flexy:include\", \"name_of_file.html\", \"string\");",
254 "tooltip_markup" : "Add a flexy include (for HTML templates)",
260 "label" : "Flexy - Foreach",
265 " _this.addProp(\"prop\", \"flexy:foreach\", \"array,key,value\", \"string\");",
269 "tooltip_markup" : "Add a flexy foreach (for HTML templates)",
276 "$ Gtk.Stock stock" : "Gtk.Stock.ADD",
277 "$ icon_size" : "Gtk.IconSize.MENU",
279 "* pack" : "set_image",
284 "button_press_event" : [
286 " _this.before_edit();",
289 " var p = _this.AddPropertyPopup;",
290 " p.el.set_screen(Gdk.Screen.get_default());",
292 " p.el.popup(null, null, null, ev.button, ev.time);",
297 "string label" : "Other",
301 "$ tooltip_text" : "\"Add Property\"",
304 "bool always_show_image" : true,
305 "bool hexpand" : true,
309 "* pack" : "set_image",
310 "utf8 icon_name" : "format-justify-left",
318 " _this.main_window.windowstate.showProps(this.el, \"props\");",
324 "string label" : "Property",
328 "$ tooltip_text" : "\"Add Event Code\"",
331 "bool always_show_image" : true,
332 "bool hexpand" : true,
336 "* pack" : "set_image",
337 "utf8 icon_name" : "appointment-new",
346 " _this.main_window.windowstate.showProps(this.el, \"signals\");",
352 "string label" : "Event",
359 "# bool editing" : false,
360 "$ shadow_type" : "Gtk.ShadowType.IN",
365 " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
369 "* pack" : "pack_end,true,true,0",
373 "$ enable_tree_lines" : true,
374 "$ headers_visible" : true,
378 " var selection = this.el.get_selection();",
379 " selection.set_mode( Gtk.SelectionMode.SINGLE);",
382 " var description = new Pango.FontDescription();",
383 " description.set_size(10000);",
384 " this.el.override_font(description);",
389 "Xcls_PopoverProperty popover" : "null",
394 "function(str, doRefresh) {",
395 " if (!this.activePath) {",
398 " var iter = new Gtk.TreeIter();",
399 " this.el.get_iter(iter, new Gtk.TreePath.from_string(this.activePath));",
401 " this.el.set_value(iter, 1, '' +str);",
402 " this.el.set_value(iter, 3, '' + this.toShort(str));",
403 " var type = this.getIterValue(iter, 4);",
405 " this.el.set_value(iter, 5, type + ' : ' + str);",
406 " // update the tree... ",
408 " this.get('/LeftTree.model').changed(this.toJS(), doRefresh); ",
413 " typeof(string), // 0 key type",
414 " typeof(string), // 1 key",
415 " typeof(string), // 2 key (display)",
416 " typeof(string), // 3 value",
417 " typeof(string), // 4 value (display)",
418 " typeof(string), // 5 both (tooltip) ",
419 " typeof(string) // 6 key (for sorting)",
424 " var a = typeof(str) == 'string' ? str.split(\"\\n\") : [];",
425 " return a.length > 1 ? a[0] + '....' : '' + str;",
430 "* pack" : "set_model",
433 "xtype" : "TreeStore"
436 "$ resizable" : true,
439 " this.el.add_attribute(_this.keyrender.el , \"markup\", 2 );",
440 " this.el.add_attribute(_this.keyrender.el , \"text\", 1 );",
443 "* pack" : "append_column",
448 "* pack" : "pack_start,false",
452 " (path, newtext) => {",
453 " GLib.debug(\"Keyrender - signal:edited\\n\");",
455 " this.el.editable = false;",
459 " Gtk.TreeIter iter;",
460 " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
463 " _this.model.el.get_value(iter,1, out gval);",
464 " var oldval = (string)gval;",
466 " _this.model.el.get_value(iter,0, out gval);",
467 " var ktype = (string)gval;",
469 " _this.model.el.set_value(iter, 1, newtext);",
471 " if (oldval == newtext) {",
476 " GLib.debug(\"ktype: %s\\n\",ktype);",
478 " case \"listener\":",
479 " var ov = _this.node.listeners.get(oldval);",
480 " _this.node.listeners.set(newtext, ov);",
481 " _this.node.listeners.unset(oldval);",
483 " _this.updateIter(iter, ktype, newtext, ov);",
487 " var ov = _this.node.props.get(oldval);",
488 " _this.node.props.set(newtext, ov);",
489 " _this.node.props.unset(oldval);",
490 " _this.updateIter(iter, ktype, newtext, ov);",
497 "editing_started" : [
498 "( editable, path) => {",
500 " Gtk.TreeIter iter;",
501 " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
506 " // this.get('/LeftPanel.model').activePath = path;",
507 " _this.model.el.get_value(iter,1, out gval);",
508 " var val = (string)gval;",
510 " ((Gtk.Entry)editable).set_text(val); ",
514 "xtype" : "CellRendererText"
518 "xtype" : "TreeViewColumn"
521 "$ resizable" : true,
526 "\t// typeof(string), // 0 key type",
527 " // typeof(string), // 1 key",
528 " // typeof(string), // 2 key (display)",
529 " // typeof(string), // 3 value",
530 " // typeof(string) // 4 value (display)",
533 "\tthis.el.add_attribute(_this.valrender.el , \"text\", 4 );",
534 "\t//this.el.add_attribute(_this.valrender.el , \"sensitive\", 4 );",
535 "\t//this.el.add_attribute(this.items[0].el , 'editable', 3 );",
536 " // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);",
538 " //\tthis.get('/LeftPanel').editableColumn= this;",
542 "* pack" : "append_column",
546 "$ editable" : false,
547 "$ has_entry" : true,
549 "* pack" : "pack_start,true",
553 "$ columns" : "typeof(string)",
557 "id" : "valrendermodel",
559 "xtype" : "ListStore"
564 " (path, newtext) => {",
565 " GLib.debug(\"Valrender - signal:edited\\n\");",
567 " this.el.editable = false;",
571 " 1, miter.get_key(),",
572 " 2, \"<b>\" + miter.get_key() + \"</b>\",",
573 " 3, miter.get_value(),",
574 " 4, display_value(short);",
579 " Gtk.TreeIter iter;",
580 " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
583 " _this.model.el.get_value(iter,0, out gval);",
584 " var ktype = (string)gval;",
587 " _this.model.el.get_value(iter,3, out gval);",
588 " var oldval = (string)gval;",
590 " _this.model.el.get_value(iter,1, out gval);",
591 " var key = (string)gval;",
596 " case \"listener\":",
597 " _this.node.listeners.set(key, newtext);",
598 " _this.updateIter(iter,ktype,key,newtext);",
601 " _this.node.props.set(key,newtext);",
602 " _this.updateIter(iter,ktype, key,newtext); ",
605 "// _this.load(_this.file,_this.node);",
610 "editing_started" : [
611 "( editable, path) => {",
612 " //_this.editing = true;",
613 " GLib.debug(\"editing started called\\n\");",
614 " if (!_this.allow_edit) {",
616 " GLib.debug(\"val - editing_Started\\n\");",
617 " this.el.editable = false; // make sure it's not editor...",
622 " _this.allow_edit =false;",
625 " if ( this.el.has_entry ) {",
627 " Gtk.TreeIter iter;",
628 " _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));",
633 " // this.get('/LeftPanel.model').activePath = path;",
634 " _this.model.el.get_value(iter,3, out gval);",
637 " var val = (string)gval;",
638 " var combo = (Gtk.ComboBox)editable;",
640 " var entry = (Gtk.Entry) combo.get_child(); ",
641 " entry.set_text(val);",
648 "xtype" : "CellRendererCombo",
649 "| void setOptions" : [
651 " var m = _this.valrendermodel.el;",
653 " Gtk.TreeIter iret;",
654 " for (var i =0; i < ar.length; i++) {",
655 " m.append(out iret);",
656 " m.set_value(iret, 0, ar[i]);",
664 "xtype" : "TreeViewColumn"
669 "id" : "ContextMenu",
674 "label" : "Edit (double click)",
679 " var s = _this.view.el.get_selection();",
680 " Gtk.TreeIter iter;",
681 " Gtk.TreeModel mod;",
682 " s.get_selected (out mod, out iter);",
684 " if (_this.view.popover == null) {",
685 " \t\t _this.view.popover = new Xcls_PopoverProperty();",
686 " \t\t _this.view.popover.mainwindow = _this.main_window;",
690 " _this.before_edit();",
691 " _this.stop_editor();",
693 " _this.keyrender.el.stop_editing(false);",
694 " _this.keyrender.el.editable =false;",
696 " _this.valrender.el.stop_editing(false);",
697 " _this.valrender.el.editable =false;",
700 "\tGLib.Value gvaltype, gval;",
701 "\tmod.get_value(iter, 1 , out gval); // one is key..",
703 " mod.get_value(iter,0, out gvaltype);",
705 "\t_this.view.popover.show(_this.view.el, _this.node, (string)gvaltype, (string)gval);",
709 " // _this.startEditingKey(model.get_path(iter));",
718 "xtype" : "SeparatorMenuItem"
727 "\t_this.deleteSelected();",
738 "button_press_event" : [
741 " Gtk.TreeViewColumn col;",
744 " Gtk.TreePath path;",
745 " if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {",
746 " GLib.debug(\"nothing selected on click\");",
747 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
748 " this.el.get_selection().unselect_all();",
752 " _this.before_edit();",
753 " return false; //not on a element.",
757 " // double click on name..",
758 " if (ev.type == Gdk.EventType.2BUTTON_PRESS && ev.button == 1 && col.title == \"Name\") { ",
761 " if (this.popover == null) {",
762 " \t\t this.popover = new Xcls_PopoverProperty();",
763 " \t\t this.popover.mainwindow = _this.main_window;",
767 " _this.before_edit();",
768 " _this.stop_editor();",
770 " _this.keyrender.el.stop_editing(false);",
771 " _this.keyrender.el.editable =false;",
773 " _this.valrender.el.stop_editing(false);",
774 " _this.valrender.el.editable =false;",
775 " Gtk.TreeIter iter;",
776 " var mod = this.el.get_model();",
777 "\t\t mod.get_iter (out iter, path);",
780 "\t\tGLib.Value gvaltype, gval;",
781 "\t\tmod.get_value(iter, 1 , out gval); // one is key..",
783 "\t mod.get_value(iter,0, out gvaltype);",
785 " this.popover.show(this.el, _this.node, (string)gvaltype, (string)gval);",
787 " // _this.startEditingKey(path); ",
796 " if (ev.type == Gdk.EventType.BUTTON_PRESS && ev.button == 3) { ",
798 " //if (col.title == \"Value\") {",
799 " // _this.before_edit();",
803 " var p = _this.ContextMenu;",
805 " p.el.set_screen(Gdk.Screen.get_default());",
807 " p.el.popup(null, null, null, ev.button, ev.time);",
808 " //Seed.print(\"click:\" + res.column.title);",
810 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
812 " this.el.get_selection().select_path(path);",
815 " _this.before_edit();",
820 " if (col.title != \"Value\") {",
821 " GLib.debug(\"col title != Value\");",
823 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
824 " this.el.get_selection().select_path(path);",
828 " _this.before_edit();",
829 " // XObject.error(\"column is not value?\");",
830 " return false; // ignore.. - key click.. ??? should we do this??",
834 " // if the cell can be edited with a pulldown",
835 " // then we should return true... - and let the start_editing handle it?",
842 " // _this.before_edit(); <<< we really need to stop the other editor..",
843 " _this.keyrender.el.stop_editing(false);",
844 " _this.keyrender.el.editable =false;",
847 " return _this.startEditingValue(path); // assumes selected row..",
856 "tooltip_column" : 5,
860 "xtype" : "ScrolledWindow"
864 "| string keyFormat" : [
865 "(string val, string type) {",
867 " // Glib.markup_escape_text(val);",
869 " if (type == \"listener\") {",
870 " return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + ",
871 " GLib.Markup.escape_text(val) +",
875 " if (val.length < 1) {",
876 " return \"<span color=\\\"#FF0000\\\">--empty--</span>\";",
880 " //$ = property with ",
881 " //# - object properties",
883 " // all of these... - display value is last element..",
884 " var ar = val.strip().split(\" \");",
887 " var dval = GLib.Markup.escape_text(ar[ar.length-1]);",
893 " case '@': // signal // just bold balck?",
894 " if (dval[0] == '@') {",
895 " dval = dval.substring(1);",
898 " return @\"<span font_weight=\\\"bold\\\">@ $dval</span>\"; ",
899 " case '#': // object properties?",
900 " if (dval[0] == '#') {",
901 " dval = dval.substring(1);",
903 " return @\"<span font_weight=\\\"bold\\\">$dval</span>\";",
904 " case '*': // special",
905 " if (dval[0] == '*') {",
906 " dval = dval.substring(1);",
908 " return @\"<span color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\"; ",
910 " if (dval[0] == '$') {",
911 " dval = dval.substring(1);",
913 " return @\"<span style=\\\"italic\\\">$dval</span>\";",
914 " case '|': // user defined methods",
915 " if (dval[0] == '|') {",
916 " dval = dval.substring(1);",
918 " return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";",
930 "| string keySortFormat" : [
932 " // listeners first - with 0",
934 " if (key[0] == '*') {",
935 " return \"1 \" + key;",
939 " var bits = key.split(\" \");",
941 " if (key[0] == '|') {",
942 " return \"2 \" + bits[bits.length -1];",
945 " if (key[0] == '@') {",
946 " return \"3 \" + bits[bits.length -1];",
950 " if (key[0] == '#') {",
951 " return \"4 \" + bits[bits.length -1];",
954 " return \"5 \" + bits[bits.length -1]; ",
961 " (string in_type, string key, string value, string value_type) {",
962 " // info includes key, val, skel, etype..",
963 " //console.dump(info);",
964 " //type = info.type.toLowerCase();",
965 " //var data = this.toJS();",
967 " var type = in_type == \"signals\" ? \"listener\" : in_type;",
969 " var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;",
971 " if (type == \"listener\") {",
972 " if (this.node.listeners.has_key(key)) {",
975 " this.node.listeners.set(key,value);",
977 " assert(this.node != null);",
978 " assert(this.node.props != null);",
979 " if (this.node.props.has_key(fkey)) {",
982 " this.node.props.set(fkey,value);",
987 " this.load(this.file, this.node);",
991 " /// need to find the row which I've just added..",
994 " var s = this.view.el.get_selection();",
995 " s.unselect_all();",
997 " GLib.debug(\"trying to find new iter\");",
999 " this.model.el.foreach((model, path, iter) => {",
1000 " GLib.Value gval;",
1002 " this.model.el.get_value(iter, 0 , out gval);",
1003 " if ((string)gval != type) {",
1004 " GLib.debug(\"not type: %s = %s\\n\", (string)gval , type);",
1007 " this.model.el.get_value(iter, 1 , out gval);",
1008 " if ((string)gval != fkey) {",
1009 " GLib.debug(\"not key: %s = %s\\n\", (string)gval , fkey);",
1013 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {",
1015 " this.startEditingValue(this.model.el.get_path(iter));",
1018 " //s.select_iter(iter);",
1028 "| void before_edit" : [
1032 " GLib.debug(\"before edit - stop editing\\n\");",
1034 " // these do not appear to trigger save...",
1035 " _this.keyrender.el.stop_editing(false);",
1036 " _this.keyrender.el.editable =false;",
1038 " _this.valrender.el.stop_editing(false);",
1039 " _this.valrender.el.editable =false; ",
1042 "// technicall stop the popup editor..",
1047 "| void deleteSelected" : [
1050 " Gtk.TreeIter iter;",
1051 " Gtk.TreeModel mod;",
1053 " var s = this.view.el.get_selection();",
1054 " s.get_selected(out mod, out iter);",
1057 " GLib.Value gval;",
1058 " mod.get_value(iter, 0 , out gval);",
1059 " var type = (string)gval;",
1061 " mod.get_value(iter, 1 , out gval);",
1062 " var key = (string)gval;",
1065 " case \"listener\":",
1066 " this.node.listeners.unset(key);",
1070 " this.node.props.unset(key);",
1073 " this.load(this.file, this.node);",
1075 " _this.changed();",
1078 "| void finish_editing" : [
1081 " this.before_edit();",
1085 "(JsRender.JsRender file, JsRender.Node? node) ",
1087 " GLib.debug(\"load leftprops\\n\");",
1088 " this.before_edit();",
1089 " this.node = node;",
1090 " this.file = file;",
1093 " this.model.el.clear();",
1095 " //this.get('/RightEditor').el.hide();",
1096 " if (node ==null) {",
1102 " //var provider = this.get('/LeftTree').getPaleteProvider();",
1103 " Gtk.TreeIter iter;",
1105 " //typeof(string), // 0 key type",
1106 " //typeof(string), // 1 key",
1107 " //typeof(string), // 2 key (display)",
1108 " //typeof(string), // 3 value",
1109 " //typeof(string), // 4 value (display)",
1110 " //typeof(string), // 5 both (tooltip)",
1114 " // really need a way to sort the hashmap...",
1115 " var m = this.model.el;",
1117 " var miter = node.listeners.map_iterator();",
1120 " while(miter.next()) {",
1122 " m.append(out iter,null);",
1124 " this.updateIter(iter, \"listener\", miter.get_key(), miter.get_value());",
1130 " miter = node.props.map_iterator();",
1133 " while(miter.next()) {",
1135 " m.append(out iter,null);",
1136 " this.updateIter(iter, \"prop\", miter.get_key(), miter.get_value());",
1139 " GLib.debug(\"clear selection\\n\");",
1140 " // clear selection?",
1141 " this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..",
1143 " this.view.el.get_selection().unselect_all();",
1148 " make outerpane = {current width of left pane} + width of props",
1149 " make innerpane = {current width of left pane}",
1155 " var outerpane = _this.main_window.leftpane.el;",
1156 " var pane = _this.main_window.editpane.el;",
1160 " var try_size = (i * 25) + 60; // est. 20px per line + 40px header",
1161 " GLib.Timeout.add_seconds(1, () => { ",
1162 "\t\t// max 80%...",
1163 "\t\tpane.set_position( ",
1164 "\t\t ((try_size * 1.0f) / (pane.max_position * 1.0f)) > 0.8f ? ",
1165 "\t\t (int) (pane.max_position * 0.2f) :",
1166 "\t\t pane.max_position-try_size);",
1167 "\t return GLib.Source.REMOVE;",
1174 "| void startEditingKey" : [
1175 "( Gtk.TreePath path) {",
1177 " if (!this.stop_editor()) {",
1181 " // others... - fill in options for true/false?",
1184 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
1185 " this.allow_edit = true;",
1186 " this.keyrender.el.editable = true;",
1188 " this.view.el.set_cursor_on_cell(",
1191 " this.keyrender.el,",
1202 "| void updateIter" : [
1203 "(Gtk.TreeIter iter, string type, string key, string kvalue) {",
1205 " //print(\"update Iter %s, %s\\n\", key,kvalue);",
1206 " //typeof(string), // 0 key type",
1207 " //typeof(string), // 1 key",
1208 " //typeof(string), // 2 key (display)",
1209 " //typeof(string), // 3 value",
1210 " //typeof(string), // 4 value (display)",
1211 " //typeof(string), // 5 both (tooltip)",
1212 " //typeof(string), // 6 key (sort)",
1214 " var dl = kvalue.strip().split(\"\\n\");",
1216 " var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];",
1218 " if (type == \"listener\") {",
1222 " this.model.el.set(iter, ",
1225 " 2, this.keyFormat(key ,type),",
1228 " 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" +kvalue) + \"</tt>\",",
1236 " this.model.el.set(iter, ",
1239 " 2, this.keyFormat(key , \"prop\"),",
1242 " 5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" + kvalue) + \"</tt>\",",
1243 " 6, this.keySortFormat(key)",
1247 "| bool startEditingValue" : [
1248 "( Gtk.TreePath path) {",
1250 " // ONLY return true if editing is allowed - eg. combo..",
1252 " GLib.debug(\"start editing?\\n\");",
1253 " if (!this.stop_editor()) {",
1254 " GLib.debug(\"stop editor failed\\n\");",
1258 " Gtk.TreeIter iter;",
1260 " var mod = this.model.el;",
1261 " mod.get_iter (out iter, path);",
1265 " 0, \"listener\",",
1266 " 1, miter.get_key(),",
1267 " 2, \"<b>\" + miter.get_key() + \"</b>\",",
1268 " 3, miter.get_value()",
1272 " GLib.Value gval;",
1273 " mod.get_value(iter, 3 , out gval);",
1274 " var val = (string)gval;",
1276 " mod.get_value(iter, 1 , out gval);",
1277 " var key = (string)gval;",
1280 " string kname, kflag, ktype;",
1281 " this.node.normalize_key(key, out kname, out kflag, out ktype);",
1284 " mod.get_value(iter, 0 , out gval);",
1285 " var type = (string)gval; // listerner or prop..",
1289 " var use_textarea = false;",
1291 " //------------ things that require the text editor...",
1293 " if (type == \"listener\") {",
1294 " use_textarea = true;",
1296 " if (key.length > 0 && key[0] == '|') { // user defined method",
1297 " use_textarea = true;",
1299 " if (key.length > 0 && key[0] == '$') { // raw string",
1300 " use_textarea = true;",
1302 " if (key.length > 0 && key == \"* init\") {",
1303 " use_textarea = true;",
1305 " if (val.length > 40) { // long value...",
1306 " use_textarea = true;",
1311 " if (use_textarea) {",
1312 " GLib.debug(\"Call show editor\\n\");",
1313 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
1314 " this.view.el.get_selection().select_path(path);",
1316 " this.show_editor(file, node, type, key);",
1325 " var pal = this.file.project.palete;",
1328 " var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);",
1332 " // others... - fill in options for true/false?",
1333 " GLib.debug(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());",
1335 " GLib.debug (ktype.up());",
1337 " GLib.debug(\"start editing try/false)???\");",
1338 " this.valrender.el.has_entry = false;",
1340 " this.valrender.setOptions(opts);",
1342 " this.valrender.el.has_entry = false;",
1343 " this.valrender.el.editable = true;",
1344 " this.allow_edit = true;",
1345 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {",
1346 " this.view.el.set_cursor_on_cell(",
1349 " this.valrender.el,",
1357 " // see if type is a Enum.",
1364 " this.valrender.setOptions(opts);",
1366 " GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {",
1368 " // at this point - work out the type...",
1369 " // if its' a combo... then show the options..",
1370 " this.valrender.el.has_entry = true;",
1372 " this.valrender.el.editable = true; ",
1375 " this.allow_edit = true;",
1381 " this.view.el.set_cursor_on_cell(",
1384 " this.valrender.el,",
1393 "| void updateKey" : [
1394 "(string oldkey, string type, string key ) {",
1398 "\t_this.model.el.foreach((mod, path, iter) => {",
1403 "\t\t GLib.Value gvaltype, gval,kvalue;",
1404 "\t\t mod.get_value(iter, 1 , out gval); // one is key..",
1406 "\t mod.get_value(iter,0, out gvaltype);",
1408 " \t mod.get_value(iter,3, out kvalue);",
1410 "\t if (oldkey == ((string)gval) && type == ((string)gvaltype)) {",
1412 "\t\t \t //print(\"update iter type=%s, key=%s value=%s\\n\", type, key,(string) kvalue);",
1414 " \t \t this.updateIter(iter, type, key, (string)kvalue);",
1415 " \t \t return true;",
1419 "\t\treturn false;",
1422 "\tthis.changed();",
1431 "name" : "WindowLeftProps",
1433 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/WindowLeftProps.bjs",