fix line numbering issues with vala generator - hopefully fixes completion in node...
[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          "",
448          "\t p.el.set_parent(this.el);",
449          "    //p.el.set_pointing_to(rect);",
450          "\tp.el.show();",
451          "\tp.el.set_position(Gtk.PositionType.BOTTOM);",
452          "\tp.el.autohide = true;",
453          "     return;",
454          "",
455          "}",
456          ""
457         ]
458        },
459        "string icon_name" : "list-add",
460        "string label" : "Other",
461        "xtype" : "Button"
462       }
463      ],
464      "xtype" : "Box"
465     },
466     {
467      "# bool editing" : false,
468      "$ shadow_type" : "Gtk.ShadowType.IN",
469      "$ xns" : "Gtk",
470      "* init" : [
471       "  {",
472       "  ",
473       "   this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
474       "}",
475       ""
476      ],
477      "bool hexpand" : true,
478      "bool vexpand" : true,
479      "id" : "EditProps",
480      "items" : [
481       {
482        "$ enable_tree_lines" : true,
483        "$ headers_visible" : true,
484        "$ xns" : "Gtk",
485        "* init" : [
486         "{",
487         " ",
488         "  \tthis.css = new Gtk.CssProvider();",
489         "\t ",
490         "\t\tthis.css.load_from_string(\"",
491         "#leftprops-view { font-size: 12px;}",
492         "\t ",
493         "#leftprops-view  dropdown button { ",
494         "\t\t\tmin-height: 16px;\t\t\t ",
495         "\t\t\toutline-offset : 0;",
496         "\t\t}",
497         "#leftprops-view cell dropdown label  {",
498         " \t\tpadding-top:0px;",
499         "\t\tpadding-bottom:0px;",
500         "}",
501         "#leftprops-view cell   { ",
502         " \t\tpadding-top:2px;",
503         "\t\tpadding-bottom:2px;",
504         "\t\t}",
505         "#leftprops-view cell label,  #leftprops-view cell editablelable {",
506         " \t\tpadding-top:4px;",
507         "\t\tpadding-bottom:4px;",
508         "}\");",
509         " ",
510         "\t\tGtk.StyleContext.add_provider_for_display(",
511         "\t\tthis.el.get_display(),",
512         "\t\tthis.css,",
513         "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
514         "\t);",
515         "\t\t",
516         "   ",
517         "}",
518         ""
519        ],
520        "* pack" : "set_child",
521        "Gtk.CssProvider css" : "",
522        "Xcls_PopoverProperty popover" : "null",
523        "bool hexpand" : true,
524        "bool show_row_separators" : true,
525        "bool single_click_activate" : false,
526        "bool vexpand" : true,
527        "id" : "view",
528        "items" : [
529         {
530          "$ xns" : "Gtk",
531          "* pack" : false,
532          "id" : "deletemenu",
533          "items" : [
534           {
535            "$ xns" : "Gtk",
536            "* prop" : "child",
537            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
538            "int spacing" : 0,
539            "items" : [
540             {
541              "$ xns" : "Gtk",
542              "listeners" : {
543               "clicked" : [
544                "( ) => {",
545                "\t",
546                "",
547                "\tvar n = (JsRender.NodeProp) _this.selmodel.el.selected_item;",
548                "",
549                "\t_this.deletemenu.el.hide();",
550                "\t_this.node.remove_prop(n);",
551                "}",
552                ""
553               ]
554              },
555              "string label" : "Delete",
556              "xtype" : "Button"
557             }
558            ],
559            "xtype" : "Box"
560           }
561          ],
562          "xtype" : "Popover"
563         },
564         {
565          "$ xns" : "Gtk",
566          "listeners" : {
567           "pressed" : [
568            "(n_press, in_x, in_y) => {",
569            "",
570            "\tGLib.debug(\"Prssed %d\", (int)  this.el.get_current_button());",
571            "\t",
572            "\tvar col = _this.view.getColAt(in_x, in_y);",
573            "\tif (col != 0) {",
574            "\t\treturn;",
575            "\t}",
576            "\tstring pos;",
577            "\tvar row = _this.view.getRowAt(in_x, in_y, out pos);",
578            "\t",
579            "\tif (row < 0) {",
580            "\t\treturn;",
581            "",
582            "\t}",
583            "\tGLib.debug(\"hit row %d\", row);",
584            "\tvar prop = _this.selmodel.getPropAt(row);",
585            "\t_this.selmodel.selectProp(prop);",
586            "",
587            "\t//var point_at = _this.view.getWidgetAtRow(row);",
588            "\t",
589            "\t    \t// need to shift down, as ev.y does not inclucde header apparently..",
590            "     \t// or popover might be trying to do a central?",
591            "//\t _this.view.editPropertyDetails(prop, (int) in_y + 12); ",
592            "  \t _this.stop_editor();",
593            "     _this.view.popover.show(",
594            " \t\t\t_this.view.el, ",
595            " \t\t\t_this.node, prop,  ",
596            "\t\t (int)in_y);",
597            "    ",
598            "    ",
599            "      ",
600            "}",
601            ""
602           ]
603          },
604          "xtype" : "GestureClick"
605         },
606         {
607          "$ xns" : "Gtk",
608          "listeners" : {
609           "pressed" : [
610            "(n_press, in_x, in_y) => {",
611            "",
612            "\t",
613            "\t ",
614            "\tstring pos;",
615            "\tvar row = _this.view.getRowAt(in_x, in_y, out pos);",
616            "\t",
617            "\tif (row < 0) {",
618            "\t\treturn;",
619            "",
620            "\t}",
621            "\t",
622            "\t_this.stop_editor();",
623            "\tGLib.debug(\"hit row %d\", row);",
624            "\tvar prop = _this.selmodel.getPropAt(row);",
625            "\t_this.selmodel.selectProp(prop);",
626            "\t",
627            "\t",
628            "\t",
629            "\tGLib.debug(\"Prssed %d\", (int)  this.el.get_current_button());",
630            "\t//_this.deletemenu.el.set_parent(_this.view.el);",
631            "\t_this.deletemenu.el.set_parent(_this.main_window.el);",
632            "\t",
633            "\t",
634            "\t ",
635            "\t_this.deletemenu.el.set_offset(",
636            "\t\t\t(int)in_x  - _this.view.el.get_width() ,",
637            "\t\t\t(int)in_y - _this.view.el.get_height()",
638            "\t\t);",
639            "\t_this.deletemenu.el.set_position(Gtk.PositionType.BOTTOM); ",
640            "    _this.deletemenu.el.popup();",
641            "      ",
642            "}",
643            ""
644           ]
645          },
646          "uint button" : 3,
647          "xtype" : "GestureClick"
648         },
649         {
650          "$ xns" : "Gtk",
651          "* prop" : "model",
652          "bool can_unselect" : true,
653          "id" : "selmodel",
654          "items" : [
655           {
656            "$ xns" : "GLib",
657            "* ctor" : "new GLib.ListStore(typeof(JsRender.NodeProp))",
658            "* prop" : "model",
659            "id" : "model",
660            "xtype" : "ListStore"
661           }
662          ],
663          "xtype" : "SingleSelection",
664          "| JsRender.NodeProp getPropAt" : [
665           "(uint row) {",
666           "",
667           "\treturn   (JsRender.NodeProp) this.el.get_item(row);",
668           "",
669           "\t ",
670           "}"
671          ],
672          "| void selectProp" : [
673           "(JsRender.NodeProp prop) {",
674           "\tfor (var i = 0 ; i < this.el.n_items; i++) {",
675           "\t\tvar r = (JsRender.NodeProp)this.el.get_item(i);",
676           "\t\tif (r.equals(prop)) {",
677           "\t\t\tthis.el.selected = i;",
678           "\t\t\treturn;",
679           "\t\t}",
680           "\t}",
681           "\t ",
682           "}"
683          ],
684          "| void startEditing" : [
685           "(JsRender.NodeProp prop) {",
686           "\t// should we call select?? - caller does int (from windowstate)",
687           "\t",
688           "}"
689          ]
690         },
691         {
692          "$ xns" : "Gtk",
693          "* pack" : "append_column",
694          "bool expand" : true,
695          "bool resizable" : true,
696          "id" : "keycol",
697          "items" : [
698           {
699            "$ xns" : "Gtk",
700            "* prop" : "factory",
701            "listeners" : {
702             "bind" : [
703              "(listitem) => {",
704              " var lb = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
705              " var item = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();",
706              "",
707              "",
708              "item.bind_property(\"to_display_name_prop\",",
709              "                    lb, \"label\",",
710              "                   GLib.BindingFlags.SYNC_CREATE);",
711              "item.bind_property(\"to_tooltip_name_prop\",",
712              "                    lb, \"tooltip_markup\",",
713              "                   GLib.BindingFlags.SYNC_CREATE);",
714              "// was item (1) in old layout",
715              " ",
716              "",
717              "}",
718              ""
719             ],
720             "setup" : [
721              "(listitem) => {",
722              "\tvar lbl = new Gtk.Label(\"\");",
723              " \t((Gtk.ListItem)listitem).set_child(lbl);",
724              " \tlbl.justify = Gtk.Justification.LEFT;",
725              " \tlbl.xalign = 1;",
726              " \tlbl.use_markup = true;",
727              "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
728              " \t/*lbl.changed.connect(() => {",
729              "\t\t// notify and save the changed value...",
730              "\t \t//var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem.get_item());",
731              "         ",
732              "        //prop.val = lbl.text;",
733              "        //_this.updateIter(iter,prop);",
734              "        _this.changed();",
735              "\t});",
736              "\t*/",
737              "\t((Gtk.ListItem)listitem).activatable = true;",
738              "}",
739              ""
740             ]
741            },
742            "xtype" : "SignalListItemFactory"
743           }
744          ],
745          "title" : "Property",
746          "xtype" : "ColumnViewColumn"
747         },
748         {
749          "$ xns" : "Gtk",
750          "* pack" : "append_column",
751          "bool expand" : true,
752          "bool resizable" : true,
753          "id" : "valcol",
754          "items" : [
755           {
756            "$ xns" : "Gtk",
757            "* prop" : "factory",
758            "bool is_setting" : false,
759            "listeners" : {
760             "bind" : [
761              "(listitem) => {",
762              "\t this.is_setting = true;",
763              "",
764              "",
765              "\tvar bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
766              " ",
767              "\t",
768              "\t",
769              "\t",
770              "\tvar elbl = (Gtk.EditableLabel)bx.get_first_child();",
771              "\tvar lbl = (Gtk.Label) elbl.get_next_sibling();",
772              "\tvar cb  = (Gtk.DropDown) lbl.get_next_sibling();",
773              "\t// decide if it's a combo or editable text..",
774              "\tvar model = (Gtk.StringList) cb.model;",
775              " ",
776              "\telbl.hide();",
777              "\tlbl.hide();",
778              "\tcb.hide();",
779              "\t",
780              "\tvar prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();",
781              "\t//GLib.debug(\"prop = %s\", prop.get_type().name());",
782              "\t//GLib.debug(\"prop.val = %s\", prop.val);",
783              "\t//GLib.debug(\"prop.key = %s\", prop.to_display_name());",
784              "\t ",
785              "    var use_textarea =  prop.useTextArea();",
786              "    ",
787              "    ",
788              "    var pal = _this.file.project.palete;",
789              "        ",
790              "    string[] opts;",
791              "    var has_opts = pal.typeOptions(_this.node.fqn(), prop.name, prop.rtype, out opts);",
792              "    ",
793              "    if (!has_opts && prop.ptype == JsRender.NodePropType.RAW) {",
794              "      \tuse_textarea = true;",
795              "    }",
796              "    ",
797              "    ",
798              "    if (use_textarea) {",
799              "    \tprop.bind_property(\"val_short\",",
800              "                    lbl, \"label\",",
801              "                   GLib.BindingFlags.SYNC_CREATE);",
802              "        prop.bind_property(\"val_tooltip\",",
803              "                    lbl, \"tooltip_markup\",",
804              "                   GLib.BindingFlags.SYNC_CREATE);",
805              "        lbl.show();",
806              "\t\tthis.is_setting = false;        ",
807              "        return;",
808              "    \t",
809              "    }",
810              "     ",
811              "        ",
812              "        ",
813              "        ",
814              "        ",
815              "        // others... - fill in options for true/false?",
816              "           // GLib.debug (ktype.up());",
817              "    if (has_opts) {",
818              "\t",
819              "\t\twhile(model.get_n_items() > 0) {",
820              "\t\t\tmodel.remove(0);",
821              "\t\t}",
822              "\t\tcb.show();",
823              " \t\t// can not remove - hopefully always empty.",
824              "\t\tvar sel = -1;",
825              "\t\tfor(var i = 0; i < opts.length; i ++) {",
826              "\t\t\tmodel.append( opts[i]);",
827              "\t\t\t// not sure this is a great idea... ",
828              "\t\t\tif (opts[i].down() == prop.val.down()) {",
829              "\t\t\t\tsel = i;",
830              "\t\t\t}",
831              "\t\t}",
832              "\t\tGLib.debug(\"Set selected item to %d\", sel);",
833              "\t\tcb.set_selected(sel > -1 ? sel : Gtk.INVALID_LIST_POSITION); ",
834              "\t\tthis.is_setting = false;        ",
835              "\t\treturn ;",
836              "    }",
837              "                                  ",
838              "\t// see if type is a Enum.",
839              "\t// triggers a changed event",
840              " ",
841              "\telbl.set_text(prop.val);",
842              " ",
843              "\telbl.show();",
844              "\tthis.is_setting = false;        \t\t ",
845              "\t",
846              "\t",
847              "\t",
848              " ",
849              "",
850              "}",
851              ""
852             ],
853             "setup" : [
854              "(listitem) => {",
855              "\tvar hb = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
856              "\tvar elbl  = new Gtk.EditableLabel(\"\");",
857              "\telbl.hexpand = true;",
858              "\thb.append(elbl);",
859              "\tvar lbl  = new Gtk.Label(\"\");",
860              "\thb.append(lbl);",
861              "\tlbl.hexpand = true;",
862              "\tlbl.use_markup = true;",
863              "\tlbl.xalign =0;",
864              "\tlbl.ellipsize = Pango.EllipsizeMode.END;",
865              "\tvar cb = new Gtk.DropDown(new Gtk.StringList({}), null);",
866              "\tcb.hexpand = true;",
867              " ",
868              "\thb.append(cb);",
869              "\t((Gtk.ListItem)listitem).set_child(hb);",
870              "\t ",
871              "\t var ef = new Gtk.EventControllerFocus();",
872              "\t ef.enter.connect(() => {",
873              " \t\t _this.stop_editor();",
874              " \t\t  var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
875              "\t\t _this.selmodel.selectProp(prop);\t\t",
876              "\t });",
877              "\t elbl.add_controller(ef);",
878              "\t ",
879              "\t ",
880              "\t  // dropdown??? - stop editing, and highliht node",
881              "\t var tb = (Gtk.ToggleButton) cb.get_first_child();",
882              "\t tb.clicked.connect(() => {",
883              "\t\t var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
884              "\t\t\t",
885              "\t \t _this.stop_editor();",
886              "\t \t _this.selmodel.selectProp(prop);",
887              "\t \t ",
888              "\t });",
889              " \telbl.changed.connect(() => {",
890              "\t\t// notify and save the changed value...",
891              "\t \t",
892              "        //_this.updateIter(iter,prop);",
893              "        // this should happen automatically",
894              "        ",
895              "        if (!_this.loading && !this.is_setting) {",
896              "\t\t    var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
897              "\t\t\t ",
898              "\t\t ",
899              "\t\t    prop.val = elbl.text;",
900              "        \t GLib.debug(\"calling changed\");",
901              "\t        _this.changed();",
902              "\t       ",
903              "        }",
904              "        ",
905              "\t});",
906              "\t",
907              "\t",
908              "\tcb.notify[\"selected\"].connect(() => {",
909              "\t\t// dropdown selection changed.",
910              "\t\t",
911              "\t\t",
912              "\t\t",
913              "        //_this.updateIter(iter,prop);",
914              "        if (!_this.loading && !this.is_setting) {",
915              "\t\t    var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
916              "\t\t    var model = (Gtk.StringList)cb.model;",
917              "\t\t    prop.val =   model.get_string(cb.selected);",
918              "\t\t    GLib.debug(\"property set to %s\", prop.val);",
919              "        \tGLib.debug(\"calling changed\");",
920              "\t        _this.changed();",
921              "\t         ",
922              "        }",
923              "        ",
924              "\t\t",
925              "\t});",
926              "\tvar gc = new Gtk.GestureClick();",
927              "\tlbl.add_controller(gc);",
928              "\tgc.pressed.connect(() => {",
929              "\t \tvar prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
930              "\t\t _this.stop_editor();",
931              "\t    _this.show_editor(_this.file, prop.parent, prop);",
932              "\t});",
933              "\t  ",
934              "\t",
935              "\t",
936              "}",
937              ""
938             ]
939            },
940            "xtype" : "SignalListItemFactory"
941           }
942          ],
943          "title" : "Value",
944          "xtype" : "ColumnViewColumn"
945         },
946         {
947          "$ xns" : "Gtk",
948          "* pack" : false,
949          "id" : "ContextMenu",
950          "items" : [
951           {
952            "$ xns" : "Gtk",
953            "* prop" : "child",
954            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
955            "int spacing" : 0,
956            "items" : [
957             {
958              "$ xns" : "Gtk",
959              "label" : "Delete",
960              "listeners" : {
961               "activate" : [
962                "  ( )  =>{",
963                "\t_this.deleteSelected();",
964                "\t",
965                "}"
966               ]
967              },
968              "xtype" : "Button"
969             }
970            ],
971            "xtype" : "Box"
972           }
973          ],
974          "xtype" : "Popover"
975         }
976        ],
977        "string name" : "leftprops-view",
978        "xtype" : "ColumnView",
979        "| Gtk.Widget? getWidgetAtRow" : [
980         "(uint row) {",
981         "/*",
982         "    \t",
983         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
984         "    \tvar colview = gesture.widget;",
985         "    \tvar line_no = check_list_widget(colview, x,y);",
986         "         if (line_no > -1) {",
987         "    \t\tvar item = colview.model.get_item(line_no);",
988         "    \t\t ",
989         "    \t}",
990         "    \t*/",
991         "\t\tGLib.debug(\"Get Widget At Row %d\", (int)row);",
992         "        var  child = this.el.get_first_child(); ",
993         "    \tvar line_no = -1; ",
994         "    \tvar reading_header = true;",
995         "",
996         "    \twhile (child != null) {",
997         "\t\t\tGLib.debug(\"Got %s\", child.get_type().name());",
998         "    \t    if (reading_header) {",
999         "\t\t\t ",
1000         "\t\t\t   ",
1001         "\t\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1002         "\t\t\t\t\tchild = child.get_next_sibling();",
1003         "\t\t\t\t\tcontinue;",
1004         "\t\t\t\t}",
1005         "\t\t\t\tchild = child.get_first_child(); ",
1006         "\t\t\t\treading_header = false;",
1007         "\t        }",
1008         "\t\t    if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
1009         "    \t\t    child = child.get_next_sibling();",
1010         "    \t\t    continue;",
1011         "\t\t    }",
1012         "\t\t    line_no++;",
1013         "\t\t\tif (line_no == row) {",
1014         "\t\t\t\tGLib.debug(\"Returning widget %s\", child.get_type().name());",
1015         "\t\t\t    return (Gtk.Widget)child;",
1016         "\t\t    }",
1017         "\t        child = child.get_next_sibling(); ",
1018         "    \t}",
1019         "\t\tGLib.debug(\"Rturning null\");",
1020         "        return null;",
1021         "",
1022         " }"
1023        ],
1024        "| int getColAt" : [
1025         "(double x,  double y) {",
1026         "/*",
1027         "    \t",
1028         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1029         "    \t  ",
1030         "    \t*/",
1031         "\t\t//Gtk.Allocation alloc = { 0, 0, 0, 0 };",
1032         "        var  child = this.el.get_first_child(); ",
1033         "    \t ",
1034         "    \tvar col = 0;",
1035         "    \tvar offx = 0;",
1036         "    \twhile (child != null) {",
1037         "\t\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1038         "\t\t\t",
1039         "\t\t\tif (child.get_type().name() == \"GtkColumnViewRowWidget\") {",
1040         "\t\t\t\tchild = child.get_first_child();",
1041         "\t\t\t\tcontinue;",
1042         "\t\t\t}",
1043         "\t\t\t",
1044         "\t\t\t//child.get_allocation(out alloc);",
1045         "\t\t\tif (x <  (child.get_width() + offx)) {",
1046         "\t\t\t\treturn col;",
1047         "\t\t\t}",
1048         "\t\t\toffx += child.get_width();",
1049         "\t\t\tcol++;",
1050         "\t\t\tchild = child.get_next_sibling();",
1051         "\t\t}",
1052         "    \t     ",
1053         "\t\t\t  ",
1054         "        return -1;",
1055         "",
1056         " }"
1057        ],
1058        "| int getRowAt" : [
1059         "(double x,  double in_y, out string pos) {",
1060         "",
1061         "",
1062         "\t ",
1063         "",
1064         "/*",
1065         "    \t",
1066         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1067         "    \tvar colview = gesture.widget;",
1068         "    \tvar line_no = check_list_widget(colview, x,y);",
1069         "         if (line_no > -1) {",
1070         "    \t\tvar item = colview.model.get_item(line_no);",
1071         "    \t\t ",
1072         "    \t}",
1073         "    \t*/",
1074         " \t\t ",
1075         " \t\t",
1076         " \t\t//GLib.debug(\"offset = %d  y = %d\", (int) voff, (int) in_y);",
1077         "    \tvar y = in_y + _this.EditProps.el.vadjustment.value; ",
1078         "        var  child = this.el.get_first_child(); ",
1079         "    \t//Gtk.Allocation alloc = { 0, 0, 0, 0 };",
1080         "    \tvar line_no = -1; ",
1081         "    \tvar reading_header = true;",
1082         "    \tvar real_y = 0;",
1083         "    \tvar header_height  = 0;",
1084         "    \tpos = \"none\";",
1085         "    \tvar h = 0;",
1086         "    \twhile (child != null) {",
1087         "\t\t\t//GLib.debug(\"Got %s\", child.get_type().name());",
1088         "    \t    if (reading_header) {",
1089         "\t\t\t\t",
1090         "",
1091         "\t\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1092         "\t\t\t        h += child.get_height();",
1093         "\t\t\t\t\tchild = child.get_next_sibling();",
1094         "\t\t\t\t\tcontinue;",
1095         "\t\t\t\t}",
1096         "\t\t\t\t// should be columnlistview",
1097         "\t\t\t\tchild = child.get_first_child(); ",
1098         "\t\t\t    GLib.debug(\"header height=%d\", h);",
1099         "\t\t\t\theader_height =  h;",
1100         "\t\t\t\t",
1101         "\t\t\t\treading_header = false;",
1102         "\t\t\t\t",
1103         "\t        }",
1104         "\t        ",
1105         "\t\t    if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
1106         "    \t\t    child = child.get_next_sibling();",
1107         "    \t\t    continue;",
1108         "\t\t    }",
1109         "\t\t    ",
1110         "\t\t \tif (y < header_height) {",
1111         "\t\t    \treturn -1;",
1112         "\t    \t}",
1113         "\t\t    ",
1114         "\t\t    line_no++;",
1115         "\t\t\tvar hh = child.get_height();",
1116         "\t\t\t//child.get_allocation(out alloc);",
1117         "\t\t\t//GLib.debug(\"got cell xy = %d,%d  w,h= %d,%d\", alloc.x, alloc.y, alloc.width, alloc.height);",
1118         "\t\t\t//GLib.debug(\"row %d y= %d %s\", line_no, (int) (header_height + alloc.y),",
1119         "\t\t\t",
1120         "\t\t\t//\tchild.visible ? \"VIS\" : \"hidden\");",
1121         "",
1122         "\t\t    if (y >  (header_height + real_y) && y <= (header_height +  real_y + hh) ) {",
1123         "\t\t    \tif (y > ( header_height + real_y + (hh * 0.8))) {",
1124         "\t\t    \t\tpos = \"below\";",
1125         "\t    \t\t} else if (y > ( header_height + real_y + (hh * 0.2))) {",
1126         "\t    \t\t\tpos = \"over\";",
1127         "    \t\t\t} else {",
1128         "    \t\t\t\tpos = \"above\";",
1129         "\t\t\t\t}",
1130         "\t\t    \t GLib.debug(\"getRowAt return : %d, %s\", line_no, pos);",
1131         "\t\t\t    return line_no;",
1132         "\t\t    }",
1133         " ",
1134         "",
1135         "\t\t    if (real_y + hh > y) {",
1136         "\t\t        return -1;",
1137         "\t        }",
1138         "\t        real_y += hh;",
1139         "\t        child = child.get_next_sibling(); ",
1140         "    \t}",
1141         "        return -1;",
1142         "",
1143         " }"
1144        ],
1145        "| void editProp" : [
1146         "(JsRender.NodeProp prop) ",
1147         "{",
1148         "\tvar sm = _this.selmodel.el;",
1149         " ",
1150         "\t\tvar sr = -1;",
1151         "\t\tGLib.debug(\"finding node\");",
1152         "\t\t_this.selmodel.selectProp(prop);",
1153         "\t\t",
1154         "\t\tfor (var i = 0 ; i < sm.n_items; i++) {",
1155         "\t\t\tvar r = (JsRender.NodeProp)sm.get_item(i);",
1156         "\t\t\tif (r.equals(prop)) {",
1157         "\t\t\t\tsr = i;",
1158         "\t\t\t\tbreak;",
1159         "\t\t\t}",
1160         "\t\t}",
1161         "\t\tif (sr < 0) {",
1162         "\t\t\tGLib.debug(\"finding node - cant find it\");",
1163         "\t\t\t \t\t",
1164         "\t\t\treturn;",
1165         "\t\t}",
1166         "\t\tvar r = this.getWidgetAtRow(sr);",
1167         "\t\tGLib.debug(\"r = %s\", r.get_type().name());",
1168         "\t\tvar ca = r.get_first_child();",
1169         "\t\tvar ll = (Gtk.Label)ca.get_first_child();",
1170         "\t\tvar cb = ca.get_next_sibling();",
1171         "\t\tvar b = cb.get_first_child();",
1172         "\t\tvar e = (Gtk.Entry) b.get_first_child();",
1173         "\t\tvar l = (Gtk.Label) e.get_next_sibling();",
1174         "\t\tvar d = (Gtk.DropDown) l.get_next_sibling();",
1175         "\t\t",
1176         "\t\tGLib.debug(\"row key = %s\", ll.label);",
1177         "\t\tif (e.get_visible()) {",
1178         "\t\t\t_this.stop_editor();",
1179         "\t\t\te.grab_focus_without_selecting();",
1180         "\t\t\treturn;",
1181         "\t\t}",
1182         "\t\tif (d.get_visible()) {",
1183         "\t\t\t_this.stop_editor();",
1184         "\t\t\td.activate();",
1185         "\t\t\treturn;",
1186         "\t\t}",
1187         "\t\tif (l.get_visible()) {",
1188         "\t\t \t_this.stop_editor();",
1189         "\t    \t_this.show_editor(_this.file, prop.parent, prop);",
1190         "\t\t",
1191         "\t\t}",
1192         "\t\t",
1193         "\t\t",
1194         "\t\t",
1195         "\t\t//gtkcolumnviewrowwidget",
1196         "\t\t  // cell widet",
1197         "\t\t  // cell widget",
1198         "\t\t  \t// box",
1199         "\t\t  \t\t// entry / label / dropdown",
1200         "\t\t \t\t",
1201         "\t\t ",
1202         "}"
1203        ]
1204       }
1205      ],
1206      "xtype" : "ScrolledWindow"
1207     }
1208    ],
1209    "xtype" : "Box",
1210    "| string keyFormat" : [
1211     "(string val, string type) {",
1212     "    ",
1213     "    // Glib.markup_escape_text(val);",
1214     "",
1215     "    if (type == \"listener\") {",
1216     "        return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + ",
1217     "            GLib.Markup.escape_text(val) +",
1218     "             \"</span>\";",
1219     "    }",
1220     "    // property..",
1221     "    if (val.length < 1) {",
1222     "        return \"<span  color=\\\"#FF0000\\\">--empty--</span>\";",
1223     "    }",
1224     "    ",
1225     "    //@ = signal",
1226     "    //$ = property with ",
1227     "    //# - object properties",
1228     "    //* = special",
1229     "    // all of these... - display value is last element..",
1230     "    var ar = val.strip().split(\" \");",
1231     "    ",
1232     "    ",
1233     "    var dval = GLib.Markup.escape_text(ar[ar.length-1]);",
1234     "    ",
1235     "    ",
1236     "    ",
1237     "    ",
1238     "    switch(val[0]) {",
1239     "        case '@': // signal // just bold balck?",
1240     "            if (dval[0] == '@') {",
1241     "                dval = dval.substring(1);",
1242     "            }",
1243     "        ",
1244     "            return @\"<span  font_weight=\\\"bold\\\">@ $dval</span>\";        ",
1245     "        case '#': // object properties?",
1246     "            if (dval[0] == '#') {",
1247     "                dval = dval.substring(1);",
1248     "            }",
1249     "            return @\"<span  font_weight=\\\"bold\\\">$dval</span>\";",
1250     "        case '*': // special",
1251     "            if (dval[0] == '*') {",
1252     "                dval = dval.substring(1);",
1253     "            }",
1254     "            return @\"<span   color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\";            ",
1255     "        case '$':",
1256     "            if (dval[0] == '$') {",
1257     "                dval = dval.substring(1);",
1258     "            }",
1259     "            return @\"<span   style=\\\"italic\\\">$dval</span>\";",
1260     "       case '|': // user defined methods",
1261     "            if (dval[0] == '|') {",
1262     "                dval = dval.substring(1);",
1263     "            }",
1264     "            return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";",
1265     "            ",
1266     "              ",
1267     "            ",
1268     "        default:",
1269     "            return dval;",
1270     "    }",
1271     "      ",
1272     "    ",
1273     "",
1274     "}"
1275    ],
1276    "| string keySortFormat" : [
1277     "(string key) {",
1278     "    // listeners first - with 0",
1279     "    // specials",
1280     "    if (key[0] == '*') {",
1281     "        return \"1 \" + key;",
1282     "    }",
1283     "    // functions",
1284     "    ",
1285     "    var bits = key.split(\" \");",
1286     "    ",
1287     "    if (key[0] == '|') {",
1288     "        return \"2 \" + bits[bits.length -1];",
1289     "    }",
1290     "    // signals",
1291     "    if (key[0] == '@') {",
1292     "        return \"3 \" + bits[bits.length -1];",
1293     "    }",
1294     "        ",
1295     "    // props",
1296     "    if (key[0] == '#') {",
1297     "        return \"4 \" + bits[bits.length -1];",
1298     "    }",
1299     "    // the rest..",
1300     "    return \"5 \" + bits[bits.length -1];    ",
1301     "",
1302     "",
1303     "",
1304     "}"
1305    ],
1306    "| void a_addProp" : [
1307     " (JsRender.NodeProp prop) {",
1308     "      // info includes key, val, skel, etype..",
1309     "      //console.dump(info);",
1310     "        //type = info.type.toLowerCase();",
1311     "        //var data = this.toJS();",
1312     "          ",
1313     "              ",
1314     "    if (prop.ptype == JsRender.NodePropType.LISTENER) {",
1315     "        if (this.node.listeners.has_key(prop.name)) {",
1316     "            return;",
1317     "        }",
1318     "        this.node.listeners.set(prop.name,prop);",
1319     "    } else  {",
1320     "         assert(this.node != null);",
1321     "         assert(this.node.props != null);",
1322     "        if (this.node.props.has_key(prop.to_index_key())) {",
1323     "            return;",
1324     "        }",
1325     "        this.node.props.set(prop.to_index_key(),prop);",
1326     "    }",
1327     "            ",
1328     "      ",
1329     "    // add a row???",
1330     "    this.load(this.file, this.node);",
1331     "    ",
1332     "    ",
1333     "     ",
1334     "    ",
1335     "    GLib.debug(\"trying to find new iter\");",
1336     " ",
1337     "    ",
1338     "              ",
1339     "}",
1340     ""
1341    ],
1342    "| void deleteSelected" : [
1343     " () {",
1344     "    ",
1345     "\t\treturn;",
1346     "\t\t/*",
1347     "        ",
1348     "        Gtk.TreeIter iter;",
1349     "        Gtk.TreeModel mod;",
1350     "        ",
1351     "        var s = this.view.el.get_selection();",
1352     "        s.get_selected(out mod, out iter);",
1353     "             ",
1354     "              ",
1355     "        GLib.Value gval;",
1356     "        mod.get_value(iter, 0 , out gval);",
1357     "        var prop = (JsRender.NodeProp)gval;",
1358     "        if (prop == null) {",
1359     "\t        this.load(this.file, this.node);    ",
1360     "        \treturn;",
1361     "    \t}",
1362     "    \t// stop editor after fetching property - otherwise prop is null.",
1363     "        this.stop_editor();",
1364     "        ",
1365     "            \t",
1366     "        switch(prop.ptype) {",
1367     "            case JsRender.NodePropType.LISTENER:",
1368     "                this.node.listeners.unset(prop.to_index_key());",
1369     "                break;",
1370     "                ",
1371     "            default:",
1372     "                this.node.props.unset(prop.to_index_key());",
1373     "                break;",
1374     "        }",
1375     "        this.load(this.file, this.node);",
1376     "        ",
1377     "        _this.changed();",
1378     "        */",
1379     "}"
1380    ],
1381    "| void load" : [
1382     "(JsRender.JsRender file, JsRender.Node? node) ",
1383     "{",
1384     "\t// not sure when to initialize this - we should do it on setting main window really.    ",
1385     "\t",
1386     "\tthis.loading = true;",
1387     "    if (this.view.popover == null) {",
1388     " \t\t   this.view.popover = new Xcls_PopoverProperty();",
1389     " \t\t   this.view.popover.mainwindow = _this.main_window;",
1390     "\t}",
1391     "    ",
1392     "    ",
1393     "    if (this.node != null) {",
1394     "    \tthis.node.dupeProps(); // ensures removeall will not do somethign silly",
1395     "    \t",
1396     "    }",
1397     "    ",
1398     "    GLib.debug(\"load leftprops\\n\");",
1399     "",
1400     "    this.node = node;",
1401     "    this.file = file;",
1402     "    ",
1403     " ",
1404     "    this.model.el.remove_all();",
1405     "              ",
1406     "    //this.get('/RightEditor').el.hide();",
1407     "    if (node ==null) {",
1408     "        return ;",
1409     "    }",
1410     "    node.loadProps(this.model.el); ",
1411     "    ",
1412     "    ",
1413     "   //GLib.debug(\"clear selection\\n\");",
1414     "   ",
1415     "   \tthis.loading = false;",
1416     "    this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);",
1417     "   // clear selection?",
1418     "  //this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..",
1419     "   ",
1420     "   // this.view.el.get_selection().unselect_all();",
1421     "   ",
1422     "  // _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1423     "  // _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1424     "   ",
1425     "}",
1426     ""
1427    ]
1428   }
1429  ],
1430  "name" : "WindowLeftProps"
1431 }