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