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