f84d8faca2607f2b99d5f6c206b850b5589810da
[roobuilder] / src / Builder4 / WindowLeftProps.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "# JsRender.JsRender file" : "",
7    "# JsRender.Node node" : "",
8    "# Xcls_MainWindow main_window" : "null",
9    "# bool allow_edit" : false,
10    "$ homogeneous" : "false   ",
11    "$ xns" : "Gtk",
12    "@ bool stop_editor" : "()",
13    "@ void changed" : "()",
14    "@ void show_add_props" : "(string type)",
15    "@ void show_editor" : "(JsRender.JsRender file, JsRender.Node node, JsRender.NodeProp prop)",
16    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
17    "bool hexpand" : true,
18    "bool loading" : false,
19    "bool vexpand" : true,
20    "id" : "LeftProps",
21    "items" : [
22     {
23      "$ xns" : "Gtk",
24      "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
25      "bool hexpand" : true,
26      "items" : [
27       {
28        "$ xns" : "Gtk",
29        "int margin_end" : 5,
30        "int margin_start" : 5,
31        "string label" : "Add:",
32        "xtype" : "Label"
33       },
34       {
35        "$ tooltip_text" : "\"Add Property\"",
36        "$ xns" : "Gtk",
37        "bool always_show_image" : true,
38        "bool hexpand" : true,
39        "listeners" : {
40         "clicked" : [
41          "  ( ) => {",
42          "    ",
43          "     _this.main_window.windowstate.showProps(",
44          "     \t_this.view.el, ",
45          " \t\tJsRender.NodePropType.PROP",
46          "\t);",
47          "  ",
48          "}"
49         ]
50        },
51        "string icon_name" : "format-justify-left",
52        "string label" : "Property",
53        "xtype" : "Button"
54       },
55       {
56        "$ tooltip_text" : "\"Add Event Code\"",
57        "$ xns" : "Gtk",
58        "bool always_show_image" : true,
59        "bool hexpand" : true,
60        "listeners" : {
61         "clicked" : [
62          "  ( ) => {",
63          "    ",
64          " ",
65          "   _this.main_window.windowstate.showProps(",
66          "   \t\t_this.view.el, ",
67          "   \t\tJsRender.NodePropType.LISTENER",
68          "\t);",
69          "",
70          " ",
71          "}"
72         ]
73        },
74        "string icon_name" : "appointment-new",
75        "string label" : "Event",
76        "xtype" : "Button"
77       },
78       {
79        "$ xns" : "Gtk",
80        "bool always_show_image" : true,
81        "bool hexpand" : true,
82        "items" : [
83         {
84          "$ xns" : "Gtk",
85          "* pack" : false,
86          "bool autohide" : true,
87          "id" : "AddPropertyPopup",
88          "items" : [
89           {
90            "$ xns" : "Gtk",
91            "* prop" : "child",
92            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
93            "int spacing" : 0,
94            "items" : [
95             {
96              "$ xns" : "Gtk",
97              "label" : "id: _this.{ID} (Vala)",
98              "listeners" : {
99               "clicked" : [
100                " ()  => {",
101                " \t_this.AddPropertyPopup.el.hide();",
102                " \t// is this userdef or special??",
103                " \tvar add = new JsRender.NodeProp.prop(\"id\");",
104                " \tif (_this.node.has_prop_key(add)) {",
105                "\t \treturn;",
106                " \t}",
107                " \t",
108                " \t_this.node.add_prop( add );",
109                " \t",
110                " \t_this.view.editProp( add );",
111                " \t",
112                "\t",
113                "}"
114               ]
115              },
116              "tooltip_markup" : "Using _this.{ID} will map to this element",
117              "xtype" : "Button"
118             },
119             {
120              "$ xns" : "Gtk",
121              "label" : "pack: Pack method (Vala)",
122              "listeners" : {
123               "clicked" : [
124                "  ( ) => {",
125                " ",
126                "",
127                "\t_this.AddPropertyPopup.el.hide();",
128                " \t// is this userdef or special??",
129                " \tvar add = new JsRender.NodeProp.special(\"pack\", \"add\");",
130                " \tif (_this.node.has_prop_key(add)) {",
131                "\t \treturn;",
132                " \t}",
133                " \t",
134                " \t_this.node.add_prop( add );",
135                " \t",
136                " \t_this.view.editProp( add );",
137                " \t",
138                "",
139                "}"
140               ]
141              },
142              "tooltip_markup" : "how to pack this element onto parent, (method, 2nd arg, 3rd arg) .. the 1st argument is filled by the element",
143              "xtype" : "Button"
144             },
145             {
146              "$ xns" : "Gtk",
147              "label" : "ctor: Alterative to default contructor (Vala)",
148              "listeners" : {
149               "clicked" : [
150                "  ( ) => {",
151                "   ",
152                " _this.AddPropertyPopup.el.hide();",
153                " \t// is this userdef or special??",
154                " \tvar add = new JsRender.NodeProp.special(\"ctor\");",
155                " \tif (_this.node.has_prop_key(add)) {",
156                "\t \treturn;",
157                " \t}",
158                " \t",
159                " \t_this.node.add_prop( add );",
160                " \t",
161                " \t_this.view.editProp( add );",
162                " \t",
163                "}"
164               ]
165              },
166              "tooltip_markup" : [
167               "eg. ",
168               "",
169               "new Clutter.Image.from_file(.....)"
170              ],
171              "xtype" : "Button"
172             },
173             {
174              "$ xns" : "Gtk",
175              "label" : "init: initialziation code (vala)",
176              "listeners" : {
177               "clicked" : [
178                "  ( ) => {",
179                "    ",
180                " _this.AddPropertyPopup.el.hide();",
181                " \t// is this userdef or special??",
182                " \tvar add =  new JsRender.NodeProp.special(\"init\",\"{\\n\\n}\\n\" ) ;",
183                " \tif (_this.node.has_prop_key(add)) {",
184                "\t \treturn;",
185                " \t}",
186                " \t",
187                " \t_this.node.add_prop( add );",
188                " \t",
189                " \t_this.view.editProp( add );",
190                "}"
191               ]
192              },
193              "tooltip_markup" : "This code is called after the ctor",
194              "xtype" : "Button"
195             },
196             {
197              "$ xns" : "Gtk",
198              "label" : "cms-id: (Roo JS/Pman library)",
199              "listeners" : {
200               "clicked" : [
201                " ()  => {",
202                "   ",
203                " _this.AddPropertyPopup.el.hide();",
204                " \t// is this userdef or special??",
205                " \tvar add =   new JsRender.NodeProp.prop(\"cms-id\",\"string\", \"\" ) ;",
206                " \tif (_this.node.has_prop_key(add)) {",
207                "\t \treturn;",
208                " \t}",
209                " \t",
210                " \t_this.node.add_prop( add );",
211                " \t",
212                " \t_this.view.editProp( add );",
213                "    ",
214                "}"
215               ]
216              },
217              "tooltip_markup" : [
218               "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})",
219               ""
220              ],
221              "xtype" : "Button"
222             },
223             {
224              "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
225              "$ xns" : "Gtk",
226              "xtype" : "Separator"
227             },
228             {
229              "$ xns" : "Gtk",
230              "label" : "String",
231              "listeners" : {
232               "clicked" : [
233                "(self) => {",
234                "     _this.AddPropertyPopup.el.hide();",
235                "\t_this.view.popover.show(",
236                "\t\t_this.view.el, ",
237                "\t\t_this.node, ",
238                "\t\t new JsRender.NodeProp.prop(\"\", \"string\", \"\") ,",
239                "\t\t-1,  ",
240                "\t\ttrue",
241                "\t);",
242                " ",
243                "}"
244               ]
245              },
246              "tooltip_markup" : "Add a user defined string property",
247              "xtype" : "Button"
248             },
249             {
250              "$ xns" : "Gtk",
251              "label" : "Number",
252              "listeners" : {
253               "clicked" : [
254                "  ( ) =>{",
255                "      _this.AddPropertyPopup.el.hide();",
256                "      ",
257                "       _this.view.popover.show(",
258                "\t\t_this.view.el, ",
259                "\t\t_this.node, ",
260                "\t\t new JsRender.NodeProp.prop(\"\", \"int\", \"0\") ,",
261                "\t\t-1,  ",
262                "\t\ttrue",
263                "\t);",
264                " ",
265                "}"
266               ]
267              },
268              "tooltip_markup" : "Add a user defined number property",
269              "xtype" : "Button"
270             },
271             {
272              "$ xns" : "Gtk",
273              "label" : "Boolean",
274              "listeners" : {
275               "clicked" : [
276                "  ( ) =>{",
277                "  ",
278                "  \t     _this.AddPropertyPopup.el.hide();",
279                "   _this.view.popover.show(",
280                "\t\t_this.view.el, ",
281                "\t\t_this.node, ",
282                "\t\t new JsRender.NodeProp.prop(\"\", \"bool\", \"true\") ,",
283                "\t\t-1,  ",
284                "\t\ttrue",
285                "\t); ",
286                " ",
287                "}"
288               ]
289              },
290              "tooltip_markup" : "Add a user defined boolean property",
291              "xtype" : "Button"
292             },
293             {
294              "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
295              "$ xns" : "Gtk",
296              "xtype" : "Separator"
297             },
298             {
299              "$ xns" : "Gtk",
300              "label" : "Javascript Function",
301              "listeners" : {
302               "clicked" : [
303                "  ( ) =>{",
304                "  _this.AddPropertyPopup.el.hide(); ",
305                "   _this.view.popover.show(",
306                "\t\t_this.view.el, ",
307                "\t\t_this.node, ",
308                "\t\t new JsRender.NodeProp.jsmethod(\"\") ,",
309                "\t\t-1,  ",
310                "\t\ttrue",
311                "\t);",
312                "",
313                " ",
314                "}"
315               ]
316              },
317              "tooltip_markup" : "Add a user function boolean property",
318              "xtype" : "Button"
319             },
320             {
321              "$ xns" : "Gtk",
322              "label" : "Vala Method",
323              "listeners" : {
324               "clicked" : [
325                "  ( ) =>{",
326                "_this.AddPropertyPopup.el.hide();",
327                "    _this.view.popover.show(",
328                "\t\t_this.view.el, ",
329                "\t\t_this.node, ",
330                "\t\t new JsRender.NodeProp.valamethod(\"\") ,",
331                "\t\t-1,  ",
332                "\t\ttrue",
333                "\t); ",
334                "}"
335               ]
336              },
337              "tooltip_markup" : "Add a user function boolean property",
338              "xtype" : "Button"
339             },
340             {
341              "$ xns" : "Gtk",
342              "label" : "Vala Signal",
343              "listeners" : {
344               "clicked" : [
345                "  ( ) =>{",
346                "  _this.AddPropertyPopup.el.hide();",
347                "  _this.view.popover.show(",
348                "\t\t_this.view.el, ",
349                "\t\t_this.node, ",
350                "\t\t new JsRender.NodeProp.sig(\"\" ) ,",
351                "\t\t-1,  ",
352                "\t\ttrue",
353                "\t);    ",
354                "}"
355               ]
356              },
357              "tooltip_markup" : "Add a vala signal",
358              "xtype" : "Button"
359             },
360             {
361              "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
362              "$ xns" : "Gtk",
363              "xtype" : "Separator"
364             },
365             {
366              "$ xns" : "Gtk",
367              "label" : "Flexy - If",
368              "listeners" : {
369               "clicked" : [
370                "  ( ) =>{",
371                " \t_this.AddPropertyPopup.el.hide();",
372                " \t_this.view.popover.show(",
373                "\t\t_this.view.el, ",
374                "\t\t_this.node, ",
375                "\t\t new JsRender.NodeProp.prop(\"flexy:if\", \"string\", \"value_or_condition\") ,",
376                "\t\t-1,  ",
377                "\t\ttrue",
378                "\t);",
379                "",
380                "",
381                "}"
382               ]
383              },
384              "tooltip_markup" : "Add a flexy if (for HTML templates)",
385              "xtype" : "Button"
386             },
387             {
388              "$ xns" : "Gtk",
389              "label" : "Flexy - Include",
390              "listeners" : {
391               "clicked" : [
392                "  ( ) =>{",
393                " \t_this.AddPropertyPopup.el.hide();",
394                " \t_this.view.popover.show(",
395                "\t\t_this.view.el, ",
396                "\t\t_this.node, ",
397                "\t\t new JsRender.NodeProp.prop(\"flexy:include\", \"string\", \"name_of_file.html\") ,",
398                "\t\t-1,  ",
399                "\t\ttrue",
400                "\t);",
401                "",
402                "  ",
403                "}"
404               ]
405              },
406              "tooltip_markup" : "Add a flexy include (for HTML templates)",
407              "xtype" : "Button"
408             },
409             {
410              "$ xns" : "Gtk",
411              "label" : "Flexy - Foreach",
412              "listeners" : {
413               "clicked" : [
414                "  ( ) =>{",
415                " \t_this.AddPropertyPopup.el.hide();",
416                " \t_this.view.popover.show(",
417                "\t\t_this.view.el, ",
418                "\t\t_this.node, ",
419                "\t\t new JsRender.NodeProp.prop(\"flexy:if\", \"string\", \"value_or_condition\") ,",
420                "\t\t-1,  ",
421                "\t\ttrue",
422                "\t);",
423                "  ",
424                "}"
425               ]
426              },
427              "tooltip_markup" : "Add a flexy include (for HTML templates)",
428              "xtype" : "Button"
429             }
430            ],
431            "xtype" : "Box"
432           }
433          ],
434          "xtype" : "Popover"
435         }
436        ],
437        "listeners" : {
438         "clicked" : [
439          "( ) => {",
440          "  //_this.before_edit();",
441          "  ",
442          "        ",
443          "    var p = _this.AddPropertyPopup;",
444          "    ",
445          " //\tGtk.Allocation rect;",
446          "\t//this.el.get_allocation(out rect);",
447          "\tif (p.el.parent == null) {",
448          "\t\t p.el.set_parent(this.el);",
449          "\t }",
450          "    //p.el.set_pointing_to(rect);",
451          "\tp.el.show();",
452          "\tp.el.set_position(Gtk.PositionType.BOTTOM);",
453          "\tp.el.autohide = true;",
454          "     return;",
455          "",
456          "}",
457          ""
458         ]
459        },
460        "string icon_name" : "list-add",
461        "string label" : "Other",
462        "xtype" : "Button"
463       }
464      ],
465      "xtype" : "Box"
466     },
467     {
468      "# bool editing" : false,
469      "$ shadow_type" : "Gtk.ShadowType.IN",
470      "$ xns" : "Gtk",
471      "* init" : [
472       "  {",
473       "  ",
474       "   this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
475       "}",
476       ""
477      ],
478      "bool hexpand" : true,
479      "bool vexpand" : true,
480      "id" : "EditProps",
481      "items" : [
482       {
483        "$ enable_tree_lines" : true,
484        "$ headers_visible" : true,
485        "$ xns" : "Gtk",
486        "* init" : [
487         "{",
488         " ",
489         "  \tthis.css = new Gtk.CssProvider();",
490         "\t ",
491         "\t\tthis.css.load_from_string(\"",
492         "#leftprops-view { font-size: 12px;}",
493         "\t ",
494         "#leftprops-view  dropdown button { ",
495         "\t\t\tmin-height: 16px;\t\t\t ",
496         "\t\t\toutline-offset : 0;",
497         "\t\t}",
498         "#leftprops-view cell dropdown label  {",
499         " \t\tpadding-top:0px;",
500         "\t\tpadding-bottom:0px;",
501         "}",
502         "#leftprops-view cell   { ",
503         " \t\tpadding-top:2px;",
504         "\t\tpadding-bottom:2px;",
505         "\t\t}",
506         "#leftprops-view cell label,  #leftprops-view cell editablelable {",
507         " \t\tpadding-top:4px;",
508         "\t\tpadding-bottom:4px;",
509         "}\");",
510         " ",
511         "\t\tGtk.StyleContext.add_provider_for_display(",
512         "\t\tthis.el.get_display(),",
513         "\t\tthis.css,",
514         "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
515         "\t);",
516         "\t\t",
517         "   ",
518         "}",
519         ""
520        ],
521        "* pack" : "set_child",
522        "Gtk.CssProvider css" : "",
523        "Xcls_PopoverProperty popover" : "null",
524        "bool hexpand" : true,
525        "bool show_row_separators" : true,
526        "bool single_click_activate" : false,
527        "bool vexpand" : true,
528        "id" : "view",
529        "items" : [
530         {
531          "$ xns" : "Gtk",
532          "* pack" : false,
533          "id" : "deletemenu",
534          "items" : [
535           {
536            "$ xns" : "Gtk",
537            "* prop" : "child",
538            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
539            "int spacing" : 0,
540            "items" : [
541             {
542              "$ xns" : "Gtk",
543              "listeners" : {
544               "clicked" : [
545                "( ) => {",
546                "\t",
547                "",
548                "\tvar n = (JsRender.NodeProp) _this.selmodel.el.selected_item;",
549                "",
550                "\t_this.deletemenu.el.hide();",
551                "\t_this.node.remove_prop(n);",
552                "}",
553                ""
554               ]
555              },
556              "string label" : "Delete",
557              "xtype" : "Button"
558             }
559            ],
560            "xtype" : "Box"
561           }
562          ],
563          "xtype" : "Popover"
564         },
565         {
566          "$ xns" : "Gtk",
567          "listeners" : {
568           "pressed" : [
569            "(n_press, in_x, in_y) => {",
570            "",
571            "\tGLib.debug(\"Prssed %d\", (int)  this.el.get_current_button());",
572            "\t",
573            "\tvar col = _this.view.getColAt(in_x, in_y);",
574            "\tif (col != 0) {",
575            "\t\treturn;",
576            "\t}",
577            "\tstring pos;",
578            "\tvar row = _this.view.getRowAt(in_x, in_y, out pos);",
579            "\t",
580            "\tif (row < 0) {",
581            "\t\treturn;",
582            "",
583            "\t}",
584            "\tGLib.debug(\"hit row %d\", row);",
585            "\tvar prop = _this.selmodel.getPropAt(row);",
586            "\t_this.selmodel.selectProp(prop);",
587            "",
588            "\t//var point_at = _this.view.getWidgetAtRow(row);",
589            "\t",
590            "\t    \t// need to shift down, as ev.y does not inclucde header apparently..",
591            "     \t// or popover might be trying to do a central?",
592            "//\t _this.view.editPropertyDetails(prop, (int) in_y + 12); ",
593            "  \t _this.stop_editor();",
594            "     _this.view.popover.show(",
595            " \t\t\t_this.view.el, ",
596            " \t\t\t_this.node, prop,  ",
597            "\t\t (int)in_y);",
598            "    ",
599            "    ",
600            "      ",
601            "}",
602            ""
603           ]
604          },
605          "xtype" : "GestureClick"
606         },
607         {
608          "$ xns" : "Gtk",
609          "listeners" : {
610           "pressed" : [
611            "(n_press, in_x, in_y) => {",
612            "",
613            "\t",
614            "\t ",
615            "\tstring pos;",
616            "\tvar row = _this.view.getRowAt(in_x, in_y, out pos);",
617            "\t",
618            "\tif (row < 0) {",
619            "\t\treturn;",
620            "",
621            "\t}",
622            "\t",
623            "\t_this.stop_editor();",
624            "\tGLib.debug(\"hit row %d\", row);",
625            "\tvar prop = _this.selmodel.getPropAt(row);",
626            "\t_this.selmodel.selectProp(prop);",
627            "\t",
628            "\t",
629            "\t",
630            "\tGLib.debug(\"Prssed %d\", (int)  this.el.get_current_button());",
631            "\t//_this.deletemenu.el.set_parent(_this.view.el);",
632            "\tif (_this.deletemenu.el.parent == null) {",
633            "\t\t_this.deletemenu.el.set_parent(_this.main_window.el);",
634            "\t}",
635            "\t",
636            "\t",
637            "\t ",
638            "\t_this.deletemenu.el.set_offset(",
639            "\t\t\t(int)in_x  - _this.view.el.get_width() ,",
640            "\t\t\t(int)in_y - _this.view.el.get_height()",
641            "\t\t);",
642            "\t_this.deletemenu.el.set_position(Gtk.PositionType.BOTTOM); ",
643            "    _this.deletemenu.el.popup();",
644            "      ",
645            "}",
646            ""
647           ]
648          },
649          "uint button" : 3,
650          "xtype" : "GestureClick"
651         },
652         {
653          "$ xns" : "Gtk",
654          "* prop" : "model",
655          "bool can_unselect" : true,
656          "id" : "selmodel",
657          "items" : [
658           {
659            "$ xns" : "GLib",
660            "* ctor" : "new GLib.ListStore(typeof(JsRender.NodeProp))",
661            "* prop" : "model",
662            "id" : "model",
663            "xtype" : "ListStore"
664           }
665          ],
666          "xtype" : "SingleSelection",
667          "| JsRender.NodeProp getPropAt" : [
668           "(uint row) {",
669           "",
670           "\treturn   (JsRender.NodeProp) this.el.get_item(row);",
671           "",
672           "\t ",
673           "}"
674          ],
675          "| void selectProp" : [
676           "(JsRender.NodeProp prop) {",
677           "\tfor (var i = 0 ; i < this.el.n_items; i++) {",
678           "\t\tvar r = (JsRender.NodeProp)this.el.get_item(i);",
679           "\t\tif (r.equals(prop)) {",
680           "\t\t\tthis.el.selected = i;",
681           "\t\t\treturn;",
682           "\t\t}",
683           "\t}",
684           "\t ",
685           "}"
686          ],
687          "| void startEditing" : [
688           "(JsRender.NodeProp prop) {",
689           "\t// should we call select?? - caller does int (from windowstate)",
690           "\t",
691           "}"
692          ]
693         },
694         {
695          "$ xns" : "Gtk",
696          "* pack" : "append_column",
697          "bool expand" : true,
698          "bool resizable" : true,
699          "id" : "keycol",
700          "items" : [
701           {
702            "$ xns" : "Gtk",
703            "* prop" : "factory",
704            "listeners" : {
705             "bind" : [
706              "(listitem) => {",
707              " var lb = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
708              " var item = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();",
709              "",
710              "",
711              "item.bind_property(\"to_display_name_prop\",",
712              "                    lb, \"label\",",
713              "                   GLib.BindingFlags.SYNC_CREATE);",
714              "item.bind_property(\"to_tooltip_name_prop\",",
715              "                    lb, \"tooltip_markup\",",
716              "                   GLib.BindingFlags.SYNC_CREATE);",
717              "// was item (1) in old layout",
718              " ",
719              "",
720              "}",
721              ""
722             ],
723             "setup" : [
724              "(listitem) => {",
725              "\tvar lbl = new Gtk.Label(\"\");",
726              " \t((Gtk.ListItem)listitem).set_child(lbl);",
727              " \tlbl.justify = Gtk.Justification.LEFT;",
728              " \tlbl.xalign = 1;",
729              " \tlbl.use_markup = true;",
730              "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
731              " \t/*lbl.changed.connect(() => {",
732              "\t\t// notify and save the changed value...",
733              "\t \t//var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem.get_item());",
734              "         ",
735              "        //prop.val = lbl.text;",
736              "        //_this.updateIter(iter,prop);",
737              "        _this.changed();",
738              "\t});",
739              "\t*/",
740              "\t((Gtk.ListItem)listitem).activatable = true;",
741              "}",
742              ""
743             ]
744            },
745            "xtype" : "SignalListItemFactory"
746           }
747          ],
748          "title" : "Property",
749          "xtype" : "ColumnViewColumn"
750         },
751         {
752          "$ xns" : "Gtk",
753          "* pack" : "append_column",
754          "bool expand" : true,
755          "bool resizable" : true,
756          "id" : "valcol",
757          "items" : [
758           {
759            "$ xns" : "Gtk",
760            "* prop" : "factory",
761            "bool is_setting" : false,
762            "listeners" : {
763             "bind" : [
764              "(listitem) => {",
765              "\t this.is_setting = true;",
766              "",
767              "",
768              "\tvar bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
769              " ",
770              "\t",
771              "\t",
772              "\t",
773              "\tvar elbl = (Gtk.EditableLabel)bx.get_first_child();",
774              "\tvar lbl = (Gtk.Label) elbl.get_next_sibling();",
775              "\tvar cb  = (Gtk.DropDown) lbl.get_next_sibling();",
776              "\t// decide if it's a combo or editable text..",
777              "\tvar model = (Gtk.StringList) cb.model;",
778              " ",
779              "\telbl.hide();",
780              "\tlbl.hide();",
781              "\tcb.hide();",
782              "\t",
783              "\tvar prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();",
784              "\t//GLib.debug(\"prop = %s\", prop.get_type().name());",
785              "\t//GLib.debug(\"prop.val = %s\", prop.val);",
786              "\t//GLib.debug(\"prop.key = %s\", prop.to_display_name());",
787              "\t ",
788              "    var use_textarea =  prop.useTextArea();",
789              "    ",
790              "    ",
791              "    var pal = _this.file.project.palete;",
792              "        ",
793              "    string[] opts;",
794              "    var has_opts = pal.typeOptions(_this.node.fqn(), prop.name, prop.rtype, out opts);",
795              "    ",
796              "    if (!has_opts && prop.ptype == JsRender.NodePropType.RAW) {",
797              "      \tuse_textarea = true;",
798              "    }",
799              "    ",
800              "    ",
801              "    if (use_textarea) {",
802              "    \tprop.bind_property(\"val_short\",",
803              "                    lbl, \"label\",",
804              "                   GLib.BindingFlags.SYNC_CREATE);",
805              "        prop.bind_property(\"val_tooltip\",",
806              "                    lbl, \"tooltip_markup\",",
807              "                   GLib.BindingFlags.SYNC_CREATE);",
808              "        lbl.show();",
809              "\t\tthis.is_setting = false;        ",
810              "        return;",
811              "    \t",
812              "    }",
813              "     ",
814              "        ",
815              "        ",
816              "        ",
817              "        ",
818              "        // others... - fill in options for true/false?",
819              "           // GLib.debug (ktype.up());",
820              "    if (has_opts) {",
821              "\t",
822              "\t\twhile(model.get_n_items() > 0) {",
823              "\t\t\tmodel.remove(0);",
824              "\t\t}",
825              "\t\tcb.show();",
826              " \t\t// can not remove - hopefully always empty.",
827              "\t\tvar sel = -1;",
828              "\t\tfor(var i = 0; i < opts.length; i ++) {",
829              "\t\t\tmodel.append( opts[i]);",
830              "\t\t\t// not sure this is a great idea... ",
831              "\t\t\tif (opts[i].down() == prop.val.down()) {",
832              "\t\t\t\tsel = i;",
833              "\t\t\t}",
834              "\t\t}",
835              "\t\tGLib.debug(\"Set selected item to %d\", sel);",
836              "\t\tcb.set_selected(sel > -1 ? sel : Gtk.INVALID_LIST_POSITION); ",
837              "\t\tthis.is_setting = false;        ",
838              "\t\treturn ;",
839              "    }",
840              "                                  ",
841              "\t// see if type is a Enum.",
842              "\t// triggers a changed event",
843              " ",
844              "\telbl.set_text(prop.val);",
845              " ",
846              "\telbl.show();",
847              "\tthis.is_setting = false;        \t\t ",
848              "\t",
849              "\t",
850              "\t",
851              " ",
852              "",
853              "}",
854              ""
855             ],
856             "setup" : [
857              "(listitem) => {",
858              "\tvar hb = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
859              "\tvar elbl  = new Gtk.EditableLabel(\"\");",
860              "\telbl.hexpand = true;",
861              "\thb.append(elbl);",
862              "\tvar lbl  = new Gtk.Label(\"\");",
863              "\thb.append(lbl);",
864              "\tlbl.hexpand = true;",
865              "\tlbl.use_markup = true;",
866              "\tlbl.xalign =0;",
867              "\tlbl.ellipsize = Pango.EllipsizeMode.END;",
868              "\tvar cb = new Gtk.DropDown(new Gtk.StringList({}), null);",
869              "\tcb.hexpand = true;",
870              " ",
871              "\thb.append(cb);",
872              "\t((Gtk.ListItem)listitem).set_child(hb);",
873              "\t ",
874              "\t var ef = new Gtk.EventControllerFocus();",
875              "\t ef.enter.connect(() => {",
876              " \t\t _this.stop_editor();",
877              " \t\t  var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
878              "\t\t _this.selmodel.selectProp(prop);\t\t",
879              "\t });",
880              "\t elbl.add_controller(ef);",
881              "\t ",
882              "\t ",
883              "\t  // dropdown??? - stop editing, and highliht node",
884              "\t var tb = (Gtk.ToggleButton) cb.get_first_child();",
885              "\t tb.clicked.connect(() => {",
886              "\t\t var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
887              "\t\t\t",
888              "\t \t _this.stop_editor();",
889              "\t \t _this.selmodel.selectProp(prop);",
890              "\t \t ",
891              "\t });",
892              " \telbl.changed.connect(() => {",
893              "\t\t// notify and save the changed value...",
894              "\t \t",
895              "        //_this.updateIter(iter,prop);",
896              "        // this should happen automatically",
897              "        ",
898              "        if (!_this.loading && !this.is_setting) {",
899              "\t\t    var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
900              "\t\t\t ",
901              "\t\t ",
902              "\t\t    prop.val = elbl.text;",
903              "        \t GLib.debug(\"calling changed\");",
904              "\t        _this.changed();",
905              "\t       ",
906              "        }",
907              "        ",
908              "\t});",
909              "\t",
910              "\t",
911              "\tcb.notify[\"selected\"].connect(() => {",
912              "\t\t// dropdown selection changed.",
913              "\t\t",
914              "\t\t",
915              "\t\t",
916              "        //_this.updateIter(iter,prop);",
917              "        if (!_this.loading && !this.is_setting) {",
918              "\t\t    var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
919              "\t\t    var model = (Gtk.StringList)cb.model;",
920              "\t\t    prop.val =   model.get_string(cb.selected);",
921              "\t\t    GLib.debug(\"property set to %s\", prop.val);",
922              "        \tGLib.debug(\"calling changed\");",
923              "\t        _this.changed();",
924              "\t         ",
925              "        }",
926              "        ",
927              "\t\t",
928              "\t});",
929              "\tvar gc = new Gtk.GestureClick();",
930              "\tlbl.add_controller(gc);",
931              "\tgc.pressed.connect(() => {",
932              "\t \tvar prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
933              "\t\t _this.stop_editor();",
934              "\t    _this.show_editor(_this.file, prop.parent, prop);",
935              "\t});",
936              "\t  ",
937              "\t",
938              "\t",
939              "}",
940              ""
941             ]
942            },
943            "xtype" : "SignalListItemFactory"
944           }
945          ],
946          "title" : "Value",
947          "xtype" : "ColumnViewColumn"
948         },
949         {
950          "$ xns" : "Gtk",
951          "* pack" : false,
952          "id" : "ContextMenu",
953          "items" : [
954           {
955            "$ xns" : "Gtk",
956            "* prop" : "child",
957            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
958            "int spacing" : 0,
959            "items" : [
960             {
961              "$ xns" : "Gtk",
962              "label" : "Delete",
963              "listeners" : {
964               "activate" : [
965                "  ( )  =>{",
966                "\t_this.deleteSelected();",
967                "\t",
968                "}"
969               ]
970              },
971              "xtype" : "Button"
972             }
973            ],
974            "xtype" : "Box"
975           }
976          ],
977          "xtype" : "Popover"
978         }
979        ],
980        "string name" : "leftprops-view",
981        "xtype" : "ColumnView",
982        "| Gtk.Widget? getWidgetAtRow" : [
983         "(uint row) {",
984         "/*",
985         "    \t",
986         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
987         "    \tvar colview = gesture.widget;",
988         "    \tvar line_no = check_list_widget(colview, x,y);",
989         "         if (line_no > -1) {",
990         "    \t\tvar item = colview.model.get_item(line_no);",
991         "    \t\t ",
992         "    \t}",
993         "    \t*/",
994         "\t\tGLib.debug(\"Get Widget At Row %d\", (int)row);",
995         "        var  child = this.el.get_first_child(); ",
996         "    \tvar line_no = -1; ",
997         "    \tvar reading_header = true;",
998         "",
999         "    \twhile (child != null) {",
1000         "\t\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1001         "    \t    if (reading_header) {",
1002         "\t\t\t ",
1003         "\t\t\t   ",
1004         "\t\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1005         "\t\t\t\t\tchild = child.get_next_sibling();",
1006         "\t\t\t\t\tcontinue;",
1007         "\t\t\t\t}",
1008         "\t\t\t\tchild = child.get_first_child(); ",
1009         "\t\t\t\treading_header = false;",
1010         "\t\t\t\tcontinue;",
1011         "\t        }",
1012         "\t\t    if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
1013         "    \t\t    child = child.get_next_sibling();",
1014         "    \t\t    continue;",
1015         "\t\t    }",
1016         "\t\t    line_no++;",
1017         "\t\t\tif (line_no == row) {",
1018         "\t\t\t\tGLib.debug(\"Returning widget %s\", child.get_type().name());",
1019         "\t\t\t    return (Gtk.Widget)child;",
1020         "\t\t    }",
1021         "\t        child = child.get_next_sibling(); ",
1022         "    \t}",
1023         "\t\tGLib.debug(\"Rturning null\");",
1024         "        return null;",
1025         "",
1026         " }"
1027        ],
1028        "| int getColAt" : [
1029         "(double x,  double y) {",
1030         "/*",
1031         "    \t",
1032         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1033         "    \t  ",
1034         "    \t*/",
1035         "\t\t//Gtk.Allocation alloc = { 0, 0, 0, 0 };",
1036         "        var  child = this.el.get_first_child(); ",
1037         "    \t ",
1038         "    \tvar col = 0;",
1039         "    \tvar offx = 0;",
1040         "    \twhile (child != null) {",
1041         "\t\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1042         "\t\t\t",
1043         "\t\t\tif (child.get_type().name() == \"GtkColumnViewRowWidget\") {",
1044         "\t\t\t\tchild = child.get_first_child();",
1045         "\t\t\t\tcontinue;",
1046         "\t\t\t}",
1047         "\t\t\t",
1048         "\t\t\t//child.get_allocation(out alloc);",
1049         "\t\t\tif (x <  (child.get_width() + offx)) {",
1050         "\t\t\t\treturn col;",
1051         "\t\t\t}",
1052         "\t\t\toffx += child.get_width();",
1053         "\t\t\tcol++;",
1054         "\t\t\tchild = child.get_next_sibling();",
1055         "\t\t}",
1056         "    \t     ",
1057         "\t\t\t  ",
1058         "        return -1;",
1059         "",
1060         " }"
1061        ],
1062        "| int getRowAt" : [
1063         "(double x,  double in_y, out string pos) {",
1064         "",
1065         "",
1066         "\t ",
1067         "",
1068         "/*",
1069         "    \t",
1070         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1071         "    \tvar colview = gesture.widget;",
1072         "    \tvar line_no = check_list_widget(colview, x,y);",
1073         "         if (line_no > -1) {",
1074         "    \t\tvar item = colview.model.get_item(line_no);",
1075         "    \t\t ",
1076         "    \t}",
1077         "    \t*/",
1078         " \t\t ",
1079         " \t\t",
1080         " \t\t//GLib.debug(\"offset = %d  y = %d\", (int) voff, (int) in_y);",
1081         "    \tvar y = in_y + _this.EditProps.el.vadjustment.value; ",
1082         "        var  child = this.el.get_first_child(); ",
1083         "    \t//Gtk.Allocation alloc = { 0, 0, 0, 0 };",
1084         "    \tvar line_no = -1; ",
1085         "    \tvar reading_header = true;",
1086         "    \tvar real_y = 0;",
1087         "    \tvar header_height  = 0;",
1088         "    \tpos = \"none\";",
1089         "    \tvar h = 0;",
1090         "    \twhile (child != null) {",
1091         "\t\t\t//GLib.debug(\"Got %s\", child.get_type().name());",
1092         "    \t    if (reading_header) {",
1093         "\t\t\t\t",
1094         "",
1095         "\t\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1096         "\t\t\t        h += child.get_height();",
1097         "\t\t\t\t\tchild = child.get_next_sibling();",
1098         "\t\t\t\t\tcontinue;",
1099         "\t\t\t\t}",
1100         "\t\t\t\t// should be columnlistview",
1101         "\t\t\t\tchild = child.get_first_child(); ",
1102         "\t\t\t    GLib.debug(\"header height=%d\", h);",
1103         "\t\t\t\theader_height =  h;",
1104         "\t\t\t\t",
1105         "\t\t\t\treading_header = false;",
1106         "\t\t\t\tcontinue;",
1107         "\t        }",
1108         "\t        ",
1109         "\t\t    if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
1110         "    \t\t    child = child.get_next_sibling();",
1111         "    \t\t    continue;",
1112         "\t\t    }",
1113         "\t\t    ",
1114         "\t\t \tif (y < header_height) {",
1115         "\t\t    \treturn -1;",
1116         "\t    \t}",
1117         "\t\t    ",
1118         "\t\t    line_no++;",
1119         "\t\t\tvar hh = child.get_height();",
1120         "\t\t\t//child.get_allocation(out alloc);",
1121         "\t\t\t//GLib.debug(\"got cell xy = %d,%d  w,h= %d,%d\", alloc.x, alloc.y, alloc.width, alloc.height);",
1122         "\t\t\t//GLib.debug(\"row %d y= %d %s\", line_no, (int) (header_height + alloc.y),",
1123         "\t\t\t",
1124         "\t\t\t//\tchild.visible ? \"VIS\" : \"hidden\");",
1125         "",
1126         "\t\t    if (y >  (header_height + real_y) && y <= (header_height +  real_y + hh) ) {",
1127         "\t\t    \tif (y > ( header_height + real_y + (hh * 0.8))) {",
1128         "\t\t    \t\tpos = \"below\";",
1129         "\t    \t\t} else if (y > ( header_height + real_y + (hh * 0.2))) {",
1130         "\t    \t\t\tpos = \"over\";",
1131         "    \t\t\t} else {",
1132         "    \t\t\t\tpos = \"above\";",
1133         "\t\t\t\t}",
1134         "\t\t    \t GLib.debug(\"getRowAt return : %d, %s\", line_no, pos);",
1135         "\t\t\t    return line_no;",
1136         "\t\t    }",
1137         " ",
1138         "",
1139         "\t\t    if (real_y + hh > y) {",
1140         "\t\t        return -1;",
1141         "\t        }",
1142         "\t        real_y += hh;",
1143         "\t        child = child.get_next_sibling(); ",
1144         "    \t}",
1145         "        return -1;",
1146         "",
1147         " }"
1148        ],
1149        "| void editProp" : [
1150         "(JsRender.NodeProp prop) ",
1151         "{",
1152         "\tvar sm = _this.selmodel.el;",
1153         " ",
1154         "\t\tvar sr = -1;",
1155         "\t\tGLib.debug(\"finding node\");",
1156         "\t\t_this.selmodel.selectProp(prop);",
1157         "\t\t",
1158         "\t\tfor (var i = 0 ; i < sm.n_items; i++) {",
1159         "\t\t\tvar r = (JsRender.NodeProp)sm.get_item(i);",
1160         "\t\t\tif (r.equals(prop)) {",
1161         "\t\t\t\tsr = i;",
1162         "\t\t\t\tbreak;",
1163         "\t\t\t}",
1164         "\t\t}",
1165         "\t\tif (sr < 0) {",
1166         "\t\t\tGLib.debug(\"finding node - cant find it\");",
1167         "\t\t\t \t\t",
1168         "\t\t\treturn;",
1169         "\t\t}",
1170         "\t\tvar r = this.getWidgetAtRow(sr);",
1171         "\t\tGLib.debug(\"r = %s\", r.get_type().name());",
1172         "\t\tvar ca = r.get_first_child();",
1173         "\t\tvar ll = (Gtk.Label)ca.get_first_child();",
1174         "\t\tvar cb = ca.get_next_sibling();",
1175         "\t\tvar b = cb.get_first_child();",
1176         "\t\tvar e = (Gtk.EditableLabel) b.get_first_child();",
1177         "\t\tvar l = (Gtk.Label) e.get_next_sibling();",
1178         "\t\tvar d = (Gtk.DropDown) l.get_next_sibling();",
1179         "\t\t",
1180         "\t\tGLib.debug(\"row key = %s\", ll.label);",
1181         "\t\tif (e.get_visible()) {",
1182         "\t\t\t_this.stop_editor();",
1183         "\t\t\te.start_editing();",
1184         "\t\t\t//GLib.Timeout.add_once(500, () => {",
1185         "\t\t\t//\tvar st = (Gtk.Stack) e.get_first_child();",
1186         "\t\t\t//\tvar ed = (Gtk.Entry) st.get_visible_child();",
1187         "\t\t\t//\ted.grab_focus_without_selecting();",
1188         "\t\t\t//});",
1189         "\t\t\treturn;",
1190         "\t\t}",
1191         "\t\tif (d.get_visible()) {",
1192         "\t\t\t_this.stop_editor();",
1193         "\t\t\td.activate();",
1194         "\t\t\treturn;",
1195         "\t\t}",
1196         "\t\tif (l.get_visible()) {",
1197         "\t\t \t_this.stop_editor();",
1198         "\t    \t_this.show_editor(_this.file, prop.parent, prop);",
1199         "\t\t",
1200         "\t\t}",
1201         "\t\t",
1202         "\t\t",
1203         "\t\t",
1204         "\t\t//gtkcolumnviewrowwidget",
1205         "\t\t  // cell widet",
1206         "\t\t  // cell widget",
1207         "\t\t  \t// box",
1208         "\t\t  \t\t// entry / label / dropdown",
1209         "\t\t \t\t",
1210         "\t\t ",
1211         "}"
1212        ]
1213       }
1214      ],
1215      "xtype" : "ScrolledWindow"
1216     }
1217    ],
1218    "xtype" : "Box",
1219    "| string keyFormat" : [
1220     "(string val, string type) {",
1221     "    ",
1222     "    // Glib.markup_escape_text(val);",
1223     "",
1224     "    if (type == \"listener\") {",
1225     "        return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + ",
1226     "            GLib.Markup.escape_text(val) +",
1227     "             \"</span>\";",
1228     "    }",
1229     "    // property..",
1230     "    if (val.length < 1) {",
1231     "        return \"<span  color=\\\"#FF0000\\\">--empty--</span>\";",
1232     "    }",
1233     "    ",
1234     "    //@ = signal",
1235     "    //$ = property with ",
1236     "    //# - object properties",
1237     "    //* = special",
1238     "    // all of these... - display value is last element..",
1239     "    var ar = val.strip().split(\" \");",
1240     "    ",
1241     "    ",
1242     "    var dval = GLib.Markup.escape_text(ar[ar.length-1]);",
1243     "    ",
1244     "    ",
1245     "    ",
1246     "    ",
1247     "    switch(val[0]) {",
1248     "        case '@': // signal // just bold balck?",
1249     "            if (dval[0] == '@') {",
1250     "                dval = dval.substring(1);",
1251     "            }",
1252     "        ",
1253     "            return @\"<span  font_weight=\\\"bold\\\">@ $dval</span>\";        ",
1254     "        case '#': // object properties?",
1255     "            if (dval[0] == '#') {",
1256     "                dval = dval.substring(1);",
1257     "            }",
1258     "            return @\"<span  font_weight=\\\"bold\\\">$dval</span>\";",
1259     "        case '*': // special",
1260     "            if (dval[0] == '*') {",
1261     "                dval = dval.substring(1);",
1262     "            }",
1263     "            return @\"<span   color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\";            ",
1264     "        case '$':",
1265     "            if (dval[0] == '$') {",
1266     "                dval = dval.substring(1);",
1267     "            }",
1268     "            return @\"<span   style=\\\"italic\\\">$dval</span>\";",
1269     "       case '|': // user defined methods",
1270     "            if (dval[0] == '|') {",
1271     "                dval = dval.substring(1);",
1272     "            }",
1273     "            return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";",
1274     "            ",
1275     "              ",
1276     "            ",
1277     "        default:",
1278     "            return dval;",
1279     "    }",
1280     "      ",
1281     "    ",
1282     "",
1283     "}"
1284    ],
1285    "| string keySortFormat" : [
1286     "(string key) {",
1287     "    // listeners first - with 0",
1288     "    // specials",
1289     "    if (key[0] == '*') {",
1290     "        return \"1 \" + key;",
1291     "    }",
1292     "    // functions",
1293     "    ",
1294     "    var bits = key.split(\" \");",
1295     "    ",
1296     "    if (key[0] == '|') {",
1297     "        return \"2 \" + bits[bits.length -1];",
1298     "    }",
1299     "    // signals",
1300     "    if (key[0] == '@') {",
1301     "        return \"3 \" + bits[bits.length -1];",
1302     "    }",
1303     "        ",
1304     "    // props",
1305     "    if (key[0] == '#') {",
1306     "        return \"4 \" + bits[bits.length -1];",
1307     "    }",
1308     "    // the rest..",
1309     "    return \"5 \" + bits[bits.length -1];    ",
1310     "",
1311     "",
1312     "",
1313     "}"
1314    ],
1315    "| void a_addProp" : [
1316     " (JsRender.NodeProp prop) {",
1317     "      // info includes key, val, skel, etype..",
1318     "      //console.dump(info);",
1319     "        //type = info.type.toLowerCase();",
1320     "        //var data = this.toJS();",
1321     "          ",
1322     "              ",
1323     "    if (prop.ptype == JsRender.NodePropType.LISTENER) {",
1324     "        if (this.node.listeners.has_key(prop.name)) {",
1325     "            return;",
1326     "        }",
1327     "        this.node.listeners.set(prop.name,prop);",
1328     "    } else  {",
1329     "         assert(this.node != null);",
1330     "         assert(this.node.props != null);",
1331     "        if (this.node.props.has_key(prop.to_index_key())) {",
1332     "            return;",
1333     "        }",
1334     "        this.node.props.set(prop.to_index_key(),prop);",
1335     "    }",
1336     "            ",
1337     "      ",
1338     "    // add a row???",
1339     "    this.load(this.file, this.node);",
1340     "    ",
1341     "    ",
1342     "     ",
1343     "    ",
1344     "    GLib.debug(\"trying to find new iter\");",
1345     " ",
1346     "    ",
1347     "              ",
1348     "}",
1349     ""
1350    ],
1351    "| void deleteSelected" : [
1352     " () {",
1353     "    ",
1354     "\t\treturn;",
1355     "\t\t/*",
1356     "        ",
1357     "        Gtk.TreeIter iter;",
1358     "        Gtk.TreeModel mod;",
1359     "        ",
1360     "        var s = this.view.el.get_selection();",
1361     "        s.get_selected(out mod, out iter);",
1362     "             ",
1363     "              ",
1364     "        GLib.Value gval;",
1365     "        mod.get_value(iter, 0 , out gval);",
1366     "        var prop = (JsRender.NodeProp)gval;",
1367     "        if (prop == null) {",
1368     "\t        this.load(this.file, this.node);    ",
1369     "        \treturn;",
1370     "    \t}",
1371     "    \t// stop editor after fetching property - otherwise prop is null.",
1372     "        this.stop_editor();",
1373     "        ",
1374     "            \t",
1375     "        switch(prop.ptype) {",
1376     "            case JsRender.NodePropType.LISTENER:",
1377     "                this.node.listeners.unset(prop.to_index_key());",
1378     "                break;",
1379     "                ",
1380     "            default:",
1381     "                this.node.props.unset(prop.to_index_key());",
1382     "                break;",
1383     "        }",
1384     "        this.load(this.file, this.node);",
1385     "        ",
1386     "        _this.changed();",
1387     "        */",
1388     "}"
1389    ],
1390    "| void load" : [
1391     "(JsRender.JsRender file, JsRender.Node? node) ",
1392     "{",
1393     "\t// not sure when to initialize this - we should do it on setting main window really.    ",
1394     "\t",
1395     "\tthis.loading = true;",
1396     "    if (this.view.popover == null) {",
1397     " \t\t   this.view.popover = new Xcls_PopoverProperty();",
1398     " \t\t   this.view.popover.mainwindow = _this.main_window;",
1399     "\t}",
1400     "    ",
1401     "    ",
1402     "    if (this.node != null) {",
1403     "    \tthis.node.dupeProps(); // ensures removeall will not do somethign silly",
1404     "    \t",
1405     "    }",
1406     "    ",
1407     "    GLib.debug(\"load leftprops\\n\");",
1408     "",
1409     "    this.node = node;",
1410     "    this.file = file;",
1411     "    ",
1412     " ",
1413     "    this.model.el.remove_all();",
1414     "              ",
1415     "    //this.get('/RightEditor').el.hide();",
1416     "    if (node ==null) {",
1417     "        return ;",
1418     "    }",
1419     "    node.loadProps(this.model.el); ",
1420     "    ",
1421     "    ",
1422     "   //GLib.debug(\"clear selection\\n\");",
1423     "   ",
1424     "   \tthis.loading = false;",
1425     "    this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);",
1426     "    this.updateErrors();",
1427     "   // clear selection?",
1428     "  //this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..",
1429     "   ",
1430     "   // this.view.el.get_selection().unselect_all();",
1431     "   ",
1432     "  // _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1433     "  // _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1434     "   ",
1435     "}",
1436     ""
1437    ],
1438    "| void removeErrors" : [
1439     "() {",
1440     "\tvar  child = this.view.el.get_first_child(); ",
1441     " ",
1442     "\tvar reading_header = true;",
1443     " ",
1444     "\twhile (child != null) {",
1445     "\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1446     "\t   ",
1447     "\t   if (reading_header) {",
1448     "\t\t\t",
1449     "",
1450     "\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1451     "\t\t\t   ",
1452     "\t\t\t\tchild = child.get_next_sibling();",
1453     "\t\t\t\tcontinue;",
1454     "\t\t\t}",
1455     "\t\t\t// should be columnlistview",
1456     "\t\t\tchild = child.get_first_child(); ",
1457     "\t\t ",
1458     "\t\t ",
1459     "\t\t\t",
1460     "\t\t\treading_header = false;",
1461     "\t\t\t ",
1462     "\t    }",
1463     "\t    ",
1464     "\t  \tif (!child.has_css_class(\"error-node\")) {",
1465     "\t\t\tchild.remove_css_class(\"error-node\");",
1466     "\t\t}",
1467     "\t\t",
1468     "        child = child.get_next_sibling(); ",
1469     "\t}",
1470     "\t//GLib.debug(\"Rturning null\");",
1471     "     ",
1472     "}"
1473    ],
1474    "| void updateErrors" : [
1475     "() {",
1476     "\tvar file = this.file;",
1477     "\tvar ar = file.getErrors();",
1478     "\tif (ar.size < 1) {",
1479     "\t\tthis.removeErrors();",
1480     "\t\tthis.last_error_counter = file.error_counter ;",
1481     "",
1482     "\t\treturn;",
1483     "\t}",
1484     " \tif (this.last_error_counter == file.error_counter) {",
1485     "\t\treturn;",
1486     "\t}",
1487     "\tthis.removeErrors();",
1488     "\t",
1489     "\tforeach(var diag in ar) { ",
1490     "\t",
1491     "\t\t ",
1492     "//        print(\"get inter\\n\");",
1493     "\t    var node= file.lineToNode( (int)diag.range.start.line) ;",
1494     "\t    if (node == null || node.oid != this.node.oid) {",
1495     "\t    \tcontinue;",
1496     "    \t}",
1497     "    \tvar prop = node.lineToProp( (int)diag.range.start.line) ;",
1498     "    \t",
1499     "    \tvar row = _this.selmodel.propToRow(prop);",
1500     "    \tif (row < 0) {",
1501     "    \t\tcontinue;",
1502     "\t\t}",
1503     "    \tvar w = this.view.getWidgetAtRow(row);",
1504     "    \tif (w == null) {",
1505     "    \t\treturn;",
1506     "\t\t}",
1507     "\t\tif (!w.has_css_class(\"node-error\")) {",
1508     "\t\t\tw.add_css_class(\"node-error\");",
1509     "\t\t}",
1510     "\t\t",
1511     "\t}",
1512     "\t",
1513     "}"
1514    ]
1515   }
1516  ],
1517  "name" : "WindowLeftProps"
1518 }