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