src/Builder4/WindowLeftProps.bjs
[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_AddPropertyPopup AddPropertyPopup;
16     public Xcls_EditProps EditProps;
17     public Xcls_view view;
18     public Xcls_model model;
19     public Xcls_keycol keycol;
20     public Xcls_keyrender keyrender;
21     public Xcls_valcol valcol;
22     public Xcls_valrender valrender;
23     public Xcls_valrendermodel valrendermodel;
24     public Xcls_ContextMenu ContextMenu;
25
26         // my vars (def)
27
28     // ctor
29     public Xcls_LeftProps()
30     {
31         _this = this;
32         this.el = new Gtk.Box();
33
34         // my vars (dec)
35         var child_0 = new Xcls_Box2( _this );
36         child_0.ref();
37         this.el.pack_start (  child_0.el , false,true,0 );
38         var child_1 = new Xcls_EditProps( _this );
39         child_1.ref();
40         this.el.pack_end (  child_1.el , true,true,0 );
41     }
42
43     // user defined functions
44     public void updateKey (string oldkey,  string type, string key ) {
45     
46      
47         
48         _this.model.el.foreach((mod, path,  iter) => {
49                  
50             
51                   
52            
53                  GLib.Value gvaltype, gval,kvalue;
54                  mod.get_value(iter, 1 , out gval); // one is key..
55                 
56              mod.get_value(iter,0, out gvaltype);
57              
58              mod.get_value(iter,3, out kvalue);
59              
60               if (oldkey == ((string)gval) && type == ((string)gvaltype)) {
61               
62                           //print("update iter type=%s, key=%s value=%s\n", type, key,(string) kvalue);
63               
64                       this.updateIter(iter, type, key, (string)kvalue);
65                       return true;
66                   }
67              
68     
69                 return false;
70         });
71         
72         this.changed();
73     
74     
75     }
76     public              void before_edit ()
77     {
78     
79         GLib.debug("before edit - stop editing\n");
80         
81       // these do not appear to trigger save...
82         _this.keyrender.el.stop_editing(false);
83         _this.keyrender.el.editable  =false;
84     
85         _this.valrender.el.stop_editing(false);
86         _this.valrender.el.editable  =false;    
87         
88         
89     // technicall stop the popup editor..
90     
91     }
92     public              string keySortFormat (string key) {
93         // listeners first - with 0
94         // specials
95         if (key[0] == '*') {
96             return "1 " + key;
97         }
98         // functions
99         
100         var bits = key.split(" ");
101         
102         if (key[0] == '|') {
103             return "2 " + bits[bits.length -1];
104         }
105         // signals
106         if (key[0] == '@') {
107             return "3 " + bits[bits.length -1];
108         }
109             
110         // props
111         if (key[0] == '#') {
112             return "4 " + bits[bits.length -1];
113         }
114         // the rest..
115         return "5 " + bits[bits.length -1];    
116     
117     
118     
119     }
120     public              void finish_editing () {
121          // 
122         this.before_edit();
123     }
124     public bool startEditingValue ( Gtk.TreePath path) {
125     
126          // ONLY return true if editing is allowed - eg. combo..
127     
128         GLib.debug("start editing?\n");
129         if (!this.stop_editor()) {
130             GLib.debug("stop editor failed\n");
131             return false;
132         }
133         
134         Gtk.TreeIter iter;
135     
136         var mod = this.model.el;
137         mod.get_iter (out iter, path);
138          
139         /*
140             m.set(iter, 
141                     0, "listener",
142                     1, miter.get_key(),
143                     2, "<b>" + miter.get_key() + "</b>",
144                     3, miter.get_value()
145                 ); 
146          
147         */
148         GLib.Value gval;
149         mod.get_value(iter, 3 , out gval);
150         var val = (string)gval;
151     
152         mod.get_value(iter, 1 , out gval);
153         var key = (string)gval;
154         
155         
156         string kname, kflag, ktype;
157         this.node.normalize_key(key, out kname, out kflag, out ktype);
158          
159         
160         mod.get_value(iter, 0 , out gval);
161         var type = (string)gval; // listerner or prop..
162         
163        
164         
165         var use_textarea = false;
166     
167         //------------ things that require the text editor...
168         
169         if (type == "listener") {
170             use_textarea = true;
171         }
172         if (key.length > 0 && key[0] == '|') { // user defined method
173             use_textarea = true;
174         }
175         if (key.length > 0 && key[0] == '$') { // raw string
176             use_textarea = true;
177         }
178         if (key.length > 0 && key == "* init") {
179             use_textarea = true;
180         }
181         if (val.length > 40) { // long value...
182             use_textarea = true;
183         }
184         
185         
186         
187         if (use_textarea) {
188             GLib.debug("Call show editor\n");
189             GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
190                 this.view.el.get_selection().select_path(path);
191                 
192                 this.show_editor(file, node, type, key);
193                 
194                 return false;
195             });
196            
197             
198             return false;
199         }
200         
201          var pal = this.file.project.palete;
202         
203         string[] opts;
204         var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);
205         
206         
207         
208         // others... - fill in options for true/false?
209         GLib.debug("turn on editing %s \n" , mod.get_path(iter).to_string());
210        
211            GLib.debug (ktype.up());
212         if (has_opts) {
213                 GLib.debug("start editing try/false)???");
214                 this.valrender.el.has_entry = false;
215               
216                 this.valrender.setOptions(opts);
217                 
218                 this.valrender.el.has_entry = false;
219                 this.valrender.el.editable = true;
220                  this.allow_edit  = true;
221                  GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
222                      this.view.el.set_cursor_on_cell(
223                         path,
224                         this.valcol.el,
225                         this.valrender.el,
226                         true
227                     );
228                     return false;
229                 });
230                 return true;
231         }
232                                   
233            // see if type is a Enum.
234            
235            
236        
237             
238        
239          opts =  {  };
240         this.valrender.setOptions(opts);
241        
242        GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
243             
244             // at this point - work out the type...
245             // if its' a combo... then show the options..
246             this.valrender.el.has_entry = true;
247             
248             this.valrender.el.editable = true;            
249         
250             
251             this.allow_edit  = true;
252             
253             
254             
255             
256     
257             this.view.el.set_cursor_on_cell(
258                 path,
259                 this.valcol.el,
260                 this.valrender.el,
261                 true
262             );
263             return false;
264         });
265         return false;
266     }
267     public              void load (JsRender.JsRender file, JsRender.Node? node) 
268     {
269         GLib.debug("load leftprops\n");
270         this.before_edit();
271         this.node = node;
272         this.file = file;
273         
274      
275         this.model.el.clear();
276                   
277         //this.get('/RightEditor').el.hide();
278         if (node ==null) {
279             return ;
280         }
281          
282         
283     
284         //var provider = this.get('/LeftTree').getPaleteProvider();
285         Gtk.TreeIter iter;
286         
287         //typeof(string),  // 0 key type
288          //typeof(string),  // 1 key
289          //typeof(string),  // 2 key (display)
290          //typeof(string),  // 3 value
291          //typeof(string),  // 4 value (display)
292          //typeof(string),  // 5 both (tooltip)
293         
294          
295         
296         // really need a way to sort the hashmap...
297         var m = this.model.el;
298         
299         var miter = node.listeners.map_iterator();
300         var i = 0;
301         
302         while(miter.next()) {
303             i++;
304             m.append(out iter,null);
305             
306             this.updateIter(iter,  "listener", miter.get_key(), miter.get_value());
307             
308              
309          }
310          
311           
312         miter = node.props.map_iterator();
313         
314         
315        while(miter.next()) {
316                i++;
317             m.append(out iter,null);
318              this.updateIter(iter,  "prop", miter.get_key(), miter.get_value());
319              
320        }
321        GLib.debug("clear selection\n");
322        // clear selection?
323        this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..
324        
325        this.view.el.get_selection().unselect_all();
326        
327        var pane = _this.main_window.editpane.el;
328         var try_size = (i * 25) + 60; // est. 20px per line + 40px header
329         GLib.Timeout.add_seconds(1, () => { 
330                 // max 80%...
331                 pane.set_position( 
332                      ((try_size * 1.0f) /  (pane.max_position * 1.0f))  > 0.8f  ? 
333                     (int) (pane.max_position * 0.2f) :
334                     pane.max_position-try_size);
335             return GLib.Source.REMOVE;
336         });
337        
338     }
339     public              string keyFormat (string val, string type) {
340         
341         // Glib.markup_escape_text(val);
342     
343         if (type == "listener") {
344             return "<span font_weight=\"bold\" color=\"#660000\">" + 
345                 GLib.Markup.escape_text(val) +
346                  "</span>";
347         }
348         // property..
349         if (val.length < 1) {
350             return "<span  color=\"#FF0000\">--empty--</span>";
351         }
352         
353         //@ = signal
354         //$ = property with 
355         //# - object properties
356         //* = special
357         // all of these... - display value is last element..
358         var ar = val.strip().split(" ");
359         
360         
361         var dval = GLib.Markup.escape_text(ar[ar.length-1]);
362         
363         
364         
365         
366         switch(val[0]) {
367             case '@': // signal // just bold balck?
368                 if (dval[0] == '@') {
369                     dval = dval.substring(1);
370                 }
371             
372                 return @"<span  font_weight=\"bold\">@ $dval</span>";        
373             case '#': // object properties?
374                 if (dval[0] == '#') {
375                     dval = dval.substring(1);
376                 }
377                 return @"<span  font_weight=\"bold\">$dval</span>";
378             case '*': // special
379                 if (dval[0] == '*') {
380                     dval = dval.substring(1);
381                 }
382                 return @"<span   color=\"#0000CC\" font_weight=\"bold\">$dval</span>";            
383             case '$':
384                 if (dval[0] == '$') {
385                     dval = dval.substring(1);
386                 }
387                 return @"<span   style=\"italic\">$dval</span>";
388            case '|': // user defined methods
389                 if (dval[0] == '|') {
390                     dval = dval.substring(1);
391                 }
392                 return @"<span color=\"#008000\" font_weight=\"bold\">$dval</span>";
393                 
394                   
395                 
396             default:
397                 return dval;
398         }
399           
400         
401     
402     }
403     public              void deleteSelected () {
404         
405             Gtk.TreeIter iter;
406             Gtk.TreeModel mod;
407             
408             var s = this.view.el.get_selection();
409             s.get_selected(out mod, out iter);
410                  
411                   
412             GLib.Value gval;
413             mod.get_value(iter, 0 , out gval);
414             var type = (string)gval;
415             
416             mod.get_value(iter, 1 , out gval);
417             var key = (string)gval;
418             
419             switch(type) {
420                 case "listener":
421                     this.node.listeners.unset(key);
422                     break;
423                     
424                 case "props":
425                     this.node.props.unset(key);
426                     break;
427             }
428             this.load(this.file, this.node);
429             
430             _this.changed();
431     }
432     public              void startEditingKey ( Gtk.TreePath path) {
433         
434          if (!this.stop_editor()) {
435             return;
436          }
437       
438         // others... - fill in options for true/false?
439         
440            
441         GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
442             this.allow_edit  = true;
443             this.keyrender.el.editable = true;
444          
445             this.view.el.set_cursor_on_cell(
446                 path,
447                 this.keycol.el,
448                 this.keyrender.el,
449                 true
450             );
451                    
452             return false;
453         });
454           
455         
456     }
457     public              void addProp (string in_type, string key, string value, string value_type) {
458           // info includes key, val, skel, etype..
459           //console.dump(info);
460             //type = info.type.toLowerCase();
461             //var data = this.toJS();
462               
463         var type = in_type == "signals" ? "listener" : in_type;
464           
465         var fkey = (value_type.length > 0 ? value_type + " " : "") + key;
466                   
467         if (type == "listener") {
468             if (this.node.listeners.has_key(key)) {
469                 return;
470             }
471             this.node.listeners.set(key,value);
472         } else  {
473              assert(this.node != null);
474              assert(this.node.props != null);
475             if (this.node.props.has_key(fkey)) {
476                 return;
477             }
478             this.node.props.set(fkey,value);
479         }
480                 
481           
482         // add a row???
483         this.load(this.file, this.node);
484         
485         
486         
487         /// need to find the row which I've just added..
488         
489         
490         var s = this.view.el.get_selection();
491         s.unselect_all();
492         
493         GLib.debug("trying to find new iter");
494       
495         this.model.el.foreach((model, path, iter) => {
496             GLib.Value gval;
497         
498             this.model.el.get_value(iter, 0 , out gval);
499             if ((string)gval != type) {
500                 GLib.debug("not type: %s = %s\n", (string)gval , type);
501                 return false;
502             }
503             this.model.el.get_value(iter, 1 , out gval);
504             if ((string)gval != fkey) {
505                 GLib.debug("not key: %s = %s\n", (string)gval , fkey);
506                 return false;
507             }
508             // delay this?
509             GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {
510             
511                 this.startEditingValue(this.model.el.get_path(iter));
512                 return false;
513             });
514             //s.select_iter(iter);
515             return true; 
516         });
517         
518         
519         
520                   
521     }
522     public              void updateIter (Gtk.TreeIter iter,  string type, string key, string kvalue) {
523     
524         //print("update Iter %s, %s\n", key,kvalue);
525         //typeof(string),  // 0 key type
526          //typeof(string),  // 1 key
527          //typeof(string),  // 2 key (display)
528          //typeof(string),  // 3 value
529          //typeof(string),  // 4 value (display)
530          //typeof(string),  // 5 both (tooltip)
531          //typeof(string),  // 6 key (sort)
532         
533         var dl = kvalue.strip().split("\n");
534     
535         var dis_val = dl.length > 1 ? (dl[0].strip()+ "...") : dl[0];
536         
537         if (type == "listener") {
538          
539            
540             
541             this.model.el.set(iter, 
542                     0, type,
543                 1, key,
544                 2, this.keyFormat(key ,type),
545                 3, kvalue,
546                 4, dis_val,
547                 5, "<tt>" +  GLib.Markup.escape_text(key + " " +kvalue) + "</tt>",
548                 6,  "0 " + key
549             ); 
550             return;
551         }
552         
553     
554     
555         this.model.el.set(iter, 
556                 0, "props",
557                 1, key,
558                 2,  this.keyFormat(key , "prop"),
559                 3, kvalue,
560                 4, dis_val,
561                  5, "<tt>" + GLib.Markup.escape_text(key + " " + kvalue) + "</tt>",
562                  6,  this.keySortFormat(key)
563             ); 
564     }
565     public class Xcls_Box2 : Object
566     {
567         public Gtk.Box el;
568         private Xcls_LeftProps  _this;
569
570
571             // my vars (def)
572
573         // ctor
574         public Xcls_Box2(Xcls_LeftProps _owner )
575         {
576             _this = _owner;
577             this.el = new Gtk.Box();
578
579             // my vars (dec)
580             var child_0 = new Xcls_Button3( _this );
581             child_0.ref();
582             this.el.add (  child_0.el  );
583         }
584
585         // user defined functions
586     }
587     public class Xcls_Button3 : Object
588     {
589         public Gtk.Button el;
590         private Xcls_LeftProps  _this;
591
592
593             // my vars (def)
594
595         // ctor
596         public Xcls_Button3(Xcls_LeftProps _owner )
597         {
598             _this = _owner;
599             this.el = new Gtk.Button();
600
601             // my vars (dec)
602             var child_0 = new Xcls_Box4( _this );
603             child_0.ref();
604             this.el.add (  child_0.el  );
605             var child_1 = new Xcls_AddPropertyPopup( _this );
606             child_1.ref();
607
608             //listeners
609             this.el.button_press_event.connect( (self, ev) => {
610                 _this.before_edit();
611                 
612                     
613                 var p = _this.AddPropertyPopup;
614                 p.el.set_screen(Gdk.Screen.get_default());
615                 p.el.show_all();
616                  p.el.popup(null, null, null, ev.button, ev.time);
617                  return true;
618             });
619         }
620
621         // user defined functions
622     }
623     public class Xcls_Box4 : Object
624     {
625         public Gtk.Box el;
626         private Xcls_LeftProps  _this;
627
628
629             // my vars (def)
630
631         // ctor
632         public Xcls_Box4(Xcls_LeftProps _owner )
633         {
634             _this = _owner;
635             this.el = new Gtk.Box();
636
637             // my vars (dec)
638             var child_0 = new Xcls_Image5( _this );
639             child_0.ref();
640             this.el.add (  child_0.el  );
641             var child_1 = new Xcls_Label6( _this );
642             child_1.ref();
643             this.el.add (  child_1.el  );
644         }
645
646         // user defined functions
647     }
648     public class Xcls_Image5 : Object
649     {
650         public Gtk.Image el;
651         private Xcls_LeftProps  _this;
652
653
654             // my vars (def)
655
656         // ctor
657         public Xcls_Image5(Xcls_LeftProps _owner )
658         {
659             _this = _owner;
660             this.el = new Gtk.Image();
661
662             // my vars (dec)
663         }
664
665         // user defined functions
666     }
667
668     public class Xcls_Label6 : Object
669     {
670         public Gtk.Label el;
671         private Xcls_LeftProps  _this;
672
673
674             // my vars (def)
675
676         // ctor
677         public Xcls_Label6(Xcls_LeftProps _owner )
678         {
679             _this = _owner;
680             this.el = new Gtk.Label();
681
682             // my vars (dec)
683         }
684
685         // user defined functions
686     }
687
688
689     public class Xcls_AddPropertyPopup : Object
690     {
691         public Gtk.Menu el;
692         private Xcls_LeftProps  _this;
693
694
695             // my vars (def)
696
697         // ctor
698         public Xcls_AddPropertyPopup(Xcls_LeftProps _owner )
699         {
700             _this = _owner;
701             _this.AddPropertyPopup = this;
702             this.el = new Gtk.Menu();
703
704             // my vars (dec)
705             var child_0 = new Xcls_MenuItem8( _this );
706             child_0.ref();
707             this.el.append (  child_0.el  );
708             var child_1 = new Xcls_MenuItem9( _this );
709             child_1.ref();
710             this.el.append (  child_1.el  );
711             var child_2 = new Xcls_MenuItem10( _this );
712             child_2.ref();
713             this.el.append (  child_2.el  );
714             var child_3 = new Xcls_MenuItem11( _this );
715             child_3.ref();
716             this.el.append (  child_3.el  );
717             var child_4 = new Xcls_MenuItem12( _this );
718             child_4.ref();
719             this.el.append (  child_4.el  );
720             var child_5 = new Xcls_SeparatorMenuItem13( _this );
721             child_5.ref();
722             this.el.add (  child_5.el  );
723             var child_6 = new Xcls_MenuItem14( _this );
724             child_6.ref();
725             this.el.append (  child_6.el  );
726             var child_7 = new Xcls_MenuItem15( _this );
727             child_7.ref();
728             this.el.append (  child_7.el  );
729             var child_8 = new Xcls_MenuItem16( _this );
730             child_8.ref();
731             this.el.append (  child_8.el  );
732             var child_9 = new Xcls_SeparatorMenuItem17( _this );
733             child_9.ref();
734             this.el.add (  child_9.el  );
735             var child_10 = new Xcls_MenuItem18( _this );
736             child_10.ref();
737             this.el.append (  child_10.el  );
738             var child_11 = new Xcls_MenuItem19( _this );
739             child_11.ref();
740             this.el.append (  child_11.el  );
741             var child_12 = new Xcls_MenuItem20( _this );
742             child_12.ref();
743             this.el.append (  child_12.el  );
744             var child_13 = new Xcls_SeparatorMenuItem21( _this );
745             child_13.ref();
746             this.el.add (  child_13.el  );
747             var child_14 = new Xcls_MenuItem22( _this );
748             child_14.ref();
749             this.el.append (  child_14.el  );
750             var child_15 = new Xcls_MenuItem23( _this );
751             child_15.ref();
752             this.el.append (  child_15.el  );
753             var child_16 = new Xcls_MenuItem24( _this );
754             child_16.ref();
755             this.el.append (  child_16.el  );
756         }
757
758         // user defined functions
759     }
760     public class Xcls_MenuItem8 : Object
761     {
762         public Gtk.MenuItem el;
763         private Xcls_LeftProps  _this;
764
765
766             // my vars (def)
767
768         // ctor
769         public Xcls_MenuItem8(Xcls_LeftProps _owner )
770         {
771             _this = _owner;
772             this.el = new Gtk.MenuItem();
773
774             // my vars (dec)
775
776             //listeners
777             this.el.activate.connect( ()  => {
778                 _this.addProp( "prop", "id", "", "");
779             });
780         }
781
782         // user defined functions
783     }
784
785     public class Xcls_MenuItem9 : Object
786     {
787         public Gtk.MenuItem el;
788         private Xcls_LeftProps  _this;
789
790
791             // my vars (def)
792
793         // ctor
794         public Xcls_MenuItem9(Xcls_LeftProps _owner )
795         {
796             _this = _owner;
797             this.el = new Gtk.MenuItem();
798
799             // my vars (dec)
800
801             //listeners
802             this.el.activate.connect( ( ) => {
803             
804                 _this.addProp( "prop", "pack","add", "*");
805             });
806         }
807
808         // user defined functions
809     }
810
811     public class Xcls_MenuItem10 : Object
812     {
813         public Gtk.MenuItem el;
814         private Xcls_LeftProps  _this;
815
816
817             // my vars (def)
818
819         // ctor
820         public Xcls_MenuItem10(Xcls_LeftProps _owner )
821         {
822             _this = _owner;
823             this.el = new Gtk.MenuItem();
824
825             // my vars (dec)
826
827             //listeners
828             this.el.activate.connect( ( ) => {
829             
830                 _this.addProp( "prop", "ctor","", "*");
831             });
832         }
833
834         // user defined functions
835     }
836
837     public class Xcls_MenuItem11 : Object
838     {
839         public Gtk.MenuItem el;
840         private Xcls_LeftProps  _this;
841
842
843             // my vars (def)
844
845         // ctor
846         public Xcls_MenuItem11(Xcls_LeftProps _owner )
847         {
848             _this = _owner;
849             this.el = new Gtk.MenuItem();
850
851             // my vars (dec)
852
853             //listeners
854             this.el.activate.connect( ( ) => {
855             
856                 _this.addProp( "prop",  "init", "{\n\n}\n", "*" );
857             });
858         }
859
860         // user defined functions
861     }
862
863     public class Xcls_MenuItem12 : Object
864     {
865         public Gtk.MenuItem el;
866         private Xcls_LeftProps  _this;
867
868
869             // my vars (def)
870
871         // ctor
872         public Xcls_MenuItem12(Xcls_LeftProps _owner )
873         {
874             _this = _owner;
875             this.el = new Gtk.MenuItem();
876
877             // my vars (dec)
878
879             //listeners
880             this.el.activate.connect( ()  => {
881                 _this.addProp( "prop", "cms-id", "", "string");
882             });
883         }
884
885         // user defined functions
886     }
887
888     public class Xcls_SeparatorMenuItem13 : Object
889     {
890         public Gtk.SeparatorMenuItem el;
891         private Xcls_LeftProps  _this;
892
893
894             // my vars (def)
895
896         // ctor
897         public Xcls_SeparatorMenuItem13(Xcls_LeftProps _owner )
898         {
899             _this = _owner;
900             this.el = new Gtk.SeparatorMenuItem();
901
902             // my vars (dec)
903         }
904
905         // user defined functions
906     }
907
908     public class Xcls_MenuItem14 : Object
909     {
910         public Gtk.MenuItem el;
911         private Xcls_LeftProps  _this;
912
913
914             // my vars (def)
915
916         // ctor
917         public Xcls_MenuItem14(Xcls_LeftProps _owner )
918         {
919             _this = _owner;
920             this.el = new Gtk.MenuItem();
921
922             // my vars (dec)
923
924             //listeners
925             this.el.activate.connect( (self) => {
926             
927                 _this.addProp( "prop", "XXXX", "","string");
928             
929             });
930         }
931
932         // user defined functions
933     }
934
935     public class Xcls_MenuItem15 : Object
936     {
937         public Gtk.MenuItem el;
938         private Xcls_LeftProps  _this;
939
940
941             // my vars (def)
942
943         // ctor
944         public Xcls_MenuItem15(Xcls_LeftProps _owner )
945         {
946             _this = _owner;
947             this.el = new Gtk.MenuItem();
948
949             // my vars (dec)
950
951             //listeners
952             this.el.activate.connect( ( ) =>{
953             
954                 _this.addProp("prop",  "XXX", "0", "int");
955             });
956         }
957
958         // user defined functions
959     }
960
961     public class Xcls_MenuItem16 : Object
962     {
963         public Gtk.MenuItem el;
964         private Xcls_LeftProps  _this;
965
966
967             // my vars (def)
968
969         // ctor
970         public Xcls_MenuItem16(Xcls_LeftProps _owner )
971         {
972             _this = _owner;
973             this.el = new Gtk.MenuItem();
974
975             // my vars (dec)
976
977             //listeners
978             this.el.activate.connect( ( ) =>{
979             
980                 _this.addProp( "prop", "XXX", "true", "bool");
981             });
982         }
983
984         // user defined functions
985     }
986
987     public class Xcls_SeparatorMenuItem17 : Object
988     {
989         public Gtk.SeparatorMenuItem el;
990         private Xcls_LeftProps  _this;
991
992
993             // my vars (def)
994
995         // ctor
996         public Xcls_SeparatorMenuItem17(Xcls_LeftProps _owner )
997         {
998             _this = _owner;
999             this.el = new Gtk.SeparatorMenuItem();
1000
1001             // my vars (dec)
1002         }
1003
1004         // user defined functions
1005     }
1006
1007     public class Xcls_MenuItem18 : Object
1008     {
1009         public Gtk.MenuItem el;
1010         private Xcls_LeftProps  _this;
1011
1012
1013             // my vars (def)
1014
1015         // ctor
1016         public Xcls_MenuItem18(Xcls_LeftProps _owner )
1017         {
1018             _this = _owner;
1019             this.el = new Gtk.MenuItem();
1020
1021             // my vars (dec)
1022
1023             //listeners
1024             this.el.activate.connect( ( ) =>{
1025             
1026                 _this.addProp("prop",  "XXXX", "function() { }", "| function");
1027             });
1028         }
1029
1030         // user defined functions
1031     }
1032
1033     public class Xcls_MenuItem19 : Object
1034     {
1035         public Gtk.MenuItem el;
1036         private Xcls_LeftProps  _this;
1037
1038
1039             // my vars (def)
1040
1041         // ctor
1042         public Xcls_MenuItem19(Xcls_LeftProps _owner )
1043         {
1044             _this = _owner;
1045             this.el = new Gtk.MenuItem();
1046
1047             // my vars (dec)
1048
1049             //listeners
1050             this.el.activate.connect( ( ) =>{
1051             
1052                 _this.addProp( "prop", "XXXX", "() {\n\n}\n", "| return_type");
1053             });
1054         }
1055
1056         // user defined functions
1057     }
1058
1059     public class Xcls_MenuItem20 : Object
1060     {
1061         public Gtk.MenuItem el;
1062         private Xcls_LeftProps  _this;
1063
1064
1065             // my vars (def)
1066
1067         // ctor
1068         public Xcls_MenuItem20(Xcls_LeftProps _owner )
1069         {
1070             _this = _owner;
1071             this.el = new Gtk.MenuItem();
1072
1073             // my vars (dec)
1074
1075             //listeners
1076             this.el.activate.connect( ( ) =>{
1077             
1078                 _this.addProp( "prop", "XXXX", "()", "@ void");
1079             });
1080         }
1081
1082         // user defined functions
1083     }
1084
1085     public class Xcls_SeparatorMenuItem21 : Object
1086     {
1087         public Gtk.SeparatorMenuItem el;
1088         private Xcls_LeftProps  _this;
1089
1090
1091             // my vars (def)
1092
1093         // ctor
1094         public Xcls_SeparatorMenuItem21(Xcls_LeftProps _owner )
1095         {
1096             _this = _owner;
1097             this.el = new Gtk.SeparatorMenuItem();
1098
1099             // my vars (dec)
1100         }
1101
1102         // user defined functions
1103     }
1104
1105     public class Xcls_MenuItem22 : Object
1106     {
1107         public Gtk.MenuItem el;
1108         private Xcls_LeftProps  _this;
1109
1110
1111             // my vars (def)
1112
1113         // ctor
1114         public Xcls_MenuItem22(Xcls_LeftProps _owner )
1115         {
1116             _this = _owner;
1117             this.el = new Gtk.MenuItem();
1118
1119             // my vars (dec)
1120
1121             //listeners
1122             this.el.activate.connect( ( ) =>{
1123             
1124                 _this.addProp("prop",  "flexy:if", "value_or_condition", "string");
1125             });
1126         }
1127
1128         // user defined functions
1129     }
1130
1131     public class Xcls_MenuItem23 : Object
1132     {
1133         public Gtk.MenuItem el;
1134         private Xcls_LeftProps  _this;
1135
1136
1137             // my vars (def)
1138
1139         // ctor
1140         public Xcls_MenuItem23(Xcls_LeftProps _owner )
1141         {
1142             _this = _owner;
1143             this.el = new Gtk.MenuItem();
1144
1145             // my vars (dec)
1146
1147             //listeners
1148             this.el.activate.connect( ( ) =>{
1149             
1150                 _this.addProp("prop",  "flexy:include", "name_of_file.html", "string");
1151             });
1152         }
1153
1154         // user defined functions
1155     }
1156
1157     public class Xcls_MenuItem24 : Object
1158     {
1159         public Gtk.MenuItem el;
1160         private Xcls_LeftProps  _this;
1161
1162
1163             // my vars (def)
1164
1165         // ctor
1166         public Xcls_MenuItem24(Xcls_LeftProps _owner )
1167         {
1168             _this = _owner;
1169             this.el = new Gtk.MenuItem();
1170
1171             // my vars (dec)
1172
1173             //listeners
1174             this.el.activate.connect( ( ) =>{
1175             
1176                 _this.addProp("prop",  "flexy:foreach", "array,key,value", "string");
1177             });
1178         }
1179
1180         // user defined functions
1181     }
1182
1183
1184
1185
1186     public class Xcls_EditProps : Object
1187     {
1188         public Gtk.ScrolledWindow el;
1189         private Xcls_LeftProps  _this;
1190
1191
1192             // my vars (def)
1193
1194         // ctor
1195         public Xcls_EditProps(Xcls_LeftProps _owner )
1196         {
1197             _this = _owner;
1198             _this.EditProps = this;
1199             this.el = new Gtk.ScrolledWindow();
1200
1201             // my vars (dec)
1202             var child_0 = new Xcls_view( _this );
1203             child_0.ref();
1204             this.el.add (  child_0.el  );
1205
1206             // init method
1207
1208             {
1209               
1210                this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1211             }
1212         }
1213
1214         // user defined functions
1215     }
1216     public class Xcls_view : Object
1217     {
1218         public Gtk.TreeView el;
1219         private Xcls_LeftProps  _this;
1220
1221
1222             // my vars (def)
1223
1224         // ctor
1225         public Xcls_view(Xcls_LeftProps _owner )
1226         {
1227             _this = _owner;
1228             _this.view = this;
1229             this.el = new Gtk.TreeView();
1230
1231             // my vars (dec)
1232             var child_0 = new Xcls_model( _this );
1233             child_0.ref();
1234             this.el.set_model (  child_0.el  );
1235             var child_1 = new Xcls_keycol( _this );
1236             child_1.ref();
1237             this.el.append_column (  child_1.el  );
1238             var child_2 = new Xcls_valcol( _this );
1239             child_2.ref();
1240             this.el.append_column (  child_2.el  );
1241             var child_3 = new Xcls_ContextMenu( _this );
1242             child_3.ref();
1243
1244             // init method
1245
1246             {
1247                 var selection = this.el.get_selection();
1248                 selection.set_mode( Gtk.SelectionMode.SINGLE);
1249             
1250             
1251                 var description = new Pango.FontDescription();
1252                 description.set_size(10000);
1253                 this.el.override_font(description);
1254             }
1255
1256             //listeners
1257             this.el.button_press_event.connect( ( ev)  => {
1258              
1259                 Gtk.TreeViewColumn col;
1260                 int cell_x;
1261                 int cell_y;
1262                 Gtk.TreePath path;
1263                 if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {
1264                     GLib.debug("nothing selected on click");
1265                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
1266                         this.el.get_selection().unselect_all();
1267             
1268                         return false;
1269                     });
1270                      _this.before_edit();
1271                     return false; //not on a element.
1272                 }
1273                 
1274                  
1275                  // double click on name..
1276                  if (ev.type == Gdk.EventType.2BUTTON_PRESS  && ev.button == 1 && col.title == "Name") {    
1277                     // show popup!.   
1278                     
1279                      if (this.popover == null) {
1280                                    this.popover = new Xcls_PopoverProperty();
1281                                    this.popover.mainwindow = _this.main_window;
1282                         }
1283                         
1284              
1285                      _this.before_edit();
1286                       _this.stop_editor();
1287                           
1288                      _this.keyrender.el.stop_editing(false);
1289                      _this.keyrender.el.editable  =false;
1290                 
1291                      _this.valrender.el.stop_editing(false);
1292                      _this.valrender.el.editable  =false;
1293                      Gtk.TreeIter iter;
1294                       var mod = this.el.get_model();
1295                           mod.get_iter (out iter, path);
1296                           
1297                    
1298                         GLib.Value gvaltype, gval;
1299                         mod.get_value(iter, 1 , out gval); // one is key..
1300                         
1301                      mod.get_value(iter,0, out gvaltype);
1302             
1303                     this.popover.show(this.el, _this.node, (string)gvaltype, (string)gval);
1304                        
1305                     //  _this.startEditingKey(path); 
1306                      
1307                     return false;
1308                 }
1309                 
1310                 
1311                 
1312                 
1313                  // right click.
1314                  if (ev.type == Gdk.EventType.BUTTON_PRESS  && ev.button == 3) {    
1315                     // show popup!.   
1316                     //if (col.title == "Value") {
1317                      //     _this.before_edit();
1318                      //    return false;
1319                      //}
1320             
1321                     var p = _this.ContextMenu;
1322             
1323                     p.el.set_screen(Gdk.Screen.get_default());
1324                     p.el.show_all();
1325                     p.el.popup(null, null, null,  ev.button, ev.time);
1326                     //Seed.print("click:" + res.column.title);
1327                     // select the 
1328                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
1329               
1330                         this.el.get_selection().select_path(path);
1331                         return false;
1332                     });
1333                      _this.before_edit();
1334                     return false;
1335                 }
1336                 
1337                  
1338                 if (col.title != "Value") {
1339                     GLib.debug("col title != Value");
1340                     
1341                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
1342                         this.el.get_selection().select_path(path);
1343                         return false;
1344                     });
1345                     
1346                     _this.before_edit();
1347                       //  XObject.error("column is not value?");
1348                     return false; // ignore.. - key click.. ??? should we do this??
1349                 }
1350                 
1351                 
1352                 // if the cell can be edited with a pulldown
1353                 // then we should return true... - and let the start_editing handle it?
1354                 
1355                 
1356                 
1357                 
1358                 
1359                   
1360                //             _this.before_edit(); <<< we really need to stop the other editor..
1361                  _this.keyrender.el.stop_editing(false);
1362                 _this.keyrender.el.editable  =false;
1363                 
1364                        
1365                 return _this.startEditingValue(path); // assumes selected row..
1366                     
1367                
1368             
1369                           
1370                
1371             });
1372         }
1373
1374         // user defined functions
1375     }
1376     public class Xcls_model : Object
1377     {
1378         public Gtk.TreeStore el;
1379         private Xcls_LeftProps  _this;
1380
1381
1382             // my vars (def)
1383
1384         // ctor
1385         public Xcls_model(Xcls_LeftProps _owner )
1386         {
1387             _this = _owner;
1388             _this.model = this;
1389             this.el = new Gtk.TreeStore();
1390
1391             // my vars (dec)
1392         }
1393
1394         // user defined functions
1395     }
1396
1397     public class Xcls_keycol : Object
1398     {
1399         public Gtk.TreeViewColumn el;
1400         private Xcls_LeftProps  _this;
1401
1402
1403             // my vars (def)
1404
1405         // ctor
1406         public Xcls_keycol(Xcls_LeftProps _owner )
1407         {
1408             _this = _owner;
1409             _this.keycol = this;
1410             this.el = new Gtk.TreeViewColumn();
1411
1412             // my vars (dec)
1413             var child_0 = new Xcls_keyrender( _this );
1414             child_0.ref();
1415             this.el.pack_start (  child_0.el , false );
1416
1417             // init method
1418
1419             this.el.add_attribute(_this.keyrender.el , "markup", 2 );
1420             this.el.add_attribute(_this.keyrender.el , "text", 1 );
1421         }
1422
1423         // user defined functions
1424     }
1425     public class Xcls_keyrender : Object
1426     {
1427         public Gtk.CellRendererText el;
1428         private Xcls_LeftProps  _this;
1429
1430
1431             // my vars (def)
1432
1433         // ctor
1434         public Xcls_keyrender(Xcls_LeftProps _owner )
1435         {
1436             _this = _owner;
1437             _this.keyrender = this;
1438             this.el = new Gtk.CellRendererText();
1439
1440             // my vars (dec)
1441
1442             //listeners
1443             this.el.xediting_started.connect( (  editable, path) => {
1444             
1445                  Gtk.TreeIter  iter;
1446                 _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1447                 GLib.Value gval;
1448                               
1449             
1450             
1451                  //   this.get('/LeftPanel.model').activePath  = path;
1452                 _this.model.el.get_value(iter,1, out gval);
1453                     var val = (string)gval;
1454                              
1455                     ((Gtk.Entry)editable).set_text(val);                 
1456             });
1457             this.el.xedited.connect( (path, newtext) => {
1458                     GLib.debug("Keyrender  - signal:edited\n");
1459                 
1460                 this.el.editable = false;
1461               
1462              
1463             
1464                     Gtk.TreeIter  iter;
1465                     _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1466                     GLib.Value gval;
1467                     
1468                      _this.model.el.get_value(iter,1, out gval);
1469                     var oldval = (string)gval;
1470                     
1471                      _this.model.el.get_value(iter,0, out gval);
1472                     var ktype = (string)gval;
1473                    
1474                     _this.model.el.set_value(iter, 1, newtext);
1475                     
1476                     if (oldval == newtext) {
1477                         return;
1478                     }
1479                     
1480                     
1481                     GLib.debug("ktype: %s\n",ktype);
1482                     switch(ktype) {
1483                         case "listener":
1484                             var ov = _this.node.listeners.get(oldval);
1485                             _this.node.listeners.set(newtext, ov);
1486                             _this.node.listeners.unset(oldval);
1487                             
1488                             _this.updateIter(iter,  ktype, newtext, ov);
1489                             
1490                             break;
1491                         case "props":
1492                             var ov = _this.node.props.get(oldval);
1493                             _this.node.props.set(newtext, ov);
1494                             _this.node.props.unset(oldval);
1495                             _this.updateIter(iter,  ktype, newtext, ov);
1496                             break;
1497                      }
1498                      _this.changed();
1499                       
1500             });
1501         }
1502
1503         // user defined functions
1504     }
1505
1506
1507     public class Xcls_valcol : Object
1508     {
1509         public Gtk.TreeViewColumn el;
1510         private Xcls_LeftProps  _this;
1511
1512
1513             // my vars (def)
1514
1515         // ctor
1516         public Xcls_valcol(Xcls_LeftProps _owner )
1517         {
1518             _this = _owner;
1519             _this.valcol = this;
1520             this.el = new Gtk.TreeViewColumn();
1521
1522             // my vars (dec)
1523             var child_0 = new Xcls_valrender( _this );
1524             child_0.ref();
1525             this.el.pack_start (  child_0.el , true );
1526
1527             // init method
1528
1529             {
1530                 
1531                 //     typeof(string),  // 0 key type
1532                 // typeof(string),  // 1 key
1533                 // typeof(string),  // 2 key (display)
1534                 // typeof(string),  // 3 value
1535                 // typeof(string)   // 4 value (display)
1536             
1537                 
1538                 this.el.add_attribute(_this.valrender.el , "text", 4 );
1539                 //this.el.add_attribute(_this.valrender.el , "sensitive", 4 );
1540                 //this.el.add_attribute(this.items[0].el , 'editable', 3 );
1541                       // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);
1542             
1543              // this.get('/LeftPanel').editableColumn= this;
1544             }
1545         }
1546
1547         // user defined functions
1548     }
1549     public class Xcls_valrender : Object
1550     {
1551         public Gtk.CellRendererCombo el;
1552         private Xcls_LeftProps  _this;
1553
1554
1555             // my vars (def)
1556
1557         // ctor
1558         public Xcls_valrender(Xcls_LeftProps _owner )
1559         {
1560             _this = _owner;
1561             _this.valrender = this;
1562             this.el = new Gtk.CellRendererCombo();
1563
1564             // my vars (dec)
1565             var child_0 = new Xcls_valrendermodel( _this );
1566             child_0.ref();
1567             this.el.model = child_0.el;
1568
1569             //listeners
1570             this.el.editing_started.connect( ( editable, path) => {
1571                 //_this.editing = true;
1572                 GLib.debug("editing started called\n");
1573                 if (!_this.allow_edit) {
1574                    
1575                      GLib.debug("val - editing_Started\n");
1576                     this.el.editable = false; // make sure it's not editor...
1577                
1578                      
1579                     return;
1580                 }
1581                  _this.allow_edit =false;
1582                 
1583                
1584                  if (  this.el.has_entry ) {
1585                
1586                      Gtk.TreeIter  iter;
1587                     _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1588                     GLib.Value gval;
1589                                   
1590             
1591                   
1592                      //   this.get('/LeftPanel.model').activePath  = path;
1593                    _this.model.el.get_value(iter,3, out gval);
1594                 
1595             
1596                     var val = (string)gval;
1597                     var combo =        (Gtk.ComboBox)editable;
1598             
1599                     var entry =  (Gtk.Entry) combo.get_child();        
1600                     entry.set_text(val);
1601                 }
1602                
1603             });
1604             this.el.edited.connect( (path, newtext) => {
1605                 GLib.debug("Valrender  - signal:edited\n");
1606               
1607                     this.el.editable = false;
1608             /*  
1609              m.set(iter, 
1610                             0, "listener",
1611                             1, miter.get_key(),
1612                             2, "<b>" + miter.get_key() + "</b>",
1613                             3, miter.get_value(),
1614                             4, display_value(short);
1615                         ); 
1616             
1617               */      
1618             
1619                     Gtk.TreeIter  iter;
1620                     _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1621                     GLib.Value gval;
1622                     
1623                      _this.model.el.get_value(iter,0, out gval);
1624                     var ktype = (string)gval;
1625                     
1626                     
1627                      _this.model.el.get_value(iter,3, out gval);
1628                     var oldval = (string)gval;
1629                     
1630                      _this.model.el.get_value(iter,1, out gval);
1631                     var key = (string)gval;
1632                     
1633                      
1634                     
1635                     switch(ktype) {
1636                         case "listener":
1637                             _this.node.listeners.set(key, newtext);
1638                             _this.updateIter(iter,ktype,key,newtext);
1639                             break;
1640                         case "props":
1641                             _this.node.props.set(key,newtext);
1642                             _this.updateIter(iter,ktype, key,newtext);                
1643                             break;
1644                      }
1645             //         _this.load(_this.file,_this.node);
1646                      _this.changed();
1647                       
1648             });
1649         }
1650
1651         // user defined functions
1652         public              void setOptions (string[] ar) {
1653               var m = _this.valrendermodel.el;
1654                 m.clear();
1655              Gtk.TreeIter iret;
1656             for (var i =0; i < ar.length; i++) {
1657                     m.append(out iret);
1658                     m.set_value(iret, 0, ar[i]);
1659             }
1660         
1661         }
1662     }
1663     public class Xcls_valrendermodel : Object
1664     {
1665         public Gtk.ListStore el;
1666         private Xcls_LeftProps  _this;
1667
1668
1669             // my vars (def)
1670
1671         // ctor
1672         public Xcls_valrendermodel(Xcls_LeftProps _owner )
1673         {
1674             _this = _owner;
1675             _this.valrendermodel = this;
1676             this.el = new Gtk.ListStore();
1677
1678             // my vars (dec)
1679         }
1680
1681         // user defined functions
1682     }
1683
1684
1685
1686     public class Xcls_ContextMenu : Object
1687     {
1688         public Gtk.Menu el;
1689         private Xcls_LeftProps  _this;
1690
1691
1692             // my vars (def)
1693
1694         // ctor
1695         public Xcls_ContextMenu(Xcls_LeftProps _owner )
1696         {
1697             _this = _owner;
1698             _this.ContextMenu = this;
1699             this.el = new Gtk.Menu();
1700
1701             // my vars (dec)
1702             var child_0 = new Xcls_MenuItem34( _this );
1703             child_0.ref();
1704             this.el.append (  child_0.el  );
1705             var child_1 = new Xcls_SeparatorMenuItem35( _this );
1706             child_1.ref();
1707             this.el.append (  child_1.el  );
1708             var child_2 = new Xcls_MenuItem36( _this );
1709             child_2.ref();
1710             this.el.append (  child_2.el  );
1711         }
1712
1713         // user defined functions
1714     }
1715     public class Xcls_MenuItem34 : Object
1716     {
1717         public Gtk.MenuItem el;
1718         private Xcls_LeftProps  _this;
1719
1720
1721             // my vars (def)
1722
1723         // ctor
1724         public Xcls_MenuItem34(Xcls_LeftProps _owner )
1725         {
1726             _this = _owner;
1727             this.el = new Gtk.MenuItem();
1728
1729             // my vars (dec)
1730
1731             //listeners
1732             this.el.activate.connect( ( )  =>{
1733               
1734                 var s = _this.view.el.get_selection();
1735                 Gtk.TreeIter iter;
1736                 Gtk.TreeModel mod;
1737                 s.get_selected (out  mod, out  iter);
1738                 
1739                   if (_this.view.popover == null) {
1740                                    _this.view.popover = new Xcls_PopoverProperty();
1741                                    _this.view.popover.mainwindow = _this.main_window;
1742                         }
1743                         
1744              
1745                   _this.before_edit();
1746                   _this.stop_editor();
1747                   
1748                  _this.keyrender.el.stop_editing(false);
1749                  _this.keyrender.el.editable  =false;
1750             
1751                  _this.valrender.el.stop_editing(false);
1752                  _this.valrender.el.editable  =false;
1753                  
1754                   
1755                 GLib.Value gvaltype, gval;
1756                 mod.get_value(iter, 1 , out gval); // one is key..
1757                 
1758                  mod.get_value(iter,0, out gvaltype);
1759             
1760                 _this.view.popover.show(_this.view.el, _this.node, (string)gvaltype, (string)gval);
1761                    
1762                 
1763                 
1764                // _this.startEditingKey(model.get_path(iter));
1765             });
1766         }
1767
1768         // user defined functions
1769     }
1770
1771     public class Xcls_SeparatorMenuItem35 : Object
1772     {
1773         public Gtk.SeparatorMenuItem el;
1774         private Xcls_LeftProps  _this;
1775
1776
1777             // my vars (def)
1778
1779         // ctor
1780         public Xcls_SeparatorMenuItem35(Xcls_LeftProps _owner )
1781         {
1782             _this = _owner;
1783             this.el = new Gtk.SeparatorMenuItem();
1784
1785             // my vars (dec)
1786         }
1787
1788         // user defined functions
1789     }
1790
1791     public class Xcls_MenuItem36 : Object
1792     {
1793         public Gtk.MenuItem el;
1794         private Xcls_LeftProps  _this;
1795
1796
1797             // my vars (def)
1798
1799         // ctor
1800         public Xcls_MenuItem36(Xcls_LeftProps _owner )
1801         {
1802             _this = _owner;
1803             this.el = new Gtk.MenuItem();
1804
1805             // my vars (dec)
1806
1807             //listeners
1808             this.el.activate.connect( ( )  =>{
1809                 _this.deleteSelected();
1810             });
1811         }
1812
1813         // user defined functions
1814     }
1815
1816
1817
1818
1819 }