basic highlighting of invalid property names (eg. not user defined or not gtk ) ...
[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 in_y, out string pos) {
1796                 
1797                 
1798                          
1799                 
1800                 /*
1801                         
1802                 from            https://discourse.gnome.org/t/gtk4-finding-a-row-data-on-gtkcolumnview/8465
1803                         var colview = gesture.widget;
1804                         var line_no = check_list_widget(colview, x,y);
1805                          if (line_no > -1) {
1806                                 var item = colview.model.get_item(line_no);
1807                                  
1808                         }
1809                         */
1810                                  
1811                                 
1812                                 //GLib.debug("offset = %d  y = %d", (int) voff, (int) in_y);
1813                         var y = in_y + _this.EditProps.el.vadjustment.value; 
1814                         var  child = this.el.get_first_child(); 
1815                         //Gtk.Allocation alloc = { 0, 0, 0, 0 };
1816                         var line_no = -1; 
1817                         var reading_header = true;
1818                         var real_y = 0;
1819                         var header_height  = 0;
1820                         pos = "none";
1821                         var h = 0;
1822                         while (child != null) {
1823                                         //GLib.debug("Got %s", child.get_type().name());
1824                             if (reading_header) {
1825                                                 
1826                 
1827                                                 if (child.get_type().name() != "GtkColumnListView") {
1828                                                 h += child.get_height();
1829                                                         child = child.get_next_sibling();
1830                                                         continue;
1831                                                 }
1832                                                 // should be columnlistview
1833                                                 child = child.get_first_child(); 
1834                                             //GLib.debug("header height=%d", h);
1835                                                 header_height =  h;
1836                                                 
1837                                                 reading_header = false;
1838                                                 continue;
1839                                 }
1840                                 
1841                                     if (child.get_type().name() != "GtkColumnViewRowWidget") {
1842                                     child = child.get_next_sibling();
1843                                     continue;
1844                                     }
1845                                     
1846                                         if (y < header_height) {
1847                                         return -1;
1848                                 }
1849                                     
1850                                     line_no++;
1851                                         var hh = child.get_height();
1852                                         if (child.has_css_class("node-err") || 
1853                                                 child.has_css_class("node-warn") || 
1854                                                 child.has_css_class("node-depr")) {
1855                                                 hh += 10;
1856                                         
1857                                         }
1858                                         
1859                                         //child.get_allocation(out alloc);
1860                                         //GLib.debug("got cell xy = %d,%d  w,h= %d,%d", alloc.x, alloc.y, alloc.width, alloc.height);
1861                                         //GLib.debug("row %d y= %d %s", line_no, (int) (header_height + alloc.y),
1862                                         
1863                                         //      child.visible ? "VIS" : "hidden");
1864                 
1865                                     if (y >  (header_height + real_y) && y <= (header_height +  real_y + hh) ) {
1866                                         if (y > ( header_height + real_y + (hh * 0.8))) {
1867                                                 pos = "below";
1868                                         } else if (y > ( header_height + real_y + (hh * 0.2))) {
1869                                                 pos = "over";
1870                                         } else {
1871                                                 pos = "above";
1872                                                 }
1873                                          GLib.debug("getRowAt return : %d, %s", line_no, pos);
1874                                             return line_no;
1875                                     }
1876                  
1877                 
1878                                     if (real_y + hh > y) {
1879                                         return -1;
1880                                 }
1881                                 real_y += hh;
1882                                 child = child.get_next_sibling(); 
1883                         }
1884                         return -1;
1885                 
1886                  }
1887         }
1888         public class Xcls_deletemenu : Object
1889         {
1890                 public Gtk.Popover el;
1891                 private Xcls_LeftProps  _this;
1892
1893
1894                         // my vars (def)
1895
1896                 // ctor
1897                 public Xcls_deletemenu(Xcls_LeftProps _owner )
1898                 {
1899                         _this = _owner;
1900                         _this.deletemenu = this;
1901                         this.el = new Gtk.Popover();
1902
1903                         // my vars (dec)
1904
1905                         // set gobject values
1906                         var child_1 = new Xcls_Box42( _this );
1907                         this.el.child = child_1.el;
1908                 }
1909
1910                 // user defined functions
1911         }
1912         public class Xcls_Box42 : Object
1913         {
1914                 public Gtk.Box el;
1915                 private Xcls_LeftProps  _this;
1916
1917
1918                         // my vars (def)
1919
1920                 // ctor
1921                 public Xcls_Box42(Xcls_LeftProps _owner )
1922                 {
1923                         _this = _owner;
1924                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1925
1926                         // my vars (dec)
1927
1928                         // set gobject values
1929                         var child_1 = new Xcls_Button43( _this );
1930                         child_1.ref();
1931                         this.el.append( child_1.el );
1932                 }
1933
1934                 // user defined functions
1935         }
1936         public class Xcls_Button43 : Object
1937         {
1938                 public Gtk.Button el;
1939                 private Xcls_LeftProps  _this;
1940
1941
1942                         // my vars (def)
1943
1944                 // ctor
1945                 public Xcls_Button43(Xcls_LeftProps _owner )
1946                 {
1947                         _this = _owner;
1948                         this.el = new Gtk.Button();
1949
1950                         // my vars (dec)
1951
1952                         // set gobject values
1953                         this.el.label = "Delete";
1954
1955                         //listeners
1956                         this.el.clicked.connect( ( ) => {
1957                                 
1958                         
1959                                 var n = (JsRender.NodeProp) _this.selmodel.el.selected_item;
1960                         
1961                                 _this.deletemenu.el.hide();
1962                                 _this.node.remove_prop(n);
1963                         });
1964                 }
1965
1966                 // user defined functions
1967         }
1968
1969
1970
1971         public class Xcls_GestureClick44 : Object
1972         {
1973                 public Gtk.GestureClick el;
1974                 private Xcls_LeftProps  _this;
1975
1976
1977                         // my vars (def)
1978
1979                 // ctor
1980                 public Xcls_GestureClick44(Xcls_LeftProps _owner )
1981                 {
1982                         _this = _owner;
1983                         this.el = new Gtk.GestureClick();
1984
1985                         // my vars (dec)
1986
1987                         // set gobject values
1988
1989                         //listeners
1990                         this.el.pressed.connect( (n_press, in_x, in_y) => {
1991                         
1992                                 GLib.debug("Prssed %d", (int)  this.el.get_current_button());
1993                                 
1994                                 var col = _this.view.getColAt(in_x, in_y);
1995                                 if (col != 0) {
1996                                         return;
1997                                 }
1998                                 string pos;
1999                                 var row = _this.view.getRowAt(in_x, in_y, out pos);
2000                                 
2001                                 if (row < 0) {
2002                                         return;
2003                         
2004                                 }
2005                                 GLib.debug("hit row %d", row);
2006                                 var prop = _this.selmodel.getPropAt(row);
2007                                 _this.selmodel.selectProp(prop);
2008                         
2009                                 //var point_at = _this.view.getWidgetAtRow(row);
2010                                 
2011                                         // need to shift down, as ev.y does not inclucde header apparently..
2012                                 // or popover might be trying to do a central?
2013                         //       _this.view.editPropertyDetails(prop, (int) in_y + 12); 
2014                                  _this.stop_editor();
2015                              _this.view.popover.show(
2016                                                 _this.view.el, 
2017                                                 _this.node, prop,  
2018                                          (int)in_y);
2019                             
2020                             
2021                               
2022                         });
2023                 }
2024
2025                 // user defined functions
2026         }
2027
2028         public class Xcls_GestureClick45 : Object
2029         {
2030                 public Gtk.GestureClick el;
2031                 private Xcls_LeftProps  _this;
2032
2033
2034                         // my vars (def)
2035
2036                 // ctor
2037                 public Xcls_GestureClick45(Xcls_LeftProps _owner )
2038                 {
2039                         _this = _owner;
2040                         this.el = new Gtk.GestureClick();
2041
2042                         // my vars (dec)
2043
2044                         // set gobject values
2045                         this.el.button = 3;
2046
2047                         //listeners
2048                         this.el.pressed.connect( (n_press, in_x, in_y) => {
2049                         
2050                                 
2051                                  
2052                                 string pos;
2053                                 var row = _this.view.getRowAt(in_x, in_y, out pos);
2054                                 
2055                                 if (row < 0) {
2056                                         return;
2057                         
2058                                 }
2059                                 
2060                                 _this.stop_editor();
2061                                 GLib.debug("hit row %d", row);
2062                                 var prop = _this.selmodel.getPropAt(row);
2063                                 _this.selmodel.selectProp(prop);
2064                                 
2065                                 
2066                                 
2067                                 GLib.debug("Prssed %d", (int)  this.el.get_current_button());
2068                                 //_this.deletemenu.el.set_parent(_this.view.el);
2069                                 if (_this.deletemenu.el.parent == null) {
2070                                         _this.deletemenu.el.set_parent(_this.main_window.el);
2071                                 }
2072                                 
2073                                 
2074                                  
2075                                 _this.deletemenu.el.set_offset(
2076                                                 (int)in_x  - _this.view.el.get_width() ,
2077                                                 (int)in_y - _this.view.el.get_height()
2078                                         );
2079                                 _this.deletemenu.el.set_position(Gtk.PositionType.BOTTOM); 
2080                             _this.deletemenu.el.popup();
2081                               
2082                         });
2083                 }
2084
2085                 // user defined functions
2086         }
2087
2088         public class Xcls_selmodel : Object
2089         {
2090                 public Gtk.SingleSelection el;
2091                 private Xcls_LeftProps  _this;
2092
2093
2094                         // my vars (def)
2095
2096                 // ctor
2097                 public Xcls_selmodel(Xcls_LeftProps _owner )
2098                 {
2099                         _this = _owner;
2100                         _this.selmodel = this;
2101                         new Xcls_model( _this );
2102                         this.el = new Gtk.SingleSelection( _this.model.el );
2103
2104                         // my vars (dec)
2105
2106                         // set gobject values
2107                         this.el.can_unselect = true;
2108                 }
2109
2110                 // user defined functions
2111                 public int propToRow (JsRender.NodeProp prop) {
2112                         for (var i = 0 ; i < this.el.n_items; i++) {
2113                                 var r = (JsRender.NodeProp)this.el.get_item(i);
2114                                 if (r.equals(prop)) {
2115                                         return i;
2116                                         
2117                                 }
2118                         }
2119                         return -1;
2120                          
2121                 }
2122                 public void startEditing (JsRender.NodeProp prop) {
2123                         // should we call select?? - caller does int (from windowstate)
2124                         
2125                 }
2126                 public void selectProp (JsRender.NodeProp prop) {
2127                         for (var i = 0 ; i < this.el.n_items; i++) {
2128                                 var r = (JsRender.NodeProp)this.el.get_item(i);
2129                                 if (r.equals(prop)) {
2130                                         this.el.selected = i;
2131                                         return;
2132                                 }
2133                         }
2134                          
2135                 }
2136                 public JsRender.NodeProp getPropAt (uint row) {
2137                 
2138                         return   (JsRender.NodeProp) this.el.get_item(row);
2139                 
2140                          
2141                 }
2142         }
2143         public class Xcls_model : Object
2144         {
2145                 public GLib.ListStore el;
2146                 private Xcls_LeftProps  _this;
2147
2148
2149                         // my vars (def)
2150
2151                 // ctor
2152                 public Xcls_model(Xcls_LeftProps _owner )
2153                 {
2154                         _this = _owner;
2155                         _this.model = this;
2156                         this.el = new GLib.ListStore(typeof(JsRender.NodeProp));
2157
2158                         // my vars (dec)
2159
2160                         // set gobject values
2161                 }
2162
2163                 // user defined functions
2164         }
2165
2166
2167         public class Xcls_keycol : Object
2168         {
2169                 public Gtk.ColumnViewColumn el;
2170                 private Xcls_LeftProps  _this;
2171
2172
2173                         // my vars (def)
2174
2175                 // ctor
2176                 public Xcls_keycol(Xcls_LeftProps _owner )
2177                 {
2178                         _this = _owner;
2179                         _this.keycol = this;
2180                         var child_1 = new Xcls_SignalListItemFactory49( _this );
2181                         child_1.ref();
2182                         this.el = new Gtk.ColumnViewColumn( "Property", child_1.el );
2183
2184                         // my vars (dec)
2185
2186                         // set gobject values
2187                         this.el.id = "keycol";
2188                         this.el.expand = true;
2189                         this.el.resizable = true;
2190                 }
2191
2192                 // user defined functions
2193         }
2194         public class Xcls_SignalListItemFactory49 : Object
2195         {
2196                 public Gtk.SignalListItemFactory el;
2197                 private Xcls_LeftProps  _this;
2198
2199
2200                         // my vars (def)
2201
2202                 // ctor
2203                 public Xcls_SignalListItemFactory49(Xcls_LeftProps _owner )
2204                 {
2205                         _this = _owner;
2206                         this.el = new Gtk.SignalListItemFactory();
2207
2208                         // my vars (dec)
2209
2210                         // set gobject values
2211
2212                         //listeners
2213                         this.el.setup.connect( (listitem) => {
2214                                 var lbl = new Gtk.Label("");
2215                                 ((Gtk.ListItem)listitem).set_child(lbl);
2216                                 lbl.justify = Gtk.Justification.LEFT;
2217                                 lbl.xalign = 1;
2218                                 lbl.use_markup = true;
2219                                 lbl.ellipsize = Pango.EllipsizeMode.START;
2220                                 /*lbl.changed.connect(() => {
2221                                         // notify and save the changed value...
2222                                         //var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem.get_item());
2223                                  
2224                                 //prop.val = lbl.text;
2225                                 //_this.updateIter(iter,prop);
2226                                 _this.changed();
2227                                 });
2228                                 */
2229                                 ((Gtk.ListItem)listitem).activatable = true;
2230                         });
2231                         this.el.bind.connect( (listitem) => {
2232                          var lb = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
2233                          var item = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();
2234                         
2235                         
2236                         item.bind_property("to_display_name_prop",
2237                                             lb, "label",
2238                                            GLib.BindingFlags.SYNC_CREATE);
2239                         item.bind_property("to_tooltip_name_prop",
2240                                             lb, "tooltip_markup",
2241                                            GLib.BindingFlags.SYNC_CREATE);
2242                         // was item (1) in old layout
2243                          
2244                         
2245                         });
2246                 }
2247
2248                 // user defined functions
2249         }
2250
2251
2252         public class Xcls_valcol : Object
2253         {
2254                 public Gtk.ColumnViewColumn el;
2255                 private Xcls_LeftProps  _this;
2256
2257
2258                         // my vars (def)
2259
2260                 // ctor
2261                 public Xcls_valcol(Xcls_LeftProps _owner )
2262                 {
2263                         _this = _owner;
2264                         _this.valcol = this;
2265                         var child_1 = new Xcls_SignalListItemFactory51( _this );
2266                         child_1.ref();
2267                         this.el = new Gtk.ColumnViewColumn( "Value", child_1.el );
2268
2269                         // my vars (dec)
2270
2271                         // set gobject values
2272                         this.el.id = "valcol";
2273                         this.el.expand = true;
2274                         this.el.resizable = true;
2275                 }
2276
2277                 // user defined functions
2278         }
2279         public class Xcls_SignalListItemFactory51 : Object
2280         {
2281                 public Gtk.SignalListItemFactory el;
2282                 private Xcls_LeftProps  _this;
2283
2284
2285                         // my vars (def)
2286                 public bool is_setting;
2287
2288                 // ctor
2289                 public Xcls_SignalListItemFactory51(Xcls_LeftProps _owner )
2290                 {
2291                         _this = _owner;
2292                         this.el = new Gtk.SignalListItemFactory();
2293
2294                         // my vars (dec)
2295                         this.is_setting = false;
2296
2297                         // set gobject values
2298
2299                         //listeners
2300                         this.el.setup.connect( (listitem) => {
2301                                 var hb = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2302                                 var elbl  = new Gtk.EditableLabel("");
2303                                 elbl.hexpand = true;
2304                                 hb.append(elbl);
2305                                 var lbl  = new Gtk.Label("");
2306                                 hb.append(lbl);
2307                                 lbl.hexpand = true;
2308                                 lbl.use_markup = true;
2309                                 lbl.xalign =0;
2310                                 lbl.ellipsize = Pango.EllipsizeMode.END;
2311                                 var cb = new Gtk.DropDown(new Gtk.StringList({}), null);
2312                                 cb.hexpand = true;
2313                          
2314                                 hb.append(cb);
2315                                 ((Gtk.ListItem)listitem).set_child(hb);
2316                                  
2317                                  var ef = new Gtk.EventControllerFocus();
2318                                  ef.enter.connect(() => {
2319                                          _this.stop_editor();
2320                                           var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2321                                          _this.selmodel.selectProp(prop);               
2322                                  });
2323                                  elbl.add_controller(ef);
2324                                  
2325                                  
2326                                   // dropdown??? - stop editing, and highliht node
2327                                  var tb = (Gtk.ToggleButton) cb.get_first_child();
2328                                  tb.clicked.connect(() => {
2329                                          var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2330                                                 
2331                                          _this.stop_editor();
2332                                          _this.selmodel.selectProp(prop);
2333                                          
2334                                  });
2335                                 elbl.changed.connect(() => {
2336                                         // notify and save the changed value...
2337                                         
2338                                 //_this.updateIter(iter,prop);
2339                                 // this should happen automatically
2340                                 
2341                                 if (!_this.loading && !this.is_setting) {
2342                                             var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2343                                                  
2344                                          
2345                                             prop.val = elbl.text;
2346                                          GLib.debug("calling changed");
2347                                         _this.changed();
2348                                        
2349                                 }
2350                                 
2351                                 });
2352                                 
2353                                 
2354                                 cb.notify["selected"].connect(() => {
2355                                         // dropdown selection changed.
2356                                         
2357                                         
2358                                         
2359                                 //_this.updateIter(iter,prop);
2360                                 if (!_this.loading && !this.is_setting) {
2361                                             var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2362                                             var model = (Gtk.StringList)cb.model;
2363                                             prop.val =   model.get_string(cb.selected);
2364                                             GLib.debug("property set to %s", prop.val);
2365                                         GLib.debug("calling changed");
2366                                         _this.changed();
2367                                          
2368                                 }
2369                                 
2370                                         
2371                                 });
2372                                 var gc = new Gtk.GestureClick();
2373                                 lbl.add_controller(gc);
2374                                 gc.pressed.connect(() => {
2375                                         var prop = (JsRender.NodeProp)((Gtk.ListItem)listitem).get_item();
2376                                          _this.stop_editor();
2377                                     _this.show_editor(_this.file, prop.parent, prop);
2378                                 });
2379                                   
2380                                 
2381                                 
2382                         });
2383                         this.el.bind.connect( (listitem) => {
2384                                  this.is_setting = true;
2385                         
2386                         
2387                                 var bx = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
2388                          
2389                                 
2390                                 
2391                                 
2392                                 var elbl = (Gtk.EditableLabel)bx.get_first_child();
2393                                 var lbl = (Gtk.Label) elbl.get_next_sibling();
2394                                 var cb  = (Gtk.DropDown) lbl.get_next_sibling();
2395                                 // decide if it's a combo or editable text..
2396                                 var model = (Gtk.StringList) cb.model;
2397                          
2398                                 elbl.hide();
2399                                 lbl.hide();
2400                                 cb.hide();
2401                                 
2402                                 var prop = (JsRender.NodeProp) ((Gtk.ListItem)listitem).get_item();
2403                                 //GLib.debug("prop = %s", prop.get_type().name());
2404                                 //GLib.debug("prop.val = %s", prop.val);
2405                                 //GLib.debug("prop.key = %s", prop.to_display_name());
2406                                  
2407                             var use_textarea =  prop.useTextArea();
2408                             
2409                             
2410                             var pal = _this.file.project.palete;
2411                                 
2412                             string[] opts;
2413                             var has_opts = pal.typeOptions(_this.node.fqn(), prop.name, prop.rtype, out opts);
2414                             
2415                             if (!has_opts && prop.ptype == JsRender.NodePropType.RAW) {
2416                                 use_textarea = true;
2417                             }
2418                             
2419                             
2420                             if (use_textarea) {
2421                                 prop.bind_property("val_short",
2422                                             lbl, "label",
2423                                            GLib.BindingFlags.SYNC_CREATE);
2424                                 prop.bind_property("val_tooltip",
2425                                             lbl, "tooltip_markup",
2426                                            GLib.BindingFlags.SYNC_CREATE);
2427                                 lbl.show();
2428                                         this.is_setting = false;        
2429                                 return;
2430                                 
2431                             }
2432                              
2433                                 
2434                                 
2435                                 
2436                                 
2437                                 // others... - fill in options for true/false?
2438                                    // GLib.debug (ktype.up());
2439                             if (has_opts) {
2440                                 
2441                                         while(model.get_n_items() > 0) {
2442                                                 model.remove(0);
2443                                         }
2444                                         cb.show();
2445                                         // can not remove - hopefully always empty.
2446                                         var sel = -1;
2447                                         for(var i = 0; i < opts.length; i ++) {
2448                                                 model.append( opts[i]);
2449                                                 // not sure this is a great idea... 
2450                                                 if (opts[i].down() == prop.val.down()) {
2451                                                         sel = i;
2452                                                 }
2453                                         }
2454                                         GLib.debug("Set selected item to %d", sel);
2455                                         cb.set_selected(sel > -1 ? sel : Gtk.INVALID_LIST_POSITION); 
2456                                         this.is_setting = false;        
2457                                         return ;
2458                             }
2459                                                           
2460                                 // see if type is a Enum.
2461                                 // triggers a changed event
2462                          
2463                                 elbl.set_text(prop.val);
2464                          
2465                                 elbl.show();
2466                                 this.is_setting = false;                         
2467                                 
2468                                 
2469                                 
2470                          
2471                         
2472                         });
2473                 }
2474
2475                 // user defined functions
2476         }
2477
2478
2479         public class Xcls_ContextMenu : Object
2480         {
2481                 public Gtk.Popover el;
2482                 private Xcls_LeftProps  _this;
2483
2484
2485                         // my vars (def)
2486
2487                 // ctor
2488                 public Xcls_ContextMenu(Xcls_LeftProps _owner )
2489                 {
2490                         _this = _owner;
2491                         _this.ContextMenu = this;
2492                         this.el = new Gtk.Popover();
2493
2494                         // my vars (dec)
2495
2496                         // set gobject values
2497                         var child_1 = new Xcls_Box53( _this );
2498                         this.el.child = child_1.el;
2499                 }
2500
2501                 // user defined functions
2502         }
2503         public class Xcls_Box53 : Object
2504         {
2505                 public Gtk.Box el;
2506                 private Xcls_LeftProps  _this;
2507
2508
2509                         // my vars (def)
2510
2511                 // ctor
2512                 public Xcls_Box53(Xcls_LeftProps _owner )
2513                 {
2514                         _this = _owner;
2515                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
2516
2517                         // my vars (dec)
2518
2519                         // set gobject values
2520                         var child_1 = new Xcls_Button54( _this );
2521                         child_1.ref();
2522                         this.el.append( child_1.el );
2523                 }
2524
2525                 // user defined functions
2526         }
2527         public class Xcls_Button54 : Object
2528         {
2529                 public Gtk.Button el;
2530                 private Xcls_LeftProps  _this;
2531
2532
2533                         // my vars (def)
2534
2535                 // ctor
2536                 public Xcls_Button54(Xcls_LeftProps _owner )
2537                 {
2538                         _this = _owner;
2539                         this.el = new Gtk.Button();
2540
2541                         // my vars (dec)
2542
2543                         // set gobject values
2544                         this.el.label = "Delete";
2545
2546                         //listeners
2547                         this.el.activate.connect( ( )  =>{
2548                                 _this.deleteSelected();
2549                                 
2550                         });
2551                 }
2552
2553                 // user defined functions
2554         }
2555
2556
2557
2558
2559
2560 }