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