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