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