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