tidy up add other property menu
[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.prop(\"\", \"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.prop(\"\", \"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.prop(\"\", \"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              "listeners" : {
644               "clicked" : [
645                "( ) => {",
646                "\t",
647                "",
648                "\tvar n = (JsRender.NodeProp) _this.selmodel.el.selected_item;",
649                "",
650                "\t_this.deletemenu.el.hide();",
651                "\t_this.node.remove_prop(n);",
652                "}",
653                ""
654               ]
655              },
656              "string label" : "Delete",
657              "xtype" : "Button"
658             }
659            ],
660            "xtype" : "Box"
661           }
662          ],
663          "xtype" : "Popover"
664         },
665         {
666          "$ xns" : "Gtk",
667          "listeners" : {
668           "pressed" : [
669            "(n_press, in_x, in_y) => {",
670            "",
671            "\tGLib.debug(\"Prssed %d\", (int)  this.el.get_current_button());",
672            "\t",
673            "\tvar col = _this.view.getColAt(in_x, in_y);",
674            "\tif (col != 0) {",
675            "\t\treturn;",
676            "\t}",
677            "\tstring pos;",
678            "\tvar row = _this.view.getRowAt(in_x, in_y, out pos);",
679            "\t",
680            "\tif (row < 0) {",
681            "\t\treturn;",
682            "",
683            "\t}",
684            "\tGLib.debug(\"hit row %d\", row);",
685            "\tvar prop = _this.selmodel.getPropAt(row);",
686            "\t_this.selmodel.selectProp(prop);",
687            "",
688            "\t//var point_at = _this.view.getWidgetAtRow(row);",
689            "\t",
690            "\t    \t// need to shift down, as ev.y does not inclucde header apparently..",
691            "     \t// or popover might be trying to do a central?",
692            "//\t _this.view.editPropertyDetails(prop, (int) in_y + 12); ",
693            "  \t _this.stop_editor();",
694            "     _this.view.popover.show(",
695            " \t\t\t_this.view.el, ",
696            " \t\t\t_this.node, prop,  ",
697            "\t\t (int)in_y);",
698            "    ",
699            "    ",
700            "      ",
701            "}",
702            ""
703           ]
704          },
705          "xtype" : "GestureClick"
706         },
707         {
708          "$ xns" : "Gtk",
709          "listeners" : {
710           "pressed" : [
711            "(n_press, in_x, in_y) => {",
712            "",
713            "\t",
714            "\t ",
715            "\tstring pos;",
716            "\tvar row = _this.view.getRowAt(in_x, in_y, out pos);",
717            "\t",
718            "\tif (row < 0) {",
719            "\t\treturn;",
720            "",
721            "\t}",
722            "\t",
723            "\t_this.stop_editor();",
724            "\tGLib.debug(\"hit row %d\", row);",
725            "\tvar prop = _this.selmodel.getPropAt(row);",
726            "\t_this.selmodel.selectProp(prop);",
727            "\t",
728            "\t",
729            "\t",
730            "\tGLib.debug(\"Prssed %d\", (int)  this.el.get_current_button());",
731            "\t//_this.deletemenu.el.set_parent(_this.view.el);",
732            "\tif (_this.deletemenu.el.parent == null) {",
733            "\t\t_this.deletemenu.el.set_parent(_this.main_window.el);",
734            "\t}",
735            "\t",
736            "\t",
737            "\t ",
738            "\t_this.deletemenu.el.set_offset(",
739            "\t\t\t(int)in_x  - _this.view.el.get_width() ,",
740            "\t\t\t(int)in_y - _this.view.el.get_height()",
741            "\t\t);",
742            "\t_this.deletemenu.el.set_position(Gtk.PositionType.BOTTOM); ",
743            "    _this.deletemenu.el.popup();",
744            "      ",
745            "}",
746            ""
747           ]
748          },
749          "uint button" : 3,
750          "xtype" : "GestureClick"
751         },
752         {
753          "$ xns" : "Gtk",
754          "* prop" : "model",
755          "bool can_unselect" : true,
756          "id" : "selmodel",
757          "items" : [
758           {
759            "$ xns" : "GLib",
760            "* ctor" : "new GLib.ListStore(typeof(JsRender.NodeProp))",
761            "* prop" : "model",
762            "id" : "model",
763            "xtype" : "ListStore"
764           }
765          ],
766          "xtype" : "SingleSelection",
767          "| JsRender.NodeProp getPropAt" : [
768           "(uint row) {",
769           "",
770           "\treturn   (JsRender.NodeProp) this.el.get_item(row);",
771           "",
772           "\t ",
773           "}"
774          ],
775          "| int propToRow" : [
776           "(JsRender.NodeProp prop) {",
777           "\tfor (var i = 0 ; i < this.el.n_items; i++) {",
778           "\t\tvar r = (JsRender.NodeProp)this.el.get_item(i);",
779           "\t\tif (r.equals(prop)) {",
780           "\t\t\treturn i;",
781           "\t\t\t",
782           "\t\t}",
783           "\t}",
784           "\treturn -1;",
785           "\t ",
786           "}"
787          ],
788          "| void selectProp" : [
789           "(JsRender.NodeProp prop) {",
790           "\tfor (var i = 0 ; i < this.el.n_items; i++) {",
791           "\t\tvar r = (JsRender.NodeProp)this.el.get_item(i);",
792           "\t\tif (r.equals(prop)) {",
793           "\t\t\tthis.el.selected = i;",
794           "\t\t\treturn;",
795           "\t\t}",
796           "\t}",
797           "\t ",
798           "}"
799          ],
800          "| void startEditing" : [
801           "(JsRender.NodeProp prop) {",
802           "\t// should we call select?? - caller does int (from windowstate)",
803           "\t",
804           "}"
805          ]
806         },
807         {
808          "$ xns" : "Gtk",
809          "* pack" : "append_column",
810          "bool expand" : true,
811          "bool resizable" : true,
812          "id" : "keycol",
813          "items" : [
814           {
815            "$ xns" : "Gtk",
816            "* prop" : "factory",
817            "listeners" : {
818             "bind" : [
819              "(listitem) => {",
820              " var lb = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
821              " var item = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();",
822              "",
823              "",
824              "item.bind_property(\"to_display_name_prop\",",
825              "                    lb, \"label\",",
826              "                   GLib.BindingFlags.SYNC_CREATE);",
827              "item.bind_property(\"to_tooltip_name_prop\",",
828              "                    lb, \"tooltip_markup\",",
829              "                   GLib.BindingFlags.SYNC_CREATE);",
830              "// was item (1) in old layout",
831              " ",
832              "",
833              "}",
834              ""
835             ],
836             "setup" : [
837              "(listitem) => {",
838              "\tvar lbl = new Gtk.Label(\"\");",
839              " \t((Gtk.ListItem)listitem).set_child(lbl);",
840              " \tlbl.justify = Gtk.Justification.LEFT;",
841              " \tlbl.xalign = 1;",
842              " \tlbl.use_markup = true;",
843              "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
844              " \t/*lbl.changed.connect(() => {",
845              "\t\t// notify and save the changed value...",
846              "\t \t//var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem.get_item());",
847              "         ",
848              "        //prop.val = lbl.text;",
849              "        //_this.updateIter(iter,prop);",
850              "        _this.changed();",
851              "\t});",
852              "\t*/",
853              "\t((Gtk.ListItem)listitem).activatable = true;",
854              "}",
855              ""
856             ]
857            },
858            "xtype" : "SignalListItemFactory"
859           }
860          ],
861          "title" : "Property",
862          "xtype" : "ColumnViewColumn"
863         },
864         {
865          "$ xns" : "Gtk",
866          "* pack" : "append_column",
867          "bool expand" : true,
868          "bool resizable" : true,
869          "id" : "valcol",
870          "items" : [
871           {
872            "$ xns" : "Gtk",
873            "* prop" : "factory",
874            "bool is_setting" : false,
875            "listeners" : {
876             "bind" : [
877              "(listitem) => {",
878              "\t this.is_setting = true;",
879              "",
880              "",
881              "\tvar bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
882              " ",
883              "\t",
884              "\t",
885              "\t",
886              "\tvar elbl = (Gtk.EditableLabel)bx.get_first_child();",
887              "\tvar lbl = (Gtk.Label) elbl.get_next_sibling();",
888              "\tvar cb  = (Gtk.DropDown) lbl.get_next_sibling();",
889              "\t// decide if it's a combo or editable text..",
890              "\tvar model = (Gtk.StringList) cb.model;",
891              " ",
892              "\telbl.hide();",
893              "\tlbl.hide();",
894              "\tcb.hide();",
895              "\t",
896              "\tvar prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();",
897              "\t//GLib.debug(\"prop = %s\", prop.get_type().name());",
898              "\t//GLib.debug(\"prop.val = %s\", prop.val);",
899              "\t//GLib.debug(\"prop.key = %s\", prop.to_display_name());",
900              "\t ",
901              "    var use_textarea =  prop.useTextArea();",
902              "    ",
903              "    ",
904              "    var pal = _this.file.project.palete;",
905              "        ",
906              "    string[] opts;",
907              "    var has_opts = pal.typeOptions(_this.node.fqn(), prop.name, prop.rtype, out opts);",
908              "    ",
909              "    if (!has_opts && prop.ptype == JsRender.NodePropType.RAW) {",
910              "      \tuse_textarea = true;",
911              "    }",
912              "    ",
913              "    ",
914              "    if (use_textarea) {",
915              "    \tprop.bind_property(\"val_short\",",
916              "                    lbl, \"label\",",
917              "                   GLib.BindingFlags.SYNC_CREATE);",
918              "        prop.bind_property(\"val_tooltip\",",
919              "                    lbl, \"tooltip_markup\",",
920              "                   GLib.BindingFlags.SYNC_CREATE);",
921              "        lbl.show();",
922              "\t\tthis.is_setting = false;        ",
923              "        return;",
924              "    \t",
925              "    }",
926              "     ",
927              "        ",
928              "        ",
929              "        ",
930              "        ",
931              "        // others... - fill in options for true/false?",
932              "           // GLib.debug (ktype.up());",
933              "    if (has_opts) {",
934              "\t",
935              "\t\twhile(model.get_n_items() > 0) {",
936              "\t\t\tmodel.remove(0);",
937              "\t\t}",
938              "\t\tcb.show();",
939              " \t\t// can not remove - hopefully always empty.",
940              "\t\tvar sel = -1;",
941              "\t\tfor(var i = 0; i < opts.length; i ++) {",
942              "\t\t\tmodel.append( opts[i]);",
943              "\t\t\t// not sure this is a great idea... ",
944              "\t\t\tif (opts[i].down() == prop.val.down()) {",
945              "\t\t\t\tsel = i;",
946              "\t\t\t}",
947              "\t\t}",
948              "\t\tGLib.debug(\"Set selected item to %d\", sel);",
949              "\t\tcb.set_selected(sel > -1 ? sel : Gtk.INVALID_LIST_POSITION); ",
950              "\t\tthis.is_setting = false;        ",
951              "\t\treturn ;",
952              "    }",
953              "                                  ",
954              "\t// see if type is a Enum.",
955              "\t// triggers a changed event",
956              " ",
957              "\telbl.set_text(prop.val);",
958              " ",
959              "\telbl.show();",
960              "\tthis.is_setting = false;        \t\t ",
961              "\t",
962              "\t",
963              "\t",
964              " ",
965              "",
966              "}",
967              ""
968             ],
969             "setup" : [
970              "(listitem) => {",
971              "\tvar hb = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
972              "\tvar elbl  = new Gtk.EditableLabel(\"\");",
973              "\telbl.hexpand = true;",
974              "\thb.append(elbl);",
975              "\tvar lbl  = new Gtk.Label(\"\");",
976              "\thb.append(lbl);",
977              "\tlbl.hexpand = true;",
978              "\tlbl.use_markup = true;",
979              "\tlbl.xalign =0;",
980              "\tlbl.ellipsize = Pango.EllipsizeMode.END;",
981              "\tvar cb = new Gtk.DropDown(new Gtk.StringList({}), null);",
982              "\tcb.hexpand = true;",
983              " ",
984              "\thb.append(cb);",
985              "\t((Gtk.ListItem)listitem).set_child(hb);",
986              "\t ",
987              "\t var ef = new Gtk.EventControllerFocus();",
988              "\t ef.enter.connect(() => {",
989              " \t\t _this.stop_editor();",
990              " \t\t  var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
991              "\t\t _this.selmodel.selectProp(prop);\t\t",
992              "\t });",
993              "\t elbl.add_controller(ef);",
994              "\t ",
995              "\t ",
996              "\t  // dropdown??? - stop editing, and highliht node",
997              "\t var tb = (Gtk.ToggleButton) cb.get_first_child();",
998              "\t tb.clicked.connect(() => {",
999              "\t\t var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
1000              "\t\t\t",
1001              "\t \t _this.stop_editor();",
1002              "\t \t _this.selmodel.selectProp(prop);",
1003              "\t \t ",
1004              "\t });",
1005              " \telbl.changed.connect(() => {",
1006              "\t\t// notify and save the changed value...",
1007              "\t \t",
1008              "        //_this.updateIter(iter,prop);",
1009              "        // this should happen automatically",
1010              "        ",
1011              "        if (!_this.loading && !this.is_setting) {",
1012              "\t\t    var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
1013              "\t\t\t ",
1014              "\t\t ",
1015              "\t\t    prop.val = elbl.text;",
1016              "        \t GLib.debug(\"calling changed\");",
1017              "\t        _this.changed();",
1018              "\t       ",
1019              "        }",
1020              "        ",
1021              "\t});",
1022              "\t",
1023              "\t",
1024              "\tcb.notify[\"selected\"].connect(() => {",
1025              "\t\t// dropdown selection changed.",
1026              "\t\t",
1027              "\t\t",
1028              "\t\t",
1029              "        //_this.updateIter(iter,prop);",
1030              "        if (!_this.loading && !this.is_setting) {",
1031              "\t\t    var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
1032              "\t\t    var model = (Gtk.StringList)cb.model;",
1033              "\t\t    prop.val =   model.get_string(cb.selected);",
1034              "\t\t    GLib.debug(\"property set to %s\", prop.val);",
1035              "        \tGLib.debug(\"calling changed\");",
1036              "\t        _this.changed();",
1037              "\t         ",
1038              "        }",
1039              "        ",
1040              "\t\t",
1041              "\t});",
1042              "\tvar gc = new Gtk.GestureClick();",
1043              "\tlbl.add_controller(gc);",
1044              "\tgc.pressed.connect(() => {",
1045              "\t \tvar prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();",
1046              "\t\t _this.stop_editor();",
1047              "\t    _this.show_editor(_this.file, prop.parent, prop);",
1048              "\t});",
1049              "\t  ",
1050              "\t",
1051              "\t",
1052              "}",
1053              ""
1054             ]
1055            },
1056            "xtype" : "SignalListItemFactory"
1057           }
1058          ],
1059          "title" : "Value",
1060          "xtype" : "ColumnViewColumn"
1061         },
1062         {
1063          "$ xns" : "Gtk",
1064          "* pack" : false,
1065          "id" : "ContextMenu",
1066          "items" : [
1067           {
1068            "$ xns" : "Gtk",
1069            "* prop" : "child",
1070            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1071            "int spacing" : 0,
1072            "items" : [
1073             {
1074              "$ xns" : "Gtk",
1075              "label" : "Delete",
1076              "listeners" : {
1077               "activate" : [
1078                "  ( )  =>{",
1079                "\t_this.deleteSelected();",
1080                "\t",
1081                "}"
1082               ]
1083              },
1084              "xtype" : "Button"
1085             }
1086            ],
1087            "xtype" : "Box"
1088           }
1089          ],
1090          "xtype" : "Popover"
1091         }
1092        ],
1093        "string name" : "leftprops-view",
1094        "xtype" : "ColumnView",
1095        "| Gtk.Widget? getWidgetAtRow" : [
1096         "(uint row) {",
1097         "/*",
1098         "    \t",
1099         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1100         "    \tvar colview = gesture.widget;",
1101         "    \tvar line_no = check_list_widget(colview, x,y);",
1102         "         if (line_no > -1) {",
1103         "    \t\tvar item = colview.model.get_item(line_no);",
1104         "    \t\t ",
1105         "    \t}",
1106         "    \t*/",
1107         "\t\tGLib.debug(\"Get Widget At Row %d\", (int)row);",
1108         "        var  child = this.el.get_first_child(); ",
1109         "    \tvar line_no = -1; ",
1110         "    \tvar reading_header = true;",
1111         "",
1112         "    \twhile (child != null) {",
1113         "\t\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1114         "    \t    if (reading_header) {",
1115         "\t\t\t ",
1116         "\t\t\t   ",
1117         "\t\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1118         "\t\t\t\t\tchild = child.get_next_sibling();",
1119         "\t\t\t\t\tcontinue;",
1120         "\t\t\t\t}",
1121         "\t\t\t\tchild = child.get_first_child(); ",
1122         "\t\t\t\treading_header = false;",
1123         "\t\t\t\tcontinue;",
1124         "\t        }",
1125         "\t\t    if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
1126         "    \t\t    child = child.get_next_sibling();",
1127         "    \t\t    continue;",
1128         "\t\t    }",
1129         "\t\t    line_no++;",
1130         "\t\t\tif (line_no == row) {",
1131         "\t\t\t\tGLib.debug(\"Returning widget %s\", child.get_type().name());",
1132         "\t\t\t    return (Gtk.Widget)child;",
1133         "\t\t    }",
1134         "\t        child = child.get_next_sibling(); ",
1135         "    \t}",
1136         "\t\tGLib.debug(\"Rturning null\");",
1137         "        return null;",
1138         "",
1139         " }"
1140        ],
1141        "| int getColAt" : [
1142         "(double x,  double y) {",
1143         "/*",
1144         "    \t",
1145         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1146         "    \t  ",
1147         "    \t*/",
1148         "\t\t//Gtk.Allocation alloc = { 0, 0, 0, 0 };",
1149         "        var  child = this.el.get_first_child(); ",
1150         "    \t ",
1151         "    \tvar col = 0;",
1152         "    \tvar offx = 0;",
1153         "    \twhile (child != null) {",
1154         "\t\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1155         "\t\t\t",
1156         "\t\t\tif (child.get_type().name() == \"GtkColumnViewRowWidget\") {",
1157         "\t\t\t\tchild = child.get_first_child();",
1158         "\t\t\t\tcontinue;",
1159         "\t\t\t}",
1160         "\t\t\t",
1161         "\t\t\t//child.get_allocation(out alloc);",
1162         "\t\t\tif (x <  (child.get_width() + offx)) {",
1163         "\t\t\t\treturn col;",
1164         "\t\t\t}",
1165         "\t\t\toffx += child.get_width();",
1166         "\t\t\tcol++;",
1167         "\t\t\tchild = child.get_next_sibling();",
1168         "\t\t}",
1169         "    \t     ",
1170         "\t\t\t  ",
1171         "        return -1;",
1172         "",
1173         " }"
1174        ],
1175        "| int getRowAt" : [
1176         "(double x,  double in_y, out string pos) {",
1177         "",
1178         "",
1179         "\t ",
1180         "",
1181         "/*",
1182         "    \t",
1183         "from    \thttps://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465",
1184         "    \tvar colview = gesture.widget;",
1185         "    \tvar line_no = check_list_widget(colview, x,y);",
1186         "         if (line_no > -1) {",
1187         "    \t\tvar item = colview.model.get_item(line_no);",
1188         "    \t\t ",
1189         "    \t}",
1190         "    \t*/",
1191         " \t\t ",
1192         " \t\t",
1193         " \t\t//GLib.debug(\"offset = %d  y = %d\", (int) voff, (int) in_y);",
1194         "    \tvar y = in_y + _this.EditProps.el.vadjustment.value; ",
1195         "        var  child = this.el.get_first_child(); ",
1196         "    \t//Gtk.Allocation alloc = { 0, 0, 0, 0 };",
1197         "    \tvar line_no = -1; ",
1198         "    \tvar reading_header = true;",
1199         "    \tvar real_y = 0;",
1200         "    \tvar header_height  = 0;",
1201         "    \tpos = \"none\";",
1202         "    \tvar h = 0;",
1203         "    \twhile (child != null) {",
1204         "\t\t\t//GLib.debug(\"Got %s\", child.get_type().name());",
1205         "    \t    if (reading_header) {",
1206         "\t\t\t\t",
1207         "",
1208         "\t\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1209         "\t\t\t        h += child.get_height();",
1210         "\t\t\t\t\tchild = child.get_next_sibling();",
1211         "\t\t\t\t\tcontinue;",
1212         "\t\t\t\t}",
1213         "\t\t\t\t// should be columnlistview",
1214         "\t\t\t\tchild = child.get_first_child(); ",
1215         "\t\t\t    GLib.debug(\"header height=%d\", h);",
1216         "\t\t\t\theader_height =  h;",
1217         "\t\t\t\t",
1218         "\t\t\t\treading_header = false;",
1219         "\t\t\t\t",
1220         "\t        }",
1221         "\t        ",
1222         "\t\t    if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
1223         "    \t\t    child = child.get_next_sibling();",
1224         "    \t\t    continue;",
1225         "\t\t    }",
1226         "\t\t    ",
1227         "\t\t \tif (y < header_height) {",
1228         "\t\t    \treturn -1;",
1229         "\t    \t}",
1230         "\t\t    ",
1231         "\t\t    line_no++;",
1232         "\t\t\tvar hh = child.get_height();",
1233         "\t\t\t//child.get_allocation(out alloc);",
1234         "\t\t\t//GLib.debug(\"got cell xy = %d,%d  w,h= %d,%d\", alloc.x, alloc.y, alloc.width, alloc.height);",
1235         "\t\t\t//GLib.debug(\"row %d y= %d %s\", line_no, (int) (header_height + alloc.y),",
1236         "\t\t\t",
1237         "\t\t\t//\tchild.visible ? \"VIS\" : \"hidden\");",
1238         "",
1239         "\t\t    if (y >  (header_height + real_y) && y <= (header_height +  real_y + hh) ) {",
1240         "\t\t    \tif (y > ( header_height + real_y + (hh * 0.8))) {",
1241         "\t\t    \t\tpos = \"below\";",
1242         "\t    \t\t} else if (y > ( header_height + real_y + (hh * 0.2))) {",
1243         "\t    \t\t\tpos = \"over\";",
1244         "    \t\t\t} else {",
1245         "    \t\t\t\tpos = \"above\";",
1246         "\t\t\t\t}",
1247         "\t\t    \t GLib.debug(\"getRowAt return : %d, %s\", line_no, pos);",
1248         "\t\t\t    return line_no;",
1249         "\t\t    }",
1250         " ",
1251         "",
1252         "\t\t    if (real_y + hh > y) {",
1253         "\t\t        return -1;",
1254         "\t        }",
1255         "\t        real_y += hh;",
1256         "\t        child = child.get_next_sibling(); ",
1257         "    \t}",
1258         "        return -1;",
1259         "",
1260         " }"
1261        ],
1262        "| void editProp" : [
1263         "(JsRender.NodeProp prop) ",
1264         "{",
1265         "\tvar sm = _this.selmodel.el;",
1266         " ",
1267         "\t\tvar sr = -1;",
1268         "\t\tGLib.debug(\"finding node\");",
1269         "\t\t_this.selmodel.selectProp(prop);",
1270         "\t\t",
1271         "\t\tfor (var i = 0 ; i < sm.n_items; i++) {",
1272         "\t\t\tvar r = (JsRender.NodeProp)sm.get_item(i);",
1273         "\t\t\tif (r.equals(prop)) {",
1274         "\t\t\t\tsr = i;",
1275         "\t\t\t\tbreak;",
1276         "\t\t\t}",
1277         "\t\t}",
1278         "\t\tif (sr < 0) {",
1279         "\t\t\tGLib.debug(\"finding node - cant find it\");",
1280         "\t\t\t \t\t",
1281         "\t\t\treturn;",
1282         "\t\t}",
1283         "\t\tvar r = this.getWidgetAtRow(sr);",
1284         "\t\tGLib.debug(\"r = %s\", r.get_type().name());",
1285         "\t\tvar ca = r.get_first_child();",
1286         "\t\tvar ll = (Gtk.Label)ca.get_first_child();",
1287         "\t\tvar cb = ca.get_next_sibling();",
1288         "\t\tvar b = cb.get_first_child();",
1289         "\t\tvar e = (Gtk.EditableLabel) b.get_first_child();",
1290         "\t\tvar l = (Gtk.Label) e.get_next_sibling();",
1291         "\t\tvar d = (Gtk.DropDown) l.get_next_sibling();",
1292         "\t\t",
1293         "\t\tGLib.debug(\"row key = %s\", ll.label);",
1294         "\t\tif (e.get_visible()) {",
1295         "\t\t\t_this.stop_editor();",
1296         "\t\t\te.start_editing();",
1297         "\t\t\t//GLib.Timeout.add_once(500, () => {",
1298         "\t\t\t//\tvar st = (Gtk.Stack) e.get_first_child();",
1299         "\t\t\t//\tvar ed = (Gtk.Entry) st.get_visible_child();",
1300         "\t\t\t//\ted.grab_focus_without_selecting();",
1301         "\t\t\t//});",
1302         "\t\t\treturn;",
1303         "\t\t}",
1304         "\t\tif (d.get_visible()) {",
1305         "\t\t\t_this.stop_editor();",
1306         "\t\t\td.activate();",
1307         "\t\t\treturn;",
1308         "\t\t}",
1309         "\t\tif (l.get_visible()) {",
1310         "\t\t \t_this.stop_editor();",
1311         "\t    \t_this.show_editor(_this.file, prop.parent, prop);",
1312         "\t\t",
1313         "\t\t}",
1314         "\t\t",
1315         "\t\t",
1316         "\t\t",
1317         "\t\t//gtkcolumnviewrowwidget",
1318         "\t\t  // cell widet",
1319         "\t\t  // cell widget",
1320         "\t\t  \t// box",
1321         "\t\t  \t\t// entry / label / dropdown",
1322         "\t\t \t\t",
1323         "\t\t ",
1324         "}"
1325        ]
1326       }
1327      ],
1328      "xtype" : "ScrolledWindow"
1329     }
1330    ],
1331    "xtype" : "Box",
1332    "| string keyFormat" : [
1333     "(string val, string type) {",
1334     "    ",
1335     "    // Glib.markup_escape_text(val);",
1336     "",
1337     "    if (type == \"listener\") {",
1338     "        return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + ",
1339     "            GLib.Markup.escape_text(val) +",
1340     "             \"</span>\";",
1341     "    }",
1342     "    // property..",
1343     "    if (val.length < 1) {",
1344     "        return \"<span  color=\\\"#FF0000\\\">--empty--</span>\";",
1345     "    }",
1346     "    ",
1347     "    //@ = signal",
1348     "    //$ = property with ",
1349     "    //# - object properties",
1350     "    //* = special",
1351     "    // all of these... - display value is last element..",
1352     "    var ar = val.strip().split(\" \");",
1353     "    ",
1354     "    ",
1355     "    var dval = GLib.Markup.escape_text(ar[ar.length-1]);",
1356     "    ",
1357     "    ",
1358     "    ",
1359     "    ",
1360     "    switch(val[0]) {",
1361     "        case '@': // signal // just bold balck?",
1362     "            if (dval[0] == '@') {",
1363     "                dval = dval.substring(1);",
1364     "            }",
1365     "        ",
1366     "            return @\"<span  font_weight=\\\"bold\\\">@ $dval</span>\";        ",
1367     "        case '#': // object properties?",
1368     "            if (dval[0] == '#') {",
1369     "                dval = dval.substring(1);",
1370     "            }",
1371     "            return @\"<span  font_weight=\\\"bold\\\">$dval</span>\";",
1372     "        case '*': // special",
1373     "            if (dval[0] == '*') {",
1374     "                dval = dval.substring(1);",
1375     "            }",
1376     "            return @\"<span   color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\";            ",
1377     "        case '$':",
1378     "            if (dval[0] == '$') {",
1379     "                dval = dval.substring(1);",
1380     "            }",
1381     "            return @\"<span   style=\\\"italic\\\">$dval</span>\";",
1382     "       case '|': // user defined methods",
1383     "            if (dval[0] == '|') {",
1384     "                dval = dval.substring(1);",
1385     "            }",
1386     "            return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";",
1387     "            ",
1388     "              ",
1389     "            ",
1390     "        default:",
1391     "            return dval;",
1392     "    }",
1393     "      ",
1394     "    ",
1395     "",
1396     "}"
1397    ],
1398    "| string keySortFormat" : [
1399     "(string key) {",
1400     "    // listeners first - with 0",
1401     "    // specials",
1402     "    if (key[0] == '*') {",
1403     "        return \"1 \" + key;",
1404     "    }",
1405     "    // functions",
1406     "    ",
1407     "    var bits = key.split(\" \");",
1408     "    ",
1409     "    if (key[0] == '|') {",
1410     "        return \"2 \" + bits[bits.length -1];",
1411     "    }",
1412     "    // signals",
1413     "    if (key[0] == '@') {",
1414     "        return \"3 \" + bits[bits.length -1];",
1415     "    }",
1416     "        ",
1417     "    // props",
1418     "    if (key[0] == '#') {",
1419     "        return \"4 \" + bits[bits.length -1];",
1420     "    }",
1421     "    // the rest..",
1422     "    return \"5 \" + bits[bits.length -1];    ",
1423     "",
1424     "",
1425     "",
1426     "}"
1427    ],
1428    "| void a_addProp" : [
1429     " (JsRender.NodeProp prop) {",
1430     "      // info includes key, val, skel, etype..",
1431     "      //console.dump(info);",
1432     "        //type = info.type.toLowerCase();",
1433     "        //var data = this.toJS();",
1434     "          ",
1435     "              ",
1436     "    if (prop.ptype == JsRender.NodePropType.LISTENER) {",
1437     "        if (this.node.listeners.has_key(prop.name)) {",
1438     "            return;",
1439     "        }",
1440     "        this.node.listeners.set(prop.name,prop);",
1441     "    } else  {",
1442     "         assert(this.node != null);",
1443     "         assert(this.node.props != null);",
1444     "        if (this.node.props.has_key(prop.to_index_key())) {",
1445     "            return;",
1446     "        }",
1447     "        this.node.props.set(prop.to_index_key(),prop);",
1448     "    }",
1449     "            ",
1450     "      ",
1451     "    // add a row???",
1452     "    this.load(this.file, this.node);",
1453     "    ",
1454     "    ",
1455     "     ",
1456     "    ",
1457     "    GLib.debug(\"trying to find new iter\");",
1458     " ",
1459     "    ",
1460     "              ",
1461     "}",
1462     ""
1463    ],
1464    "| void deleteSelected" : [
1465     " () {",
1466     "    ",
1467     "\t\treturn;",
1468     "\t\t/*",
1469     "        ",
1470     "        Gtk.TreeIter iter;",
1471     "        Gtk.TreeModel mod;",
1472     "        ",
1473     "        var s = this.view.el.get_selection();",
1474     "        s.get_selected(out mod, out iter);",
1475     "             ",
1476     "              ",
1477     "        GLib.Value gval;",
1478     "        mod.get_value(iter, 0 , out gval);",
1479     "        var prop = (JsRender.NodeProp)gval;",
1480     "        if (prop == null) {",
1481     "\t        this.load(this.file, this.node);    ",
1482     "        \treturn;",
1483     "    \t}",
1484     "    \t// stop editor after fetching property - otherwise prop is null.",
1485     "        this.stop_editor();",
1486     "        ",
1487     "            \t",
1488     "        switch(prop.ptype) {",
1489     "            case JsRender.NodePropType.LISTENER:",
1490     "                this.node.listeners.unset(prop.to_index_key());",
1491     "                break;",
1492     "                ",
1493     "            default:",
1494     "                this.node.props.unset(prop.to_index_key());",
1495     "                break;",
1496     "        }",
1497     "        this.load(this.file, this.node);",
1498     "        ",
1499     "        _this.changed();",
1500     "        */",
1501     "}"
1502    ],
1503    "| void load" : [
1504     "(JsRender.JsRender file, JsRender.Node? node) ",
1505     "{",
1506     "\t// not sure when to initialize this - we should do it on setting main window really.    ",
1507     "\t",
1508     "\tthis.loading = true;",
1509     "    if (this.view.popover == null) {",
1510     " \t\t   this.view.popover = new Xcls_PopoverProperty();",
1511     " \t\t   this.view.popover.mainwindow = _this.main_window;",
1512     "\t}",
1513     "    ",
1514     "    ",
1515     "    if (this.node != null) {",
1516     "    \tthis.node.dupeProps(); // ensures removeall will not do somethign silly",
1517     "    \t",
1518     "    }",
1519     "    ",
1520     "    GLib.debug(\"load leftprops\\n\");",
1521     "",
1522     "    this.node = node;",
1523     "    this.file = file;",
1524     "    ",
1525     " ",
1526     "    this.model.el.remove_all();",
1527     "              ",
1528     "    //this.get('/RightEditor').el.hide();",
1529     "    if (node ==null) {",
1530     "        return ;",
1531     "    }",
1532     "    node.loadProps(this.model.el); ",
1533     "    ",
1534     "    ",
1535     "   //GLib.debug(\"clear selection\\n\");",
1536     "   ",
1537     "   \tthis.loading = false;",
1538     "    this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);",
1539     "    this.updateErrors();",
1540     "   // clear selection?",
1541     "  //this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..",
1542     "   ",
1543     "   // this.view.el.get_selection().unselect_all();",
1544     "   ",
1545     "  // _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1546     "  // _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1547     "   ",
1548     "}",
1549     ""
1550    ],
1551    "| void removeErrors" : [
1552     "() {",
1553     "\tvar  child = this.view.el.get_first_child(); ",
1554     " ",
1555     "\tvar reading_header = true;",
1556     " ",
1557     "\twhile (child != null) {",
1558     "\t\tGLib.debug(\"Got %s\", child.get_type().name());",
1559     "\t   ",
1560     "\t   if (reading_header) {",
1561     "\t\t\t",
1562     "",
1563     "\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1564     "\t\t\t   ",
1565     "\t\t\t\tchild = child.get_next_sibling();",
1566     "\t\t\t\tcontinue;",
1567     "\t\t\t}",
1568     "\t\t\t// should be columnlistview",
1569     "\t\t\tchild = child.get_first_child(); ",
1570     "\t\t ",
1571     "\t\t ",
1572     "\t\t\t",
1573     "\t\t\treading_header = false;",
1574     "\t\t\t ",
1575     "\t    }",
1576     "\t    ",
1577     "\t  \tif (child.has_css_class(\"node-err\")) {",
1578     "\t\t\tchild.remove_css_class(\"node-err\");",
1579     "\t\t}",
1580     "\t\tif (child.has_css_class(\"node-warn\")) {",
1581     "\t\t\tchild.remove_css_class(\"node-warn\");",
1582     "\t\t}",
1583     "\t\t",
1584     "\t\tif (child.has_css_class(\"node-depr\")) {",
1585     "\t\t\tchild.remove_css_class(\"node-depr\");",
1586     "\t\t}",
1587     "\t\t",
1588     "        child = child.get_next_sibling(); ",
1589     "\t}",
1590     "\t//GLib.debug(\"Rturning null\");",
1591     "     ",
1592     "}"
1593    ],
1594    "| void updateErrors" : [
1595     "() {",
1596     "\tvar file = this.file;",
1597     "\tvar ar = file.getErrors();",
1598     "\tif (ar.size < 1) {",
1599     "\t\tthis.removeErrors();",
1600     "\t\tthis.last_error_counter = file.error_counter ;",
1601     "",
1602     "\t\treturn;",
1603     "\t}",
1604     " \tif (this.last_error_counter == file.error_counter) {",
1605     "\t\treturn;",
1606     "\t}",
1607     "\tthis.removeErrors();",
1608     "\t",
1609     "\tforeach(var diag in ar) { ",
1610     "\t",
1611     "\t\t ",
1612     "//        print(\"get inter\\n\");",
1613     "\t    var node= file.lineToNode( (int)diag.range.start.line) ;",
1614     "\t    if (node == null || node.oid != this.node.oid) {",
1615     "\t    \tcontinue;",
1616     "    \t}",
1617     "    \tvar prop = node.lineToProp( (int)diag.range.start.line) ;",
1618     "    \t",
1619     "    \tvar row = _this.selmodel.propToRow(prop);",
1620     "    \tif (row < 0) {",
1621     "    \t\tcontinue;",
1622     "\t\t}",
1623     "    \tvar w = this.view.getWidgetAtRow(row);",
1624     "    \tif (w == null) {",
1625     "    \t\treturn;",
1626     "\t\t}",
1627     "\t  \t\tvar ed = diag.category.down();",
1628     "\t\tif (ed != \"err\" && w.has_css_class(\"node-err\")) {",
1629     "\t\t\tcontinue;",
1630     "\t\t}",
1631     "\t\tif (ed == \"err\" && w.has_css_class(\"node-warn\")) {",
1632     "\t\t\tw.remove_css_class(\"node-warn\");",
1633     "\t\t}",
1634     "\t\tif (ed == \"err\" && w.has_css_class(\"node-depr\")) {",
1635     "\t\t\tw.remove_css_class(\"node-depr\");",
1636     "\t\t}",
1637     "\t\tif (!w.has_css_class(\"node-\"+ ed)) {",
1638     "\t\t\tw.add_css_class(\"node-\" + ed);",
1639     "\t\t}",
1640     "\t\t",
1641     "\t}",
1642     "\t",
1643     "}"
1644    ]
1645   }
1646  ],
1647  "name" : "WindowLeftProps"
1648 }