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