bcef70ac62b5c61fdc88c02c1923d024a16f49d3
[roobuilder] / src / Builder4 / WindowLeftProps.vala
1 static Xcls_LeftProps  _LeftProps;
2
3 public class Xcls_LeftProps : Object
4 {
5         public Gtk.Box el;
6         private Xcls_LeftProps  _this;
7
8         public static Xcls_LeftProps singleton()
9         {
10                 if (_LeftProps == null) {
11                     _LeftProps= new Xcls_LeftProps();
12                 }
13                 return _LeftProps;
14         }
15         public Xcls_addpop addpop;
16         public Xcls_EditProps EditProps;
17         public Xcls_view view;
18         public Xcls_deletemenu deletemenu;
19         public Xcls_selmodel selmodel;
20         public Xcls_model model;
21         public Xcls_keycol keycol;
22         public Xcls_valcol valcol;
23         public Xcls_ContextMenu ContextMenu;
24
25                 // my vars (def)
26         public bool loading;
27         public bool allow_edit;
28         public signal void show_add_props (string type);
29         public signal bool stop_editor ();
30         public Xcls_MainWindow main_window;
31         public int last_error_counter;
32         public signal void changed ();
33         public JsRender.JsRender file;
34         public JsRender.Node node;
35         public signal void show_editor (JsRender.JsRender file, JsRender.Node node, JsRender.NodeProp prop);
36
37         // ctor
38         public Xcls_LeftProps()
39         {
40                 _this = this;
41                 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
42
43                 // my vars (dec)
44                 this.loading = false;
45                 this.allow_edit = false;
46                 this.main_window = null;
47                 this.last_error_counter = -1;
48
49                 // set gobject values
50                 this.el.homogeneous = false   ;
51                 this.el.hexpand = true;
52                 this.el.vexpand = true;
53                 var child_1 = new Xcls_Box1( _this );
54                 child_1.ref();
55                 this.el.append( child_1.el );
56                 new Xcls_EditProps( _this );
57                 this.el.append( _this.EditProps.el );
58         }
59
60         // user defined functions
61         public string keySortFormat (string key) {
62             // listeners first - with 0
63             // specials
64             if (key[0] == '*') {
65                 return "1 " + key;
66             }
67             // functions
68             
69             var bits = key.split(" ");
70             
71             if (key[0] == '|') {
72                 return "2 " + bits[bits.length -1];
73             }
74             // signals
75             if (key[0] == '@') {
76                 return "3 " + bits[bits.length -1];
77             }
78                 
79             // props
80             if (key[0] == '#') {
81                 return "4 " + bits[bits.length -1];
82             }
83             // the rest..
84             return "5 " + bits[bits.length -1];    
85         
86         
87         
88         }
89         public void updateErrors () {
90                 var file = this.file;
91                 if (file == null) {
92                         return;
93                 }
94                 var ar = file.getErrors();
95                 if (ar == null || ar.size < 1) {
96                         if (this.last_error_counter != file.error_counter) {
97                                 this.removeErrors();
98                         }
99         
100                         this.last_error_counter = file.error_counter ;
101         
102                         return;
103                 }
104                 if (this.last_error_counter == file.error_counter) {
105                         return;
106                 }
107                 this.removeErrors();
108                 
109                 foreach(var diag in ar) { 
110                 
111                          
112         //        print("get inter\n");
113                     var node= file.lineToNode( (int)diag.range.start.line) ;
114                     if (node == null || node.oid != this.node.oid) {
115                         continue;
116                 }
117                 var prop = node.lineToProp( (int)diag.range.start.line) ;
118                 
119                 var row = _this.selmodel.propToRow(prop);
120                 if (row < 0) {
121                         continue;
122                         }
123                 var w = this.view.getWidgetAtRow(row);
124                 if (w == null) {
125                         return;
126                         }
127                                 var ed = diag.category.down();
128                         if (ed != "err" && w.has_css_class("node-err")) {
129                                 continue;
130                         }
131                         if (ed == "err" && w.has_css_class("node-warn")) {
132                                 w.remove_css_class("node-warn");
133                         }
134                         if (ed == "err" && w.has_css_class("node-depr")) {
135                                 w.remove_css_class("node-depr");
136                         }
137                         if (!w.has_css_class("node-"+ ed)) {
138                                 w.add_css_class("node-" + ed);
139                         }
140                         
141                 }
142                 
143         }
144         public string keyFormat (string val, string type) {
145             
146             // Glib.markup_escape_text(val);
147         
148             if (type == "listener") {
149                 return "<span font_weight=\"bold\" color=\"#660000\">" + 
150                     GLib.Markup.escape_text(val) +
151                      "</span>";
152             }
153             // property..
154             if (val.length < 1) {
155                 return "<span  color=\"#FF0000\">--empty--</span>";
156             }
157             
158             //@ = signal
159             //$ = property with 
160             //# - object properties
161             //* = special
162             // all of these... - display value is last element..
163             var ar = val.strip().split(" ");
164             
165             
166             var dval = GLib.Markup.escape_text(ar[ar.length-1]);
167             
168             
169             
170             
171             switch(val[0]) {
172                 case '@': // signal // just bold balck?
173                     if (dval[0] == '@') {
174                         dval = dval.substring(1);
175                     }
176                 
177                     return @"<span  font_weight=\"bold\">@ $dval</span>";        
178                 case '#': // object properties?
179                     if (dval[0] == '#') {
180                         dval = dval.substring(1);
181                     }
182                     return @"<span  font_weight=\"bold\">$dval</span>";
183                 case '*': // special
184                     if (dval[0] == '*') {
185                         dval = dval.substring(1);
186                     }
187                     return @"<span   color=\"#0000CC\" font_weight=\"bold\">$dval</span>";            
188                 case '$':
189                     if (dval[0] == '$') {
190                         dval = dval.substring(1);
191                     }
192                     return @"<span   style=\"italic\">$dval</span>";
193                case '|': // user defined methods
194                     if (dval[0] == '|') {
195                         dval = dval.substring(1);
196                     }
197                     return @"<span color=\"#008000\" font_weight=\"bold\">$dval</span>";
198                     
199                       
200                     
201                 default:
202                     return dval;
203             }
204               
205             
206         
207         }
208         public void deleteSelected () {
209             
210                         return;
211                         /*
212                 
213                 Gtk.TreeIter iter;
214                 Gtk.TreeModel mod;
215                 
216                 var s = this.view.el.get_selection();
217                 s.get_selected(out mod, out iter);
218                      
219                       
220                 GLib.Value gval;
221                 mod.get_value(iter, 0 , out gval);
222                 var prop = (JsRender.NodeProp)gval;
223                 if (prop == null) {
224                         this.load(this.file, this.node);    
225                         return;
226                 }
227                 // stop editor after fetching property - otherwise prop is null.
228                 this.stop_editor();
229                 
230                         
231                 switch(prop.ptype) {
232                     case JsRender.NodePropType.LISTENER:
233                         this.node.listeners.unset(prop.to_index_key());
234                         break;
235                         
236                     default:
237                         this.node.props.unset(prop.to_index_key());
238                         break;
239                 }
240                 this.load(this.file, this.node);
241                 
242                 _this.changed();
243                 */
244         }
245         public void removeErrors () {
246                 var  child = this.view.el.get_first_child(); 
247          
248                 var reading_header = true;
249          
250                 while (child != null) {
251                         //GLib.debug("Got %s", child.get_type().name());
252                    
253                    if (reading_header) {
254                                 
255         
256                                 if (child.get_type().name() != "GtkColumnListView") {
257                                    
258                                         child = child.get_next_sibling();
259                                         continue;
260                                 }
261                                 // should be columnlistview
262                                 child = child.get_first_child(); 
263                          
264                          
265                                 
266                                 reading_header = false;
267                                 continue;
268                     }
269                     
270                         if (child.has_css_class("node-err")) {
271                                 child.remove_css_class("node-err");
272                         }
273                         if (child.has_css_class("node-warn")) {
274                                 child.remove_css_class("node-warn");
275                         }
276                         
277                         if (child.has_css_class("node-depr")) {
278                                 child.remove_css_class("node-depr");
279                         }
280                         
281                 child = child.get_next_sibling(); 
282                 }
283                 //GLib.debug("Rturning null");
284              
285         }
286         public void load (JsRender.JsRender file, JsRender.Node? node) 
287         {
288                 // not sure when to initialize this - we should do it on setting main window really.    
289                 
290                 this.loading = true;
291             if (this.view.popover == null) {
292                            this.view.popover = new Xcls_PopoverProperty();
293                            this.view.popover.mainwindow = _this.main_window;
294                 }
295             
296             
297             if (this.node != null) {
298                 this.node.dupeProps(); // ensures removeall will not do somethign silly
299                 
300             }
301             
302             GLib.debug("load leftprops\n");
303         
304             this.node = node;
305             this.file = file;
306             
307          
308             this.model.el.remove_all();
309                       
310             //this.get('/RightEditor').el.hide();
311             if (node ==null) {
312                 return ;
313             }
314         
315             node.loadProps(this.model.el, _this.main_window.windowstate.project); 
316             
317             
318            //GLib.debug("clear selection\n");
319            
320                 this.loading = false;
321             this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);
322             this.updateErrors();
323            // clear selection?
324           //this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..
325            
326            // this.view.el.get_selection().unselect_all();
327            
328           // _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);
329           // _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);
330            
331         }
332         public class Xcls_Box1 : Object
333         {
334                 public Gtk.Box el;
335                 private Xcls_LeftProps  _this;
336
337
338                         // my vars (def)
339
340                 // ctor
341                 public Xcls_Box1(Xcls_LeftProps _owner )
342                 {
343                         _this = _owner;
344                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
345
346                         // my vars (dec)
347
348                         // set gobject values
349                         this.el.hexpand = true;
350                         var child_1 = new Xcls_Label2( _this );
351                         child_1.ref();
352                         this.el.append( child_1.el );
353                         var child_2 = new Xcls_Button3( _this );
354                         child_2.ref();
355                         this.el.append( child_2.el );
356                         var child_3 = new Xcls_Button4( _this );
357                         child_3.ref();
358                         this.el.append( child_3.el );
359                         var child_4 = new Xcls_MenuButton5( _this );
360                         child_4.ref();
361                         this.el.append( child_4.el );
362                 }
363
364                 // user defined functions
365         }
366         public class Xcls_Label2 : Object
367         {
368                 public Gtk.Label el;
369                 private Xcls_LeftProps  _this;
370
371
372                         // my vars (def)
373
374                 // ctor
375                 public Xcls_Label2(Xcls_LeftProps _owner )
376                 {
377                         _this = _owner;
378                         this.el = new Gtk.Label( "Add:" );
379
380                         // my vars (dec)
381
382                         // set gobject values
383                         this.el.margin_end = 5;
384                         this.el.margin_start = 5;
385                 }
386
387                 // user defined functions
388         }
389
390         public class Xcls_Button3 : Object
391         {
392                 public Gtk.Button el;
393                 private Xcls_LeftProps  _this;
394
395
396                         // my vars (def)
397                 public bool always_show_image;
398
399                 // ctor
400                 public Xcls_Button3(Xcls_LeftProps _owner )
401                 {
402                         _this = _owner;
403                         this.el = new Gtk.Button();
404
405                         // my vars (dec)
406                         this.always_show_image = true;
407
408                         // set gobject values
409                         this.el.icon_name = "format-justify-left";
410                         this.el.hexpand = true;
411                         this.el.tooltip_text = "Add Property";
412                         this.el.label = "Property";
413
414                         //listeners
415                         this.el.clicked.connect( ( ) => {
416                             
417                              _this.main_window.windowstate.showProps(
418                                 _this.view.el, 
419                                         JsRender.NodePropType.PROP
420                                 );
421                           
422                         });
423                 }
424
425                 // user defined functions
426         }
427
428         public class Xcls_Button4 : Object
429         {
430                 public Gtk.Button el;
431                 private Xcls_LeftProps  _this;
432
433
434                         // my vars (def)
435                 public bool always_show_image;
436
437                 // ctor
438                 public Xcls_Button4(Xcls_LeftProps _owner )
439                 {
440                         _this = _owner;
441                         this.el = new Gtk.Button();
442
443                         // my vars (dec)
444                         this.always_show_image = true;
445
446                         // set gobject values
447                         this.el.icon_name = "appointment-new";
448                         this.el.hexpand = true;
449                         this.el.tooltip_text = "Add Event Code";
450                         this.el.label = "Event";
451
452                         //listeners
453                         this.el.clicked.connect( ( ) => {
454                             
455                          
456                            _this.main_window.windowstate.showProps(
457                                         _this.view.el, 
458                                         JsRender.NodePropType.LISTENER
459                                 );
460                         
461                          
462                         });
463                 }
464
465                 // user defined functions
466         }
467
468         public class Xcls_MenuButton5 : Object
469         {
470                 public Gtk.MenuButton el;
471                 private Xcls_LeftProps  _this;
472
473
474                         // my vars (def)
475
476                 // ctor
477                 public Xcls_MenuButton5(Xcls_LeftProps _owner )
478                 {
479                         _this = _owner;
480                         this.el = new Gtk.MenuButton();
481
482                         // my vars (dec)
483
484                         // set gobject values
485                         this.el.label = "Other";
486                         new Xcls_addpop( _this );
487                         this.el.popover = _this.addpop.el;
488                 }
489
490                 // user defined functions
491         }
492         public class Xcls_addpop : Object
493         {
494                 public Gtk.Popover el;
495                 private Xcls_LeftProps  _this;
496
497
498                         // my vars (def)
499
500                 // ctor
501                 public Xcls_addpop(Xcls_LeftProps _owner )
502                 {
503                         _this = _owner;
504                         _this.addpop = this;
505                         this.el = new Gtk.Popover();
506
507                         // my vars (dec)
508
509                         // set gobject values
510                         var child_1 = new Xcls_Box7( _this );
511                         this.el.child = child_1.el;
512                 }
513
514                 // user defined functions
515         }
516         public class Xcls_Box7 : Object
517         {
518                 public Gtk.Box el;
519                 private Xcls_LeftProps  _this;
520
521
522                         // my vars (def)
523
524                 // ctor
525                 public Xcls_Box7(Xcls_LeftProps _owner )
526                 {
527                         _this = _owner;
528                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
529
530                         // my vars (dec)
531
532                         // set gobject values
533                         var child_1 = new Xcls_Button8( _this );
534                         child_1.ref();
535                         this.el.append( child_1.el );
536                         var child_2 = new Xcls_Button10( _this );
537                         child_2.ref();
538                         this.el.append( child_2.el );
539                         var child_3 = new Xcls_Button12( _this );
540                         child_3.ref();
541                         this.el.append( child_3.el );
542                         var child_4 = new Xcls_Button14( _this );
543                         child_4.ref();
544                         this.el.append( child_4.el );
545                         var child_5 = new Xcls_Button16( _this );
546                         child_5.ref();
547                         this.el.append( child_5.el );
548                         var child_6 = new Xcls_Separator18( _this );
549                         child_6.ref();
550                         this.el.append( child_6.el );
551                         var child_7 = new Xcls_Button19( _this );
552                         child_7.ref();
553                         this.el.append( child_7.el );
554                         var child_8 = new Xcls_Button21( _this );
555                         child_8.ref();
556                         this.el.append( child_8.el );
557                         var child_9 = new Xcls_Button23( _this );
558                         child_9.ref();
559                         this.el.append( child_9.el );
560                         var child_10 = new Xcls_Separator25( _this );
561                         child_10.ref();
562                         this.el.append( child_10.el );
563                         var child_11 = new Xcls_Button26( _this );
564                         child_11.ref();
565                         this.el.append( child_11.el );
566                         var child_12 = new Xcls_Button28( _this );
567                         child_12.ref();
568                         this.el.append( child_12.el );
569                         var child_13 = new Xcls_Button30( _this );
570                         child_13.ref();
571                         this.el.append( child_13.el );
572                         var child_14 = new Xcls_Separator32( _this );
573                         child_14.ref();
574                         this.el.append( child_14.el );
575                         var child_15 = new Xcls_Button33( _this );
576                         child_15.ref();
577                         this.el.append( child_15.el );
578                         var child_16 = new Xcls_Button35( _this );
579                         child_16.ref();
580                         this.el.append( child_16.el );
581                         var child_17 = new Xcls_Button37( _this );
582                         child_17.ref();
583                         this.el.append( child_17.el );
584                 }
585
586                 // user defined functions
587         }
588         public class Xcls_Button8 : Object
589         {
590                 public Gtk.Button el;
591                 private Xcls_LeftProps  _this;
592
593
594                         // my vars (def)
595
596                 // ctor
597                 public Xcls_Button8(Xcls_LeftProps _owner )
598                 {
599                         _this = _owner;
600                         this.el = new Gtk.Button();
601
602                         // my vars (dec)
603
604                         // set gobject values
605                         this.el.has_frame = false;
606                         var child_1 = new Xcls_Label9( _this );
607                         this.el.child = child_1.el;
608
609                         //listeners
610                         this.el.clicked.connect( ()  => {
611                                 _this.addpop.el.hide();
612                                 // is this userdef or special??
613                                 var add = new JsRender.NodeProp.prop("id");
614                                 if (_this.node.has_prop_key(add)) {
615                                         return;
616                                 }
617                                 
618                                 _this.node.add_prop( add );
619                                 
620                                 _this.view.editProp( add );
621                                 
622                         });
623                 }
624
625                 // user defined functions
626         }
627         public class Xcls_Label9 : Object
628         {
629                 public Gtk.Label el;
630                 private Xcls_LeftProps  _this;
631
632
633                         // my vars (def)
634
635                 // ctor
636                 public Xcls_Label9(Xcls_LeftProps _owner )
637                 {
638                         _this = _owner;
639                         this.el = new Gtk.Label( "id: _this.{ID} (Vala)" );
640
641                         // my vars (dec)
642
643                         // set gobject values
644                         this.el.halign = Gtk.Align.START;
645                         this.el.tooltip_text = "Using _this.{ID} will map to this element";
646                 }
647
648                 // user defined functions
649         }
650
651
652         public class Xcls_Button10 : Object
653         {
654                 public Gtk.Button el;
655                 private Xcls_LeftProps  _this;
656
657
658                         // my vars (def)
659
660                 // ctor
661                 public Xcls_Button10(Xcls_LeftProps _owner )
662                 {
663                         _this = _owner;
664                         this.el = new Gtk.Button();
665
666                         // my vars (dec)
667
668                         // set gobject values
669                         this.el.has_frame = false;
670                         var child_1 = new Xcls_Label11( _this );
671                         this.el.child = child_1.el;
672
673                         //listeners
674                         this.el.clicked.connect( ( ) => {
675                          
676                         
677                                 _this.addpop.el.hide();
678                                 // is this userdef or special??
679                                 var add = new JsRender.NodeProp.special("pack", "add");
680                                 if (_this.node.has_prop_key(add)) {
681                                         return;
682                                 }
683                                 
684                                 _this.node.add_prop( add );
685                                 
686                                 _this.view.editProp( add );
687                                 
688                         
689                         });
690                 }
691
692                 // user defined functions
693         }
694         public class Xcls_Label11 : Object
695         {
696                 public Gtk.Label el;
697                 private Xcls_LeftProps  _this;
698
699
700                         // my vars (def)
701
702                 // ctor
703                 public Xcls_Label11(Xcls_LeftProps _owner )
704                 {
705                         _this = _owner;
706                         this.el = new Gtk.Label( "pack: Pack method (Vala)" );
707
708                         // my vars (dec)
709
710                         // set gobject values
711                         this.el.halign = Gtk.Align.START;
712                         this.el.tooltip_text = "how to pack this element onto parent, (method, 2nd arg, 3rd arg) .. the 1st argument is filled by the element";
713                 }
714
715                 // user defined functions
716         }
717
718
719         public class Xcls_Button12 : Object
720         {
721                 public Gtk.Button el;
722                 private Xcls_LeftProps  _this;
723
724
725                         // my vars (def)
726
727                 // ctor
728                 public Xcls_Button12(Xcls_LeftProps _owner )
729                 {
730                         _this = _owner;
731                         this.el = new Gtk.Button();
732
733                         // my vars (dec)
734
735                         // set gobject values
736                         this.el.has_frame = false;
737                         var child_1 = new Xcls_Label13( _this );
738                         this.el.child = child_1.el;
739
740                         //listeners
741                         this.el.clicked.connect( ( ) => {
742                            
743                                 _this.addpop.el.hide();
744                                 // is this userdef or special??
745                                 var add = new JsRender.NodeProp.special("ctor");
746                                 if (_this.node.has_prop_key(add)) {
747                                         return;
748                                 }
749                                 
750                                 _this.node.add_prop( add );
751                                 
752                                 _this.view.editProp( add );
753                                 
754                         });
755                 }
756
757                 // user defined functions
758         }
759         public class Xcls_Label13 : Object
760         {
761                 public Gtk.Label el;
762                 private Xcls_LeftProps  _this;
763
764
765                         // my vars (def)
766
767                 // ctor
768                 public Xcls_Label13(Xcls_LeftProps _owner )
769                 {
770                         _this = _owner;
771                         this.el = new Gtk.Label( "ctor: Alterative to default contructor (Vala)" );
772
773                         // my vars (dec)
774
775                         // set gobject values
776                         this.el.halign = Gtk.Align.START;
777                         this.el.tooltip_text = "eg. \n\nnew Clutter.Image.from_file(.....)";
778                 }
779
780                 // user defined functions
781         }
782
783
784         public class Xcls_Button14 : Object
785         {
786                 public Gtk.Button el;
787                 private Xcls_LeftProps  _this;
788
789
790                         // my vars (def)
791
792                 // ctor
793                 public Xcls_Button14(Xcls_LeftProps _owner )
794                 {
795                         _this = _owner;
796                         this.el = new Gtk.Button();
797
798                         // my vars (dec)
799
800                         // set gobject values
801                         this.el.has_frame = false;
802                         var child_1 = new Xcls_Label15( _this );
803                         this.el.child = child_1.el;
804
805                         //listeners
806                         this.el.clicked.connect( ( ) => {
807                             
808                                 _this.addpop.el.hide();
809                                 // is this userdef or special??
810                                 var add =  new JsRender.NodeProp.special("init","{\n\n}\n" ) ;
811                                 if (_this.node.has_prop_key(add)) {
812                                         return;
813                                 }
814                                 
815                                 _this.node.add_prop( add );
816                                 
817                                 _this.view.editProp( add );
818                         });
819                 }
820
821                 // user defined functions
822         }
823         public class Xcls_Label15 : Object
824         {
825                 public Gtk.Label el;
826                 private Xcls_LeftProps  _this;
827
828
829                         // my vars (def)
830
831                 // ctor
832                 public Xcls_Label15(Xcls_LeftProps _owner )
833                 {
834                         _this = _owner;
835                         this.el = new Gtk.Label( "init: initialziation code (vala)" );
836
837                         // my vars (dec)
838
839                         // set gobject values
840                         this.el.halign = Gtk.Align.START;
841                         this.el.tooltip_text = "This code is called after the ctor";
842                 }
843
844                 // user defined functions
845         }
846
847
848         public class Xcls_Button16 : Object
849         {
850                 public Gtk.Button el;
851                 private Xcls_LeftProps  _this;
852
853
854                         // my vars (def)
855
856                 // ctor
857                 public Xcls_Button16(Xcls_LeftProps _owner )
858                 {
859                         _this = _owner;
860                         this.el = new Gtk.Button();
861
862                         // my vars (dec)
863
864                         // set gobject values
865                         this.el.has_frame = false;
866                         var child_1 = new Xcls_Label17( _this );
867                         this.el.child = child_1.el;
868
869                         //listeners
870                         this.el.clicked.connect( ()  => {
871                                 _this.addpop.el.hide();
872                          
873                                 // is this userdef or special??
874                                 var add =   new JsRender.NodeProp.prop("cms-id","string", "" ) ;
875                                 if (_this.node.has_prop_key(add)) {
876                                         return;
877                                 }
878                                 
879                                 _this.node.add_prop( add );
880                                 
881                                 _this.view.editProp( add );
882                             
883                         });
884                 }
885
886                 // user defined functions
887         }
888         public class Xcls_Label17 : Object
889         {
890                 public Gtk.Label el;
891                 private Xcls_LeftProps  _this;
892
893
894                         // my vars (def)
895
896                 // ctor
897                 public Xcls_Label17(Xcls_LeftProps _owner )
898                 {
899                         _this = _owner;
900                         this.el = new Gtk.Label( "cms-id: (Roo JS/Pman library)" );
901
902                         // my vars (dec)
903
904                         // set gobject values
905                         this.el.halign = Gtk.Align.START;
906                         this.el.tooltip_text = "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})\n";
907                 }
908
909                 // user defined functions
910         }
911
912
913         public class Xcls_Separator18 : Object
914         {
915                 public Gtk.Separator el;
916                 private Xcls_LeftProps  _this;
917
918
919                         // my vars (def)
920
921                 // ctor
922                 public Xcls_Separator18(Xcls_LeftProps _owner )
923                 {
924                         _this = _owner;
925                         this.el = new Gtk.Separator( Gtk.Orientation.HORIZONTAL );
926
927                         // my vars (dec)
928
929                         // set gobject values
930                 }
931
932                 // user defined functions
933         }
934
935         public class Xcls_Button19 : Object
936         {
937                 public Gtk.Button el;
938                 private Xcls_LeftProps  _this;
939
940
941                         // my vars (def)
942
943                 // ctor
944                 public Xcls_Button19(Xcls_LeftProps _owner )
945                 {
946                         _this = _owner;
947                         this.el = new Gtk.Button();
948
949                         // my vars (dec)
950
951                         // set gobject values
952                         this.el.has_frame = false;
953                         var child_1 = new Xcls_Label20( _this );
954                         this.el.child = child_1.el;
955
956                         //listeners
957                         this.el.clicked.connect( (self) => {
958                                 _this.addpop.el.hide();
959                                 _this.view.popover.show(
960                                         _this.view.el, 
961                                         _this.node, 
962                                          new JsRender.NodeProp.user("", "string", "") ,
963                                         -1,  
964                                         true
965                                 );
966                          
967                         });
968                 }
969
970                 // user defined functions
971         }
972         public class Xcls_Label20 : Object
973         {
974                 public Gtk.Label el;
975                 private Xcls_LeftProps  _this;
976
977
978                         // my vars (def)
979
980                 // ctor
981                 public Xcls_Label20(Xcls_LeftProps _owner )
982                 {
983                         _this = _owner;
984                         this.el = new Gtk.Label( "String" );
985
986                         // my vars (dec)
987
988                         // set gobject values
989                         this.el.halign = Gtk.Align.START;
990                         this.el.tooltip_text = "Add a user defined string property";
991                 }
992
993                 // user defined functions
994         }
995
996
997         public class Xcls_Button21 : Object
998         {
999                 public Gtk.Button el;
1000                 private Xcls_LeftProps  _this;
1001
1002
1003                         // my vars (def)
1004
1005                 // ctor
1006                 public Xcls_Button21(Xcls_LeftProps _owner )
1007                 {
1008                         _this = _owner;
1009                         this.el = new Gtk.Button();
1010
1011                         // my vars (dec)
1012
1013                         // set gobject values
1014                         this.el.has_frame = false;
1015                         var child_1 = new Xcls_Label22( _this );
1016                         this.el.child = child_1.el;
1017
1018                         //listeners
1019                         this.el.clicked.connect( ( ) =>{
1020                          
1021                                 _this.addpop.el.hide();
1022                                _this.view.popover.show(
1023                                         _this.view.el, 
1024                                         _this.node, 
1025                                          new JsRender.NodeProp.user("", "int", "0") ,
1026                                         -1,  
1027                                         true
1028                                 );
1029                          
1030                         });
1031                 }
1032
1033                 // user defined functions
1034         }
1035         public class Xcls_Label22 : Object
1036         {
1037                 public Gtk.Label el;
1038                 private Xcls_LeftProps  _this;
1039
1040
1041                         // my vars (def)
1042
1043                 // ctor
1044                 public Xcls_Label22(Xcls_LeftProps _owner )
1045                 {
1046                         _this = _owner;
1047                         this.el = new Gtk.Label( "Number" );
1048
1049                         // my vars (dec)
1050
1051                         // set gobject values
1052                         this.el.halign = Gtk.Align.START;
1053                         this.el.tooltip_text = "Add a user defined number property";
1054                 }
1055
1056                 // user defined functions
1057         }
1058
1059
1060         public class Xcls_Button23 : Object
1061         {
1062                 public Gtk.Button el;
1063                 private Xcls_LeftProps  _this;
1064
1065
1066                         // my vars (def)
1067
1068                 // ctor
1069                 public Xcls_Button23(Xcls_LeftProps _owner )
1070                 {
1071                         _this = _owner;
1072                         this.el = new Gtk.Button();
1073
1074                         // my vars (dec)
1075
1076                         // set gobject values
1077                         this.el.has_frame = false;
1078                         var child_1 = new Xcls_Label24( _this );
1079                         this.el.child = child_1.el;
1080
1081                         //listeners
1082                         this.el.clicked.connect( ( ) =>{
1083                           
1084                                 _this.addpop.el.hide();
1085                            _this.view.popover.show(
1086                                         _this.view.el, 
1087                                         _this.node, 
1088                                          new JsRender.NodeProp.user("", "bool", "true") ,
1089                                         -1,  
1090                                         true
1091                                 ); 
1092                          
1093                         });
1094                 }
1095
1096                 // user defined functions
1097         }
1098         public class Xcls_Label24 : Object
1099         {
1100                 public Gtk.Label el;
1101                 private Xcls_LeftProps  _this;
1102
1103
1104                         // my vars (def)
1105
1106                 // ctor
1107                 public Xcls_Label24(Xcls_LeftProps _owner )
1108                 {
1109                         _this = _owner;
1110                         this.el = new Gtk.Label( "Boolean" );
1111
1112                         // my vars (dec)
1113
1114                         // set gobject values
1115                         this.el.halign = Gtk.Align.START;
1116                         this.el.tooltip_text = "Add a user defined boolean property";
1117                 }
1118
1119                 // user defined functions
1120         }
1121
1122
1123         public class Xcls_Separator25 : Object
1124         {
1125                 public Gtk.Separator el;
1126                 private Xcls_LeftProps  _this;
1127
1128
1129                         // my vars (def)
1130
1131                 // ctor
1132                 public Xcls_Separator25(Xcls_LeftProps _owner )
1133                 {
1134                         _this = _owner;
1135                         this.el = new Gtk.Separator( Gtk.Orientation.HORIZONTAL );
1136
1137                         // my vars (dec)
1138
1139                         // set gobject values
1140                 }
1141
1142                 // user defined functions
1143         }
1144
1145         public class Xcls_Button26 : Object
1146         {
1147                 public Gtk.Button el;
1148                 private Xcls_LeftProps  _this;
1149
1150
1151                         // my vars (def)
1152
1153                 // ctor
1154                 public Xcls_Button26(Xcls_LeftProps _owner )
1155                 {
1156                         _this = _owner;
1157                         this.el = new Gtk.Button();
1158
1159                         // my vars (dec)
1160
1161                         // set gobject values
1162                         this.el.has_frame = false;
1163                         var child_1 = new Xcls_Label27( _this );
1164                         this.el.child = child_1.el;
1165
1166                         //listeners
1167                         this.el.clicked.connect( ( ) =>{
1168                                 _this.addpop.el.hide();
1169                            _this.view.popover.show(
1170                                         _this.view.el, 
1171                                         _this.node, 
1172                                          new JsRender.NodeProp.jsmethod("") ,
1173                                         -1,  
1174                                         true
1175                                 );
1176                         
1177                          
1178                         });
1179                 }
1180
1181                 // user defined functions
1182         }
1183         public class Xcls_Label27 : Object
1184         {
1185                 public Gtk.Label el;
1186                 private Xcls_LeftProps  _this;
1187
1188
1189                         // my vars (def)
1190
1191                 // ctor
1192                 public Xcls_Label27(Xcls_LeftProps _owner )
1193                 {
1194                         _this = _owner;
1195                         this.el = new Gtk.Label( "Javascript Function" );
1196
1197                         // my vars (dec)
1198
1199                         // set gobject values
1200                         this.el.halign = Gtk.Align.START;
1201                         this.el.tooltip_text = "Add a javascript  function";
1202                 }
1203
1204                 // user defined functions
1205         }
1206
1207
1208         public class Xcls_Button28 : Object
1209         {
1210                 public Gtk.Button el;
1211                 private Xcls_LeftProps  _this;
1212
1213
1214                         // my vars (def)
1215
1216                 // ctor
1217                 public Xcls_Button28(Xcls_LeftProps _owner )
1218                 {
1219                         _this = _owner;
1220                         this.el = new Gtk.Button();
1221
1222                         // my vars (dec)
1223
1224                         // set gobject values
1225                         this.el.has_frame = false;
1226                         var child_1 = new Xcls_Label29( _this );
1227                         this.el.child = child_1.el;
1228
1229                         //listeners
1230                         this.el.clicked.connect( ( ) =>{
1231                                 _this.addpop.el.hide();
1232                             _this.view.popover.show(
1233                                         _this.view.el, 
1234                                         _this.node, 
1235                                          new JsRender.NodeProp.valamethod("") ,
1236                                         -1,  
1237                                         true
1238                                 ); 
1239                         });
1240                 }
1241
1242                 // user defined functions
1243         }
1244         public class Xcls_Label29 : Object
1245         {
1246                 public Gtk.Label el;
1247                 private Xcls_LeftProps  _this;
1248
1249
1250                         // my vars (def)
1251
1252                 // ctor
1253                 public Xcls_Label29(Xcls_LeftProps _owner )
1254                 {
1255                         _this = _owner;
1256                         this.el = new Gtk.Label( "Vala Method" );
1257
1258                         // my vars (dec)
1259
1260                         // set gobject values
1261                         this.el.halign = Gtk.Align.START;
1262                         this.el.tooltip_text = "Add a user defined method to a object";
1263                 }
1264
1265                 // user defined functions
1266         }
1267
1268
1269         public class Xcls_Button30 : Object
1270         {
1271                 public Gtk.Button el;
1272                 private Xcls_LeftProps  _this;
1273
1274
1275                         // my vars (def)
1276
1277                 // ctor
1278                 public Xcls_Button30(Xcls_LeftProps _owner )
1279                 {
1280                         _this = _owner;
1281                         this.el = new Gtk.Button();
1282
1283                         // my vars (dec)
1284
1285                         // set gobject values
1286                         this.el.has_frame = false;
1287                         var child_1 = new Xcls_Label31( _this );
1288                         this.el.child = child_1.el;
1289
1290                         //listeners
1291                         this.el.clicked.connect( ( ) =>{
1292                                 _this.addpop.el.hide(); 
1293                           _this.view.popover.show(
1294                                         _this.view.el, 
1295                                         _this.node, 
1296                                          new JsRender.NodeProp.sig("" ) ,
1297                                         -1,  
1298                                         true
1299                                 );    
1300                         });
1301                 }
1302
1303                 // user defined functions
1304         }
1305         public class Xcls_Label31 : Object
1306         {
1307                 public Gtk.Label el;
1308                 private Xcls_LeftProps  _this;
1309
1310
1311                         // my vars (def)
1312
1313                 // ctor
1314                 public Xcls_Label31(Xcls_LeftProps _owner )
1315                 {
1316                         _this = _owner;
1317                         this.el = new Gtk.Label( "Vala Signal" );
1318
1319                         // my vars (dec)
1320
1321                         // set gobject values
1322                         this.el.halign = Gtk.Align.START;
1323                         this.el.tooltip_text = "Add a user defined signal to a object";
1324                 }
1325
1326                 // user defined functions
1327         }
1328
1329
1330         public class Xcls_Separator32 : Object
1331         {
1332                 public Gtk.Separator el;
1333                 private Xcls_LeftProps  _this;
1334
1335
1336                         // my vars (def)
1337
1338                 // ctor
1339                 public Xcls_Separator32(Xcls_LeftProps _owner )
1340                 {
1341                         _this = _owner;
1342                         this.el = new Gtk.Separator( Gtk.Orientation.HORIZONTAL );
1343
1344                         // my vars (dec)
1345
1346                         // set gobject values
1347                 }
1348
1349                 // user defined functions
1350         }
1351
1352         public class Xcls_Button33 : Object
1353         {
1354                 public Gtk.Button el;
1355                 private Xcls_LeftProps  _this;
1356
1357
1358                         // my vars (def)
1359
1360                 // ctor
1361                 public Xcls_Button33(Xcls_LeftProps _owner )
1362                 {
1363                         _this = _owner;
1364                         this.el = new Gtk.Button();
1365
1366                         // my vars (dec)
1367
1368                         // set gobject values
1369                         this.el.has_frame = false;
1370                         var child_1 = new Xcls_Label34( _this );
1371                         this.el.child = child_1.el;
1372
1373                         //listeners
1374                         this.el.clicked.connect( ( ) =>{
1375                                 _this.addpop.el.hide();
1376                                 _this.view.popover.show(
1377                                         _this.view.el, 
1378                                         _this.node, 
1379                                          new JsRender.NodeProp.prop("flexy:if", "string", "value_or_condition") ,
1380                                         -1,  
1381                                         true
1382                                 );
1383                         
1384                         
1385                         });
1386                 }
1387
1388                 // user defined functions
1389         }
1390         public class Xcls_Label34 : Object
1391         {
1392                 public Gtk.Label el;
1393                 private Xcls_LeftProps  _this;
1394
1395
1396                         // my vars (def)
1397
1398                 // ctor
1399                 public Xcls_Label34(Xcls_LeftProps _owner )
1400                 {
1401                         _this = _owner;
1402                         this.el = new Gtk.Label( "Flexy - If" );
1403
1404                         // my vars (dec)
1405
1406                         // set gobject values
1407                         this.el.halign = Gtk.Align.START;
1408                         this.el.tooltip_text = "Add a flexy if (for HTML templates)";
1409                 }
1410
1411                 // user defined functions
1412         }
1413
1414
1415         public class Xcls_Button35 : Object
1416         {
1417                 public Gtk.Button el;
1418                 private Xcls_LeftProps  _this;
1419
1420
1421                         // my vars (def)
1422
1423                 // ctor
1424                 public Xcls_Button35(Xcls_LeftProps _owner )
1425                 {
1426                         _this = _owner;
1427                         this.el = new Gtk.Button();
1428
1429                         // my vars (dec)
1430
1431                         // set gobject values
1432                         this.el.has_frame = false;
1433                         var child_1 = new Xcls_Label36( _this );
1434                         this.el.child = child_1.el;
1435
1436                         //listeners
1437                         this.el.clicked.connect( ( ) =>{
1438                                 _this.addpop.el.hide();
1439                                 _this.view.popover.show(
1440                                         _this.view.el, 
1441                                         _this.node, 
1442                                          new JsRender.NodeProp.prop("flexy:include", "string", "name_of_file.html") ,
1443                                         -1,  
1444                                         true
1445                                 );
1446                         
1447                           
1448                         });
1449                 }
1450
1451                 // user defined functions
1452         }
1453         public class Xcls_Label36 : Object
1454         {
1455                 public Gtk.Label el;
1456                 private Xcls_LeftProps  _this;
1457
1458
1459                         // my vars (def)
1460
1461                 // ctor
1462                 public Xcls_Label36(Xcls_LeftProps _owner )
1463                 {
1464                         _this = _owner;
1465                         this.el = new Gtk.Label( "Flexy - Include" );
1466
1467                         // my vars (dec)
1468
1469                         // set gobject values
1470                         this.el.halign = Gtk.Align.START;
1471                         this.el.tooltip_text = "Add a flexy include (for HTML templates)";
1472                 }
1473
1474                 // user defined functions
1475         }
1476
1477
1478         public class Xcls_Button37 : Object
1479         {
1480                 public Gtk.Button el;
1481                 private Xcls_LeftProps  _this;
1482
1483
1484                         // my vars (def)
1485
1486                 // ctor
1487                 public Xcls_Button37(Xcls_LeftProps _owner )
1488                 {
1489                         _this = _owner;
1490                         this.el = new Gtk.Button();
1491
1492                         // my vars (dec)
1493
1494                         // set gobject values
1495                         this.el.has_frame = false;
1496                         this.el.tooltip_markup = "Add a flexy include (for HTML templates)";
1497                         var child_1 = new Xcls_Label38( _this );
1498                         this.el.child = child_1.el;
1499
1500                         //listeners
1501                         this.el.clicked.connect( ( ) =>{
1502                                 _this.addpop.el.hide();
1503                                 _this.view.popover.show(
1504                                         _this.view.el, 
1505                                         _this.node, 
1506                                          new JsRender.NodeProp.prop("flexy:if", "string", "value_or_condition") ,
1507                                         -1,  
1508                                         true
1509                                 );
1510                           
1511                         });
1512                 }
1513
1514                 // user defined functions
1515         }
1516         public class Xcls_Label38 : Object
1517         {
1518                 public Gtk.Label el;
1519                 private Xcls_LeftProps  _this;
1520
1521
1522                         // my vars (def)
1523
1524                 // ctor
1525                 public Xcls_Label38(Xcls_LeftProps _owner )
1526                 {
1527                         _this = _owner;
1528                         this.el = new Gtk.Label( "Flexy - Foreach" );
1529
1530                         // my vars (dec)
1531
1532                         // set gobject values
1533                         this.el.halign = Gtk.Align.START;
1534                         this.el.tooltip_text = "Add a flexy foreach (for HTML templates)";
1535                 }
1536
1537                 // user defined functions
1538         }
1539
1540
1541
1542
1543
1544
1545         public class Xcls_EditProps : Object
1546         {
1547                 public Gtk.ScrolledWindow el;
1548                 private Xcls_LeftProps  _this;
1549
1550
1551                         // my vars (def)
1552                 public bool editing;
1553
1554                 // ctor
1555                 public Xcls_EditProps(Xcls_LeftProps _owner )
1556                 {
1557                         _this = _owner;
1558                         _this.EditProps = this;
1559                         this.el = new Gtk.ScrolledWindow();
1560
1561                         // my vars (dec)
1562                         this.editing = false;
1563
1564                         // set gobject values
1565                         this.el.hexpand = true;
1566                         this.el.vexpand = true;
1567                         new Xcls_view( _this );
1568                         this.el.set_child ( _this.view.el  );
1569
1570                         // init method
1571
1572                         {
1573                           
1574                            this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1575                         }
1576                 }
1577
1578                 // user defined functions
1579         }
1580         public class Xcls_view : Object
1581         {
1582                 public Gtk.ColumnView el;
1583                 private Xcls_LeftProps  _this;
1584
1585
1586                         // my vars (def)
1587                 public Gtk.CssProvider css;
1588                 public Xcls_PopoverProperty popover;
1589
1590                 // ctor
1591                 public Xcls_view(Xcls_LeftProps _owner )
1592                 {
1593                         _this = _owner;
1594                         _this.view = this;
1595                         new Xcls_selmodel( _this );
1596                         this.el = new Gtk.ColumnView( _this.selmodel.el );
1597
1598                         // my vars (dec)
1599                         this.popover = null;
1600
1601                         // set gobject values
1602                         this.el.name = "leftprops-view";
1603                         this.el.single_click_activate = false;
1604                         this.el.hexpand = true;
1605                         this.el.vexpand = true;
1606                         this.el.show_row_separators = true;
1607                         new Xcls_deletemenu( _this );
1608                         var child_3 = new Xcls_GestureClick44( _this );
1609                         child_3.ref();
1610                         this.el.add_controller(  child_3.el );
1611                         var child_4 = new Xcls_GestureClick45( _this );
1612                         child_4.ref();
1613                         this.el.add_controller(  child_4.el );
1614                         new Xcls_keycol( _this );
1615                         this.el.append_column ( _this.keycol.el  );
1616                         new Xcls_valcol( _this );
1617                         this.el.append_column ( _this.valcol.el  );
1618                         new Xcls_ContextMenu( _this );
1619
1620                         // init method
1621
1622                         {
1623                          
1624                                 this.css = new Gtk.CssProvider();
1625                                  
1626                                         this.css.load_from_string("
1627                         #leftprops-view { font-size: 12px;}
1628                                  
1629                         #leftprops-view  dropdown button { 
1630                                                 min-height: 16px;                        
1631                                                 outline-offset : 0;
1632                                         }
1633                         #leftprops-view cell dropdown label  {
1634                                         padding-top:0px;
1635                                         padding-bottom:0px;
1636                         }
1637                         #leftprops-view cell   { 
1638                                         padding-top:2px;
1639                                         padding-bottom:2px;
1640                                         }
1641                         #leftprops-view cell label,  #leftprops-view cell editablelable {
1642                                         padding-top:4px;
1643                                         padding-bottom:4px;
1644                         }");
1645                          
1646                                         Gtk.StyleContext.add_provider_for_display(
1647                                         this.el.get_display(),
1648                                         this.css,
1649                                         Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
1650                                 );
1651                                         
1652                            
1653                         }
1654                 }
1655
1656                 // user defined functions
1657                 public Gtk.Widget? getWidgetAtRow (uint row) {
1658                 /*
1659                         
1660                 from            https://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465
1661                         var colview = gesture.widget;
1662                         var line_no = check_list_widget(colview, x,y);
1663                          if (line_no > -1) {
1664                                 var item = colview.model.get_item(line_no);
1665                                  
1666                         }
1667                         */
1668                                 GLib.debug("Get Widget At Row %d", (int)row);
1669                         var  child = this.el.get_first_child(); 
1670                         var line_no = -1; 
1671                         var reading_header = true;
1672                 
1673                         while (child != null) {
1674                                         GLib.debug("Got %s", child.get_type().name());
1675                             if (reading_header) {
1676                                          
1677                                            
1678                                                 if (child.get_type().name() != "GtkColumnListView") {
1679                                                         child = child.get_next_sibling();
1680                                                         continue;
1681                                                 }
1682                                                 child = child.get_first_child(); 
1683                                                 reading_header = false;
1684                                                 continue;
1685                                 }
1686                                     if (child.get_type().name() != "GtkColumnViewRowWidget") {
1687                                     child = child.get_next_sibling();
1688                                     continue;
1689                                     }
1690                                     line_no++;
1691                                         if (line_no == row) {
1692                                                 GLib.debug("Returning widget %s", child.get_type().name());
1693                                             return (Gtk.Widget)child;
1694                                     }
1695                                 child = child.get_next_sibling(); 
1696                         }
1697                                 GLib.debug("Rturning null");
1698                         return null;
1699                 
1700                  }
1701                 public void editProp (JsRender.NodeProp prop) 
1702                 {
1703                         var sm = _this.selmodel.el;
1704                  
1705                                 var sr = -1;
1706                                 GLib.debug("finding node");
1707                                 _this.selmodel.selectProp(prop);
1708                                 
1709                                 for (var i = 0 ; i < sm.n_items; i++) {
1710                                         var r = (JsRender.NodeProp)sm.get_item(i);
1711                                         if (r.equals(prop)) {
1712                                                 sr = i;
1713                                                 break;
1714                                         }
1715                                 }
1716                                 if (sr < 0) {
1717                                         GLib.debug("finding node - cant find it");
1718                                                         
1719                                         return;
1720                                 }
1721                                 var r = this.getWidgetAtRow(sr);
1722                                 GLib.debug("r = %s", r.get_type().name());
1723                                 var ca = r.get_first_child();
1724                                 var ll = (Gtk.Label)ca.get_first_child();
1725                                 var cb = ca.get_next_sibling();
1726                                 var b = cb.get_first_child();
1727                                 var e = (Gtk.EditableLabel) b.get_first_child();
1728                                 var l = (Gtk.Label) e.get_next_sibling();
1729                                 var d = (Gtk.DropDown) l.get_next_sibling();
1730                                 
1731                                 GLib.debug("row key = %s", ll.label);
1732                                 if (e.get_visible()) {
1733                                         _this.stop_editor();
1734                                         e.start_editing();
1735                                         //GLib.Timeout.add_once(500, () => {
1736                                         //      var st = (Gtk.Stack) e.get_first_child();
1737                                         //      var ed = (Gtk.Entry) st.get_visible_child();
1738                                         //      ed.grab_focus_without_selecting();
1739                                         //});
1740                                         return;
1741                                 }
1742                                 if (d.get_visible()) {
1743                                         _this.stop_editor();
1744                                         d.activate();
1745                                         return;
1746                                 }
1747                                 if (l.get_visible()) {
1748                                         _this.stop_editor();
1749                                 _this.show_editor(_this.file, prop.parent, prop);
1750                                 
1751                                 }
1752                                 
1753                                 
1754                                 
1755                                 //gtkcolumnviewrowwidget
1756                                   // cell widet
1757                                   // cell widget
1758                                         // box
1759                                                 // entry / label / dropdown
1760                                                 
1761                                  
1762                 }
1763                 public int getColAt (double x,  double y) {
1764                 /*
1765                         
1766                 from            https://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465
1767                           
1768                         */
1769                                 //Gtk.Allocation alloc = { 0, 0, 0, 0 };
1770                         var  child = this.el.get_first_child(); 
1771                          
1772                         var col = 0;
1773                         var offx = 0;
1774                         while (child != null) {
1775                                         GLib.debug("Got %s", child.get_type().name());
1776                                         
1777                                         if (child.get_type().name() == "GtkColumnViewRowWidget") {
1778                                                 child = child.get_first_child();
1779                                                 continue;
1780                                         }
1781                                         
1782                                         //child.get_allocation(out alloc);
1783                                         if (x <  (child.get_width() + offx)) {
1784                                                 return col;
1785                                         }
1786                                         offx += child.get_width();
1787                                         col++;
1788                                         child = child.get_next_sibling();
1789                                 }
1790                              
1791                                           
1792                         return -1;
1793                 
1794                  }
1795                 public int getRowAt (double x,  double  y, out string pos) {
1796                 
1797                         var w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);
1798                         //GLib.debug("got widget %s", w == null ? "nothing" : w.get_type().name());
1799                         if (w == null) {
1800                                 return -1;
1801                         }
1802                         
1803                         var row= w.get_ancestor(GLib.Type.from_name("GtkColumnViewRowWidget"));
1804                         if (row == null) {
1805                                 return -1;
1806                         }
1807                         
1808                         //GLib.debug("got colview %s", row == null ? "nothing" : row.get_type().name());
1809                          
1810                         var rn = 0;
1811                         var cr = row;
1812                          
1813                         while (cr.get_prev_sibling() != null) {
1814                                 rn++;
1815                                 cr = cr.get_prev_sibling();
1816                         }
1817                         
1818                         //GLib.debug("row number is %d", rn);
1819                         //GLib.debug("click %d, %d", (int)x, (int)y);
1820                         // above or belw
1821                         Graphene.Rect  bounds;
1822                         row.compute_bounds(this.el, out bounds);
1823                         //GLib.debug("click x=%d, y=%d, w=%d, h=%d", 
1824                         //      (int)bounds.get_x(), (int)bounds.get_y(),
1825                         //      (int)bounds.get_width(), (int)bounds.get_height()
1826                         //      );
1827                         var ypos = y - bounds.get_y();
1828                         //GLib.debug("rel ypos = %d", (int)ypos);       
1829                         var rpos = 100.0 * (ypos / bounds.get_height());
1830                         //GLib.debug("rel pos = %d %%", (int)rpos);
1831                         pos = "over";
1832                         
1833                         if (rpos > 80) {
1834                                 pos = "below";
1835                         } else if (rpos < 20) {
1836                                 pos = "above";
1837                         } 
1838                         return rn;
1839                  }
1840         }
1841         public class Xcls_deletemenu : Object
1842         {
1843                 public Gtk.Popover el;
1844                 private Xcls_LeftProps  _this;
1845
1846
1847                         // my vars (def)
1848
1849                 // ctor
1850                 public Xcls_deletemenu(Xcls_LeftProps _owner )
1851                 {
1852                         _this = _owner;
1853                         _this.deletemenu = this;
1854                         this.el = new Gtk.Popover();
1855
1856                         // my vars (dec)
1857
1858                         // set gobject values
1859                         var child_1 = new Xcls_Box42( _this );
1860                         this.el.child = child_1.el;
1861                 }
1862
1863                 // user defined functions
1864         }
1865         public class Xcls_Box42 : Object
1866         {
1867                 public Gtk.Box el;
1868                 private Xcls_LeftProps  _this;
1869
1870
1871                         // my vars (def)
1872
1873                 // ctor
1874                 public Xcls_Box42(Xcls_LeftProps _owner )
1875                 {
1876                         _this = _owner;
1877                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1878
1879                         // my vars (dec)
1880
1881                         // set gobject values
1882                         var child_1 = new Xcls_Button43( _this );
1883                         child_1.ref();
1884                         this.el.append( child_1.el );
1885                 }
1886
1887                 // user defined functions
1888         }
1889         public class Xcls_Button43 : Object
1890         {
1891                 public Gtk.Button el;
1892                 private Xcls_LeftProps  _this;
1893
1894
1895                         // my vars (def)
1896
1897                 // ctor
1898                 public Xcls_Button43(Xcls_LeftProps _owner )
1899                 {
1900                         _this = _owner;
1901                         this.el = new Gtk.Button();
1902
1903                         // my vars (dec)
1904
1905                         // set gobject values
1906                         this.el.has_frame = false;
1907                         this.el.label = "Delete";
1908                         var child_1 = new Xcls_Label1187( _this );
1909                         this.el.child = child_1.el;
1910
1911                         //listeners
1912                         this.el.clicked.connect( ( ) => {
1913                                 
1914                         
1915                                 var n = (JsRender.NodeProp) _this.selmodel.el.selected_item;
1916                         
1917                                 _this.deletemenu.el.hide();
1918                                 _this.node.remove_prop(n);
1919                         });
1920                 }
1921
1922                 // user defined functions
1923         }
1924         public class Xcls_Label1187 : Object
1925         {
1926                 public Gtk.Label el;
1927                 private Xcls_LeftProps  _this;
1928
1929
1930                         // my vars (def)
1931
1932                 // ctor
1933                 public Xcls_Label1187(Xcls_LeftProps _owner )
1934                 {
1935                         _this = _owner;
1936                         this.el = new Gtk.Label( "Delete Property / Method" );
1937
1938                         // my vars (dec)
1939
1940                         // set gobject values
1941                         this.el.halign = Gtk.Align.START;
1942                 }
1943
1944                 // user defined functions
1945         }
1946
1947
1948
1949
1950         public class Xcls_GestureClick44 : Object
1951         {
1952                 public Gtk.GestureClick el;
1953                 private Xcls_LeftProps  _this;
1954
1955
1956                         // my vars (def)
1957
1958                 // ctor
1959                 public Xcls_GestureClick44(Xcls_LeftProps _owner )
1960                 {
1961                         _this = _owner;
1962                         this.el = new Gtk.GestureClick();
1963
1964                         // my vars (dec)
1965
1966                         // set gobject values
1967
1968                         //listeners
1969                         this.el.pressed.connect( (n_press, in_x, in_y) => {
1970                         
1971                                 GLib.debug("Prssed %d", (int)  this.el.get_current_button());
1972                                 
1973                                 var col = _this.view.getColAt(in_x, in_y);
1974                                 if (col != 0) {
1975                                         return;
1976                                 }
1977                                 string pos;
1978                                 var row = _this.view.getRowAt(in_x, in_y, out pos);
1979                                 
1980                                 if (row < 0) {
1981                                         return;
1982                         
1983                                 }
1984                                 GLib.debug("hit row %d", row);
1985                                 var prop = _this.selmodel.getPropAt(row);
1986                                 _this.selmodel.selectProp(prop);
1987                         
1988                                 //var point_at = _this.view.getWidgetAtRow(row);
1989                                 
1990                                         // need to shift down, as ev.y does not inclucde header apparently..
1991                                 // or popover might be trying to do a central?
1992                         //       _this.view.editPropertyDetails(prop, (int) in_y + 12); 
1993                                  _this.stop_editor();
1994                              _this.view.popover.show(
1995                                                 _this.view.el, 
1996                                                 _this.node, prop,  
1997                                          (int)in_y);
1998                             
1999                             
2000                               
2001                         });
2002                 }
2003
2004                 // user defined functions
2005         }
2006
2007         public class Xcls_GestureClick45 : Object
2008         {
2009                 public Gtk.GestureClick el;
2010                 private Xcls_LeftProps  _this;
2011
2012
2013                         // my vars (def)
2014
2015                 // ctor
2016                 public Xcls_GestureClick45(Xcls_LeftProps _owner )
2017                 {
2018                         _this = _owner;
2019                         this.el = new Gtk.GestureClick();
2020
2021                         // my vars (dec)
2022
2023                         // set gobject values
2024                         this.el.button = 3;
2025
2026                         //listeners
2027                         this.el.pressed.connect( (n_press, in_x, in_y) => {
2028                         
2029                                 
2030                                  
2031                                 string pos;
2032                                 var row = _this.view.getRowAt(in_x, in_y, out pos);
2033                                 
2034                                 if (row < 0) {
2035                                         return;
2036                         
2037                                 }
2038                                 
2039                                 _this.stop_editor();
2040                                 GLib.debug("hit row %d", row);
2041                                 var prop = _this.selmodel.getPropAt(row);
2042                                 _this.selmodel.selectProp(prop);
2043                                 
2044                                 
2045                                 
2046                                 GLib.debug("Prssed %d", (int)  this.el.get_current_button());
2047                                 //_this.deletemenu.el.set_parent(_this.view.el);
2048                                 if (_this.deletemenu.el.parent == null) {
2049                                         _this.deletemenu.el.set_parent(_this.main_window.el);
2050                                 }
2051                                 
2052                                 
2053                                  
2054                                 _this.deletemenu.el.set_offset(
2055                                                 (int)in_x  - _this.view.el.get_width() ,
2056                                                 (int)in_y - _this.view.el.get_height()
2057                                         );
2058                                 _this.deletemenu.el.set_position(Gtk.PositionType.BOTTOM); 
2059                             _this.deletemenu.el.popup();
2060                               
2061                         });
2062                 }
2063
2064                 // user defined functions
2065         }
2066
2067         public class Xcls_selmodel : Object
2068         {
2069                 public Gtk.SingleSelection el;
2070                 private Xcls_LeftProps  _this;
2071
2072
2073                         // my vars (def)
2074
2075                 // ctor
2076                 public Xcls_selmodel(Xcls_LeftProps _owner )
2077                 {
2078                         _this = _owner;
2079                         _this.selmodel = this;
2080                         new Xcls_model( _this );
2081                         this.el = new Gtk.SingleSelection( _this.model.el );
2082
2083                         // my vars (dec)
2084
2085                         // set gobject values
2086                         this.el.can_unselect = true;
2087                 }
2088
2089                 // user defined functions
2090                 public int propToRow (JsRender.NodeProp prop) {
2091                         for (var i = 0 ; i < this.el.n_items; i++) {
2092                                 var r = (JsRender.NodeProp)this.el.get_item(i);
2093                                 if (r.equals(prop)) {
2094                                         return i;
2095                                         
2096                                 }
2097                         }
2098                         return -1;
2099                          
2100                 }
2101                 public void startEditing (JsRender.NodeProp prop) {
2102                         // should we call select?? - caller does int (from windowstate)
2103                         
2104                 }
2105                 public void selectProp (JsRender.NodeProp prop) {
2106                         for (var i = 0 ; i < this.el.n_items; i++) {
2107                                 var r = (JsRender.NodeProp)this.el.get_item(i);
2108                                 if (r.equals(prop)) {
2109                                         this.el.selected = i;
2110                                         return;
2111                                 }
2112                         }
2113                          
2114                 }
2115                 public JsRender.NodeProp getPropAt (uint row) {
2116                 
2117                         return   (JsRender.NodeProp) this.el.get_item(row);
2118                 
2119                          
2120                 }
2121         }
2122         public class Xcls_model : Object
2123         {
2124                 public GLib.ListStore el;
2125                 private Xcls_LeftProps  _this;
2126
2127
2128                         // my vars (def)
2129
2130                 // ctor
2131                 public Xcls_model(Xcls_LeftProps _owner )
2132                 {
2133                         _this = _owner;
2134                         _this.model = this;
2135                         this.el = new GLib.ListStore(typeof(JsRender.NodeProp));
2136
2137                         // my vars (dec)
2138
2139                         // set gobject values
2140                 }
2141
2142                 // user defined functions
2143         }
2144
2145
2146         public class Xcls_keycol : Object
2147         {
2148                 public Gtk.ColumnViewColumn el;
2149                 private Xcls_LeftProps  _this;
2150
2151
2152                         // my vars (def)
2153
2154                 // ctor
2155                 public Xcls_keycol(Xcls_LeftProps _owner )
2156                 {
2157                         _this = _owner;
2158                         _this.keycol = this;
2159                         var child_1 = new Xcls_SignalListItemFactory49( _this );
2160                         child_1.ref();
2161                         this.el = new Gtk.ColumnViewColumn( "Property", child_1.el );
2162
2163                         // my vars (dec)
2164
2165                         // set gobject values
2166                         this.el.id = "keycol";
2167                         this.el.expand = true;
2168                         this.el.resizable = true;
2169                 }
2170
2171                 // user defined functions
2172         }
2173         public class Xcls_SignalListItemFactory49 : Object
2174         {
2175                 public Gtk.SignalListItemFactory el;
2176                 private Xcls_LeftProps  _this;
2177
2178
2179                         // my vars (def)
2180
2181                 // ctor
2182                 public Xcls_SignalListItemFactory49(Xcls_LeftProps _owner )
2183                 {
2184                         _this = _owner;
2185                         this.el = new Gtk.SignalListItemFactory();
2186
2187                         // my vars (dec)
2188
2189                         // set gobject values
2190
2191                         //listeners
2192                         this.el.setup.connect( (listitem) => {
2193                                 var lbl = new Gtk.Label("");
2194                                 ((Gtk.ListItem)listitem).set_child(lbl);
2195                                 lbl.justify = Gtk.Justification.LEFT;
2196                                 lbl.xalign = 1;
2197                                 lbl.use_markup = true;
2198                                 lbl.ellipsize = Pango.EllipsizeMode.START;
2199                                 /*lbl.changed.connect(() => {
2200                                         // notify and save the changed value...
2201                                         //var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem.get_item());
2202                                  
2203                                 //prop.val = lbl.text;
2204                                 //_this.updateIter(iter,prop);
2205                                 _this.changed();
2206                                 });
2207                                 */
2208                                 ((Gtk.ListItem)listitem).activatable = true;
2209                         });
2210                         this.el.bind.connect( (listitem) => {
2211                          var lb = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
2212                          var item = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();
2213                         
2214                         
2215                         item.bind_property("to_display_name_prop",
2216                                             lb, "label",
2217                                            GLib.BindingFlags.SYNC_CREATE);
2218                         item.bind_property("to_tooltip_name_prop",
2219                                             lb, "tooltip_markup",
2220                                            GLib.BindingFlags.SYNC_CREATE);
2221                         // was item (1) in old layout
2222                          
2223                         
2224                         });
2225                 }
2226
2227                 // user defined functions
2228         }
2229
2230
2231         public class Xcls_valcol : Object
2232         {
2233                 public Gtk.ColumnViewColumn el;
2234                 private Xcls_LeftProps  _this;
2235
2236
2237                         // my vars (def)
2238
2239                 // ctor
2240                 public Xcls_valcol(Xcls_LeftProps _owner )
2241                 {
2242                         _this = _owner;
2243                         _this.valcol = this;
2244                         var child_1 = new Xcls_SignalListItemFactory51( _this );
2245                         child_1.ref();
2246                         this.el = new Gtk.ColumnViewColumn( "Value", child_1.el );
2247
2248                         // my vars (dec)
2249
2250                         // set gobject values
2251                         this.el.id = "valcol";
2252                         this.el.expand = true;
2253                         this.el.resizable = true;
2254                 }
2255
2256                 // user defined functions
2257         }
2258         public class Xcls_SignalListItemFactory51 : Object
2259         {
2260                 public Gtk.SignalListItemFactory el;
2261                 private Xcls_LeftProps  _this;
2262
2263
2264                         // my vars (def)
2265                 public bool is_setting;
2266
2267                 // ctor
2268                 public Xcls_SignalListItemFactory51(Xcls_LeftProps _owner )
2269                 {
2270                         _this = _owner;
2271                         this.el = new Gtk.SignalListItemFactory();
2272
2273                         // my vars (dec)
2274                         this.is_setting = false;
2275
2276                         // set gobject values
2277
2278                         //listeners
2279                         this.el.setup.connect( (listitem) => {
2280                                 var hb = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2281                                 var elbl  = new Gtk.EditableLabel("");
2282                                 elbl.hexpand = true;
2283                                 hb.append(elbl);
2284                                 var lbl  = new Gtk.Label("");
2285                                 hb.append(lbl);
2286                                 lbl.hexpand = true;
2287                                 lbl.use_markup = true;
2288                                 lbl.xalign =0;
2289                                 lbl.ellipsize = Pango.EllipsizeMode.END;
2290                                 var cb = new Gtk.DropDown(new Gtk.StringList({}), null);
2291                                 cb.hexpand = true;
2292                          
2293                                 hb.append(cb);
2294                                 ((Gtk.ListItem)listitem).set_child(hb);
2295                                  
2296                                  var ef = new Gtk.EventControllerFocus();
2297                                  ef.enter.connect(() => {
2298                                          _this.stop_editor();
2299                                           var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2300                                          _this.selmodel.selectProp(prop);               
2301                                  });
2302                                  elbl.add_controller(ef);
2303                                  
2304                                  
2305                                   // dropdown??? - stop editing, and highliht node
2306                                  var tb = (Gtk.ToggleButton) cb.get_first_child();
2307                                  tb.clicked.connect(() => {
2308                                          var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2309                                                 
2310                                          _this.stop_editor();
2311                                          _this.selmodel.selectProp(prop);
2312                                          
2313                                  });
2314                                 elbl.changed.connect(() => {
2315                                         // notify and save the changed value...
2316                                         
2317                                 //_this.updateIter(iter,prop);
2318                                 // this should happen automatically
2319                                 
2320                                 if (!_this.loading && !this.is_setting) {
2321                                             var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2322                                                  
2323                                          
2324                                             prop.val = elbl.text;
2325                                          GLib.debug("calling changed");
2326                                         _this.changed();
2327                                        
2328                                 }
2329                                 
2330                                 });
2331                                 
2332                                 
2333                                 cb.notify["selected"].connect(() => {
2334                                         // dropdown selection changed.
2335                                         
2336                                         
2337                                         
2338                                 //_this.updateIter(iter,prop);
2339                                 if (!_this.loading && !this.is_setting) {
2340                                             var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2341                                             var model = (Gtk.StringList)cb.model;
2342                                             prop.val =   model.get_string(cb.selected);
2343                                             GLib.debug("property set to %s", prop.val);
2344                                         GLib.debug("calling changed");
2345                                         _this.changed();
2346                                          
2347                                 }
2348                                 
2349                                         
2350                                 });
2351                                 var gc = new Gtk.GestureClick();
2352                                 lbl.add_controller(gc);
2353                                 gc.pressed.connect(() => {
2354                                         var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2355                                          _this.stop_editor();
2356                                     _this.show_editor(_this.file, prop.parent, prop);
2357                                 });
2358                                   
2359                                 
2360                                 
2361                         });
2362                         this.el.bind.connect( (listitem) => {
2363                                  this.is_setting = true;
2364                         
2365                         
2366                                 var bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
2367                          
2368                                 
2369                                 
2370                                 
2371                                 var elbl = (Gtk.EditableLabel)bx.get_first_child();
2372                                 var lbl = (Gtk.Label) elbl.get_next_sibling();
2373                                 var cb  = (Gtk.DropDown) lbl.get_next_sibling();
2374                                 // decide if it's a combo or editable text..
2375                                 var model = (Gtk.StringList) cb.model;
2376                          
2377                                 elbl.hide();
2378                                 lbl.hide();
2379                                 cb.hide();
2380                                 
2381                                 var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();
2382                                 //GLib.debug("prop = %s", prop.get_type().name());
2383                                 //GLib.debug("prop.val = %s", prop.val);
2384                                 //GLib.debug("prop.key = %s", prop.to_display_name());
2385                                  
2386                             var use_textarea =  prop.useTextArea();
2387                             
2388                             
2389                             var pal = _this.file.project.palete;
2390                                 
2391                             string[] opts;
2392                             var has_opts = pal.typeOptions(_this.node.fqn(), prop.name, prop.rtype, out opts);
2393                             
2394                             if (!has_opts && prop.ptype == JsRender.NodePropType.RAW) {
2395                                 use_textarea = true;
2396                             }
2397                             
2398                             
2399                             if (use_textarea) {
2400                                 prop.bind_property("val_short",
2401                                             lbl, "label",
2402                                            GLib.BindingFlags.SYNC_CREATE);
2403                                 prop.bind_property("val_tooltip",
2404                                             lbl, "tooltip_markup",
2405                                            GLib.BindingFlags.SYNC_CREATE);
2406                                 lbl.show();
2407                                         this.is_setting = false;        
2408                                 return;
2409                                 
2410                             }
2411                              
2412                                 
2413                                 
2414                                 
2415                                 
2416                                 // others... - fill in options for true/false?
2417                                    // GLib.debug (ktype.up());
2418                             if (has_opts) {
2419                                 
2420                                         while(model.get_n_items() > 0) {
2421                                                 model.remove(0);
2422                                         }
2423                                         cb.show();
2424                                         // can not remove - hopefully always empty.
2425                                         var sel = -1;
2426                                         for(var i = 0; i < opts.length; i ++) {
2427                                                 model.append( opts[i]);
2428                                                 // not sure this is a great idea... 
2429                                                 if (opts[i].down() == prop.val.down()) {
2430                                                         sel = i;
2431                                                 }
2432                                         }
2433                                         GLib.debug("Set selected item to %d", sel);
2434                                         cb.set_selected(sel > -1 ? sel : Gtk.INVALID_LIST_POSITION); 
2435                                         this.is_setting = false;        
2436                                         return ;
2437                             }
2438                                                           
2439                                 // see if type is a Enum.
2440                                 // triggers a changed event
2441                          
2442                                 elbl.set_text(prop.val);
2443                          
2444                                 elbl.show();
2445                                 this.is_setting = false;                         
2446                                 
2447                                 
2448                                 
2449                          
2450                         
2451                         });
2452                 }
2453
2454                 // user defined functions
2455         }
2456
2457
2458         public class Xcls_ContextMenu : Object
2459         {
2460                 public Gtk.Popover el;
2461                 private Xcls_LeftProps  _this;
2462
2463
2464                         // my vars (def)
2465
2466                 // ctor
2467                 public Xcls_ContextMenu(Xcls_LeftProps _owner )
2468                 {
2469                         _this = _owner;
2470                         _this.ContextMenu = this;
2471                         this.el = new Gtk.Popover();
2472
2473                         // my vars (dec)
2474
2475                         // set gobject values
2476                         var child_1 = new Xcls_Box53( _this );
2477                         this.el.child = child_1.el;
2478                 }
2479
2480                 // user defined functions
2481         }
2482         public class Xcls_Box53 : Object
2483         {
2484                 public Gtk.Box el;
2485                 private Xcls_LeftProps  _this;
2486
2487
2488                         // my vars (def)
2489
2490                 // ctor
2491                 public Xcls_Box53(Xcls_LeftProps _owner )
2492                 {
2493                         _this = _owner;
2494                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
2495
2496                         // my vars (dec)
2497
2498                         // set gobject values
2499                         var child_1 = new Xcls_Button54( _this );
2500                         child_1.ref();
2501                         this.el.append( child_1.el );
2502                 }
2503
2504                 // user defined functions
2505         }
2506         public class Xcls_Button54 : Object
2507         {
2508                 public Gtk.Button el;
2509                 private Xcls_LeftProps  _this;
2510
2511
2512                         // my vars (def)
2513
2514                 // ctor
2515                 public Xcls_Button54(Xcls_LeftProps _owner )
2516                 {
2517                         _this = _owner;
2518                         this.el = new Gtk.Button();
2519
2520                         // my vars (dec)
2521
2522                         // set gobject values
2523                         this.el.label = "Delete";
2524
2525                         //listeners
2526                         this.el.activate.connect( ( )  =>{
2527                                 _this.deleteSelected();
2528                                 
2529                         });
2530                 }
2531
2532                 // user defined functions
2533         }
2534
2535
2536
2537
2538
2539 }