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