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