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