basic highlighting of invalid property names (eg. not user defined or not gtk ) ...
[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              "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\tcontinue;",
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\tif (child.has_css_class(\"node-err\") || ",
1234         "\t\t\t\tchild.has_css_class(\"node-warn\") || ",
1235         "\t\t\t\tchild.has_css_class(\"node-depr\")) {",
1236         "\t\t\t\thh += 10;",
1237         "\t\t\t",
1238         "\t\t\t}",
1239         "\t\t\t",
1240         "\t\t\t//child.get_allocation(out alloc);",
1241         "\t\t\t//GLib.debug(\"got cell xy = %d,%d  w,h= %d,%d\", alloc.x, alloc.y, alloc.width, alloc.height);",
1242         "\t\t\t//GLib.debug(\"row %d y= %d %s\", line_no, (int) (header_height + alloc.y),",
1243         "\t\t\t",
1244         "\t\t\t//\tchild.visible ? \"VIS\" : \"hidden\");",
1245         "",
1246         "\t\t    if (y >  (header_height + real_y) && y <= (header_height +  real_y + hh) ) {",
1247         "\t\t    \tif (y > ( header_height + real_y + (hh * 0.8))) {",
1248         "\t\t    \t\tpos = \"below\";",
1249         "\t    \t\t} else if (y > ( header_height + real_y + (hh * 0.2))) {",
1250         "\t    \t\t\tpos = \"over\";",
1251         "    \t\t\t} else {",
1252         "    \t\t\t\tpos = \"above\";",
1253         "\t\t\t\t}",
1254         "\t\t    \t GLib.debug(\"getRowAt return : %d, %s\", line_no, pos);",
1255         "\t\t\t    return line_no;",
1256         "\t\t    }",
1257         " ",
1258         "",
1259         "\t\t    if (real_y + hh > y) {",
1260         "\t\t        return -1;",
1261         "\t        }",
1262         "\t        real_y += hh;",
1263         "\t        child = child.get_next_sibling(); ",
1264         "    \t}",
1265         "        return -1;",
1266         "",
1267         " }"
1268        ],
1269        "| void editProp" : [
1270         "(JsRender.NodeProp prop) ",
1271         "{",
1272         "\tvar sm = _this.selmodel.el;",
1273         " ",
1274         "\t\tvar sr = -1;",
1275         "\t\tGLib.debug(\"finding node\");",
1276         "\t\t_this.selmodel.selectProp(prop);",
1277         "\t\t",
1278         "\t\tfor (var i = 0 ; i < sm.n_items; i++) {",
1279         "\t\t\tvar r = (JsRender.NodeProp)sm.get_item(i);",
1280         "\t\t\tif (r.equals(prop)) {",
1281         "\t\t\t\tsr = i;",
1282         "\t\t\t\tbreak;",
1283         "\t\t\t}",
1284         "\t\t}",
1285         "\t\tif (sr < 0) {",
1286         "\t\t\tGLib.debug(\"finding node - cant find it\");",
1287         "\t\t\t \t\t",
1288         "\t\t\treturn;",
1289         "\t\t}",
1290         "\t\tvar r = this.getWidgetAtRow(sr);",
1291         "\t\tGLib.debug(\"r = %s\", r.get_type().name());",
1292         "\t\tvar ca = r.get_first_child();",
1293         "\t\tvar ll = (Gtk.Label)ca.get_first_child();",
1294         "\t\tvar cb = ca.get_next_sibling();",
1295         "\t\tvar b = cb.get_first_child();",
1296         "\t\tvar e = (Gtk.EditableLabel) b.get_first_child();",
1297         "\t\tvar l = (Gtk.Label) e.get_next_sibling();",
1298         "\t\tvar d = (Gtk.DropDown) l.get_next_sibling();",
1299         "\t\t",
1300         "\t\tGLib.debug(\"row key = %s\", ll.label);",
1301         "\t\tif (e.get_visible()) {",
1302         "\t\t\t_this.stop_editor();",
1303         "\t\t\te.start_editing();",
1304         "\t\t\t//GLib.Timeout.add_once(500, () => {",
1305         "\t\t\t//\tvar st = (Gtk.Stack) e.get_first_child();",
1306         "\t\t\t//\tvar ed = (Gtk.Entry) st.get_visible_child();",
1307         "\t\t\t//\ted.grab_focus_without_selecting();",
1308         "\t\t\t//});",
1309         "\t\t\treturn;",
1310         "\t\t}",
1311         "\t\tif (d.get_visible()) {",
1312         "\t\t\t_this.stop_editor();",
1313         "\t\t\td.activate();",
1314         "\t\t\treturn;",
1315         "\t\t}",
1316         "\t\tif (l.get_visible()) {",
1317         "\t\t \t_this.stop_editor();",
1318         "\t    \t_this.show_editor(_this.file, prop.parent, prop);",
1319         "\t\t",
1320         "\t\t}",
1321         "\t\t",
1322         "\t\t",
1323         "\t\t",
1324         "\t\t//gtkcolumnviewrowwidget",
1325         "\t\t  // cell widet",
1326         "\t\t  // cell widget",
1327         "\t\t  \t// box",
1328         "\t\t  \t\t// entry / label / dropdown",
1329         "\t\t \t\t",
1330         "\t\t ",
1331         "}"
1332        ]
1333       }
1334      ],
1335      "xtype" : "ScrolledWindow"
1336     }
1337    ],
1338    "xtype" : "Box",
1339    "| string keyFormat" : [
1340     "(string val, string type) {",
1341     "    ",
1342     "    // Glib.markup_escape_text(val);",
1343     "",
1344     "    if (type == \"listener\") {",
1345     "        return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + ",
1346     "            GLib.Markup.escape_text(val) +",
1347     "             \"</span>\";",
1348     "    }",
1349     "    // property..",
1350     "    if (val.length < 1) {",
1351     "        return \"<span  color=\\\"#FF0000\\\">--empty--</span>\";",
1352     "    }",
1353     "    ",
1354     "    //@ = signal",
1355     "    //$ = property with ",
1356     "    //# - object properties",
1357     "    //* = special",
1358     "    // all of these... - display value is last element..",
1359     "    var ar = val.strip().split(\" \");",
1360     "    ",
1361     "    ",
1362     "    var dval = GLib.Markup.escape_text(ar[ar.length-1]);",
1363     "    ",
1364     "    ",
1365     "    ",
1366     "    ",
1367     "    switch(val[0]) {",
1368     "        case '@': // signal // just bold balck?",
1369     "            if (dval[0] == '@') {",
1370     "                dval = dval.substring(1);",
1371     "            }",
1372     "        ",
1373     "            return @\"<span  font_weight=\\\"bold\\\">@ $dval</span>\";        ",
1374     "        case '#': // object properties?",
1375     "            if (dval[0] == '#') {",
1376     "                dval = dval.substring(1);",
1377     "            }",
1378     "            return @\"<span  font_weight=\\\"bold\\\">$dval</span>\";",
1379     "        case '*': // special",
1380     "            if (dval[0] == '*') {",
1381     "                dval = dval.substring(1);",
1382     "            }",
1383     "            return @\"<span   color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\";            ",
1384     "        case '$':",
1385     "            if (dval[0] == '$') {",
1386     "                dval = dval.substring(1);",
1387     "            }",
1388     "            return @\"<span   style=\\\"italic\\\">$dval</span>\";",
1389     "       case '|': // user defined methods",
1390     "            if (dval[0] == '|') {",
1391     "                dval = dval.substring(1);",
1392     "            }",
1393     "            return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";",
1394     "            ",
1395     "              ",
1396     "            ",
1397     "        default:",
1398     "            return dval;",
1399     "    }",
1400     "      ",
1401     "    ",
1402     "",
1403     "}"
1404    ],
1405    "| string keySortFormat" : [
1406     "(string key) {",
1407     "    // listeners first - with 0",
1408     "    // specials",
1409     "    if (key[0] == '*') {",
1410     "        return \"1 \" + key;",
1411     "    }",
1412     "    // functions",
1413     "    ",
1414     "    var bits = key.split(\" \");",
1415     "    ",
1416     "    if (key[0] == '|') {",
1417     "        return \"2 \" + bits[bits.length -1];",
1418     "    }",
1419     "    // signals",
1420     "    if (key[0] == '@') {",
1421     "        return \"3 \" + bits[bits.length -1];",
1422     "    }",
1423     "        ",
1424     "    // props",
1425     "    if (key[0] == '#') {",
1426     "        return \"4 \" + bits[bits.length -1];",
1427     "    }",
1428     "    // the rest..",
1429     "    return \"5 \" + bits[bits.length -1];    ",
1430     "",
1431     "",
1432     "",
1433     "}"
1434    ],
1435    "| void deleteSelected" : [
1436     " () {",
1437     "    ",
1438     "\t\treturn;",
1439     "\t\t/*",
1440     "        ",
1441     "        Gtk.TreeIter iter;",
1442     "        Gtk.TreeModel mod;",
1443     "        ",
1444     "        var s = this.view.el.get_selection();",
1445     "        s.get_selected(out mod, out iter);",
1446     "             ",
1447     "              ",
1448     "        GLib.Value gval;",
1449     "        mod.get_value(iter, 0 , out gval);",
1450     "        var prop = (JsRender.NodeProp)gval;",
1451     "        if (prop == null) {",
1452     "\t        this.load(this.file, this.node);    ",
1453     "        \treturn;",
1454     "    \t}",
1455     "    \t// stop editor after fetching property - otherwise prop is null.",
1456     "        this.stop_editor();",
1457     "        ",
1458     "            \t",
1459     "        switch(prop.ptype) {",
1460     "            case JsRender.NodePropType.LISTENER:",
1461     "                this.node.listeners.unset(prop.to_index_key());",
1462     "                break;",
1463     "                ",
1464     "            default:",
1465     "                this.node.props.unset(prop.to_index_key());",
1466     "                break;",
1467     "        }",
1468     "        this.load(this.file, this.node);",
1469     "        ",
1470     "        _this.changed();",
1471     "        */",
1472     "}"
1473    ],
1474    "| void load" : [
1475     "(JsRender.JsRender file, JsRender.Node? node) ",
1476     "{",
1477     "\t// not sure when to initialize this - we should do it on setting main window really.    ",
1478     "\t",
1479     "\tthis.loading = true;",
1480     "    if (this.view.popover == null) {",
1481     " \t\t   this.view.popover = new Xcls_PopoverProperty();",
1482     " \t\t   this.view.popover.mainwindow = _this.main_window;",
1483     "\t}",
1484     "    ",
1485     "    ",
1486     "    if (this.node != null) {",
1487     "    \tthis.node.dupeProps(); // ensures removeall will not do somethign silly",
1488     "    \t",
1489     "    }",
1490     "    ",
1491     "    GLib.debug(\"load leftprops\\n\");",
1492     "",
1493     "    this.node = node;",
1494     "    this.file = file;",
1495     "    ",
1496     " ",
1497     "    this.model.el.remove_all();",
1498     "              ",
1499     "    //this.get('/RightEditor').el.hide();",
1500     "    if (node ==null) {",
1501     "        return ;",
1502     "    }",
1503     "",
1504     "    node.loadProps(this.model.el, _this.main_window.windowstate.project); ",
1505     "    ",
1506     "    ",
1507     "   //GLib.debug(\"clear selection\\n\");",
1508     "   ",
1509     "   \tthis.loading = false;",
1510     "    this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);",
1511     "    this.updateErrors();",
1512     "   // clear selection?",
1513     "  //this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..",
1514     "   ",
1515     "   // this.view.el.get_selection().unselect_all();",
1516     "   ",
1517     "  // _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1518     "  // _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
1519     "   ",
1520     "}",
1521     ""
1522    ],
1523    "| void removeErrors" : [
1524     "() {",
1525     "\tvar  child = this.view.el.get_first_child(); ",
1526     " ",
1527     "\tvar reading_header = true;",
1528     " ",
1529     "\twhile (child != null) {",
1530     "\t\t//GLib.debug(\"Got %s\", child.get_type().name());",
1531     "\t   ",
1532     "\t   if (reading_header) {",
1533     "\t\t\t",
1534     "",
1535     "\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
1536     "\t\t\t   ",
1537     "\t\t\t\tchild = child.get_next_sibling();",
1538     "\t\t\t\tcontinue;",
1539     "\t\t\t}",
1540     "\t\t\t// should be columnlistview",
1541     "\t\t\tchild = child.get_first_child(); ",
1542     "\t\t ",
1543     "\t\t ",
1544     "\t\t\t",
1545     "\t\t\treading_header = false;",
1546     "\t\t\tcontinue;",
1547     "\t    }",
1548     "\t    ",
1549     "\t  \tif (child.has_css_class(\"node-err\")) {",
1550     "\t\t\tchild.remove_css_class(\"node-err\");",
1551     "\t\t}",
1552     "\t\tif (child.has_css_class(\"node-warn\")) {",
1553     "\t\t\tchild.remove_css_class(\"node-warn\");",
1554     "\t\t}",
1555     "\t\t",
1556     "\t\tif (child.has_css_class(\"node-depr\")) {",
1557     "\t\t\tchild.remove_css_class(\"node-depr\");",
1558     "\t\t}",
1559     "\t\t",
1560     "        child = child.get_next_sibling(); ",
1561     "\t}",
1562     "\t//GLib.debug(\"Rturning null\");",
1563     "     ",
1564     "}"
1565    ],
1566    "| void updateErrors" : [
1567     "() {",
1568     "\tvar file = this.file;",
1569     "\tif (file == null) {",
1570     "\t\treturn;",
1571     "\t}",
1572     "\tvar ar = file.getErrors();",
1573     "\tif (ar == null || ar.size < 1) {",
1574     "\t\tif (this.last_error_counter != file.error_counter) {",
1575     "\t\t\tthis.removeErrors();",
1576     "\t\t}",
1577     "",
1578     "\t\tthis.last_error_counter = file.error_counter ;",
1579     "",
1580     "\t\treturn;",
1581     "\t}",
1582     " \tif (this.last_error_counter == file.error_counter) {",
1583     "\t\treturn;",
1584     "\t}",
1585     "\tthis.removeErrors();",
1586     "\t",
1587     "\tforeach(var diag in ar) { ",
1588     "\t",
1589     "\t\t ",
1590     "//        print(\"get inter\\n\");",
1591     "\t    var node= file.lineToNode( (int)diag.range.start.line) ;",
1592     "\t    if (node == null || node.oid != this.node.oid) {",
1593     "\t    \tcontinue;",
1594     "    \t}",
1595     "    \tvar prop = node.lineToProp( (int)diag.range.start.line) ;",
1596     "    \t",
1597     "    \tvar row = _this.selmodel.propToRow(prop);",
1598     "    \tif (row < 0) {",
1599     "    \t\tcontinue;",
1600     "\t\t}",
1601     "    \tvar w = this.view.getWidgetAtRow(row);",
1602     "    \tif (w == null) {",
1603     "    \t\treturn;",
1604     "\t\t}",
1605     "\t  \t\tvar ed = diag.category.down();",
1606     "\t\tif (ed != \"err\" && w.has_css_class(\"node-err\")) {",
1607     "\t\t\tcontinue;",
1608     "\t\t}",
1609     "\t\tif (ed == \"err\" && w.has_css_class(\"node-warn\")) {",
1610     "\t\t\tw.remove_css_class(\"node-warn\");",
1611     "\t\t}",
1612     "\t\tif (ed == \"err\" && w.has_css_class(\"node-depr\")) {",
1613     "\t\t\tw.remove_css_class(\"node-depr\");",
1614     "\t\t}",
1615     "\t\tif (!w.has_css_class(\"node-\"+ ed)) {",
1616     "\t\t\tw.add_css_class(\"node-\" + ed);",
1617     "\t\t}",
1618     "\t\t",
1619     "\t}",
1620     "\t",
1621     "}"
1622    ]
1623   }
1624  ],
1625  "name" : "WindowLeftProps"
1626 }