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 + " " +value) + "</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 + " " + value) + "</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                        if (!_this.stop_editor()) {
1353                                 return;
1354                          }
1355                           
1356                      _this.keyrender.el.stop_editing(false);
1357                      _this.keyrender.el.editable  =false;
1358                 
1359                      _this.valrender.el.stop_editing(false);
1360                      _this.valrender.el.editable  =false;
1361                      Gtk.TreeIter iter;
1362                       var mod = this.el.get_model();
1363                           mod.get_iter (out iter, path);
1364                           
1365                    
1366                         GLib.Value gvaltype, gval;
1367                         mod.get_value(iter, 1 , out gval); // one is key..
1368                         
1369                      mod.get_value(iter,0, out gvaltype);
1370             
1371                     this.popover.show(this.el, _this.node, (string)gvaltype, (string)gval);
1372                        
1373                     //  _this.startEditingKey(path); 
1374                      
1375                     return false;
1376                 }
1377                 
1378                 
1379                 
1380                 
1381                  // right click.
1382                  if (ev.type == Gdk.EventType.BUTTON_PRESS  && ev.button == 3) {    
1383                     // show popup!.   
1384                     //if (col.title == "Value") {
1385                      //     _this.before_edit();
1386                      //    return false;
1387                      //}
1388             
1389                     var p = _this.ContextMenu;
1390             
1391                     p.el.set_screen(Gdk.Screen.get_default());
1392                     p.el.show_all();
1393                     p.el.popup(null, null, null,  ev.button, ev.time);
1394                     //Seed.print("click:" + res.column.title);
1395                     // select the 
1396                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
1397               
1398                         this.el.get_selection().select_path(path);
1399                         return false;
1400                     });
1401                      _this.before_edit();
1402                     return false;
1403                 }
1404                 
1405                  
1406                 if (col.title != "Value") {
1407                     print("col title != Value");
1408                     
1409                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
1410                         this.el.get_selection().select_path(path);
1411                         return false;
1412                     });
1413                     
1414                     _this.before_edit();
1415                       //  XObject.error("column is not value?");
1416                     return false; // ignore.. - key click.. ??? should we do this??
1417                 }
1418                 
1419                 
1420                 // if the cell can be edited with a pulldown
1421                 // then we should return true... - and let the start_editing handle it?
1422                 
1423                 
1424                 
1425                 
1426                 
1427                   
1428                //             _this.before_edit(); <<< we really need to stop the other editor..
1429                  _this.keyrender.el.stop_editing(false);
1430                 _this.keyrender.el.editable  =false;
1431                 
1432                        
1433                 return _this.startEditingValue(path); // assumes selected row..
1434                     
1435                
1436             
1437                           
1438                
1439             });
1440         }
1441
1442         // user defined functions
1443     }
1444     public class Xcls_model : Object
1445     {
1446         public Gtk.TreeStore el;
1447         private Xcls_LeftProps  _this;
1448
1449
1450             // my vars (def)
1451
1452         // ctor
1453         public Xcls_model(Xcls_LeftProps _owner )
1454         {
1455             _this = _owner;
1456             _this.model = this;
1457             this.el = new Gtk.TreeStore( 7,      typeof(string),  // 0 key type
1458      typeof(string),  // 1 key
1459      typeof(string),  // 2 key (display)
1460      typeof(string),  // 3 value
1461      typeof(string),   // 4 value (display)
1462      typeof(string),   // 5 both (tooltip)     
1463      typeof(string)   // 6 key (for sorting)
1464  );
1465
1466             // my vars (dec)
1467
1468             // set gobject values
1469         }
1470
1471         // user defined functions
1472     }
1473
1474     public class Xcls_keycol : Object
1475     {
1476         public Gtk.TreeViewColumn el;
1477         private Xcls_LeftProps  _this;
1478
1479
1480             // my vars (def)
1481
1482         // ctor
1483         public Xcls_keycol(Xcls_LeftProps _owner )
1484         {
1485             _this = _owner;
1486             _this.keycol = this;
1487             this.el = new Gtk.TreeViewColumn();
1488
1489             // my vars (dec)
1490
1491             // set gobject values
1492             this.el.title = "Name";
1493             this.el.resizable = true;
1494             var child_0 = new Xcls_keyrender( _this );
1495             child_0.ref();
1496             this.el.pack_start (  child_0.el , false );
1497
1498             // init method
1499
1500             this.el.add_attribute(_this.keyrender.el , "markup", 2 );
1501              this.el.add_attribute(_this.keyrender.el , "text", 1 );
1502         }
1503
1504         // user defined functions
1505     }
1506     public class Xcls_keyrender : Object
1507     {
1508         public Gtk.CellRendererText el;
1509         private Xcls_LeftProps  _this;
1510
1511
1512             // my vars (def)
1513
1514         // ctor
1515         public Xcls_keyrender(Xcls_LeftProps _owner )
1516         {
1517             _this = _owner;
1518             _this.keyrender = this;
1519             this.el = new Gtk.CellRendererText();
1520
1521             // my vars (dec)
1522
1523             // set gobject values
1524
1525             //listeners
1526             this.el.editing_started.connect( (  editable, path) => {
1527             
1528                  Gtk.TreeIter  iter;
1529                 _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1530                 GLib.Value gval;
1531                               
1532             
1533             
1534                  //   this.get('/LeftPanel.model').activePath  = path;
1535                 _this.model.el.get_value(iter,1, out gval);
1536                     var val = (string)gval;
1537                              
1538                     ((Gtk.Entry)editable).set_text(val);                 
1539             });
1540             this.el.edited.connect( (path, newtext) => {
1541                     print("Keyrender  - signal:edited\n");
1542                 
1543                 this.el.editable = false;
1544               
1545              
1546             
1547                     Gtk.TreeIter  iter;
1548                     _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1549                     GLib.Value gval;
1550                     
1551                      _this.model.el.get_value(iter,1, out gval);
1552                     var oldval = (string)gval;
1553                     
1554                      _this.model.el.get_value(iter,0, out gval);
1555                     var ktype = (string)gval;
1556                    
1557                     _this.model.el.set_value(iter, 1, newtext);
1558                     
1559                     if (oldval == newtext) {
1560                         return;
1561                     }
1562                     
1563                     
1564                     print("ktype: %s\n",ktype);
1565                     switch(ktype) {
1566                         case "listener":
1567                             var ov = _this.node.listeners.get(oldval);
1568                             _this.node.listeners.set(newtext, ov);
1569                             _this.node.listeners.unset(oldval);
1570                             
1571                             _this.updateIter(iter,  ktype, newtext, ov);
1572                             
1573                             break;
1574                         case "props":
1575                             var ov = _this.node.props.get(oldval);
1576                             _this.node.props.set(newtext, ov);
1577                             _this.node.props.unset(oldval);
1578                             _this.updateIter(iter,  ktype, newtext, ov);
1579                             break;
1580                      }
1581                      _this.changed();
1582                       
1583             });
1584         }
1585
1586         // user defined functions
1587     }
1588
1589
1590     public class Xcls_valcol : Object
1591     {
1592         public Gtk.TreeViewColumn el;
1593         private Xcls_LeftProps  _this;
1594
1595
1596             // my vars (def)
1597
1598         // ctor
1599         public Xcls_valcol(Xcls_LeftProps _owner )
1600         {
1601             _this = _owner;
1602             _this.valcol = this;
1603             this.el = new Gtk.TreeViewColumn();
1604
1605             // my vars (dec)
1606
1607             // set gobject values
1608             this.el.title = "Value";
1609             this.el.resizable = true;
1610             var child_0 = new Xcls_valrender( _this );
1611             child_0.ref();
1612             this.el.pack_start (  child_0.el , true );
1613
1614             // init method
1615
1616             {
1617                 
1618                 //     typeof(string),  // 0 key type
1619                 // typeof(string),  // 1 key
1620                 // typeof(string),  // 2 key (display)
1621                 // typeof(string),  // 3 value
1622                 // typeof(string)   // 4 value (display)
1623             
1624                 
1625                 this.el.add_attribute(_this.valrender.el , "text", 4 );
1626                 //this.el.add_attribute(_this.valrender.el , "sensitive", 4 );
1627                 //this.el.add_attribute(this.items[0].el , 'editable', 3 );
1628                       // this.el.set_cell_data_func(cell, age_cell_data_func, NULL, NULL);
1629             
1630              // this.get('/LeftPanel').editableColumn= this;
1631             }
1632         }
1633
1634         // user defined functions
1635     }
1636     public class Xcls_valrender : Object
1637     {
1638         public Gtk.CellRendererCombo el;
1639         private Xcls_LeftProps  _this;
1640
1641
1642             // my vars (def)
1643
1644         // ctor
1645         public Xcls_valrender(Xcls_LeftProps _owner )
1646         {
1647             _this = _owner;
1648             _this.valrender = this;
1649             this.el = new Gtk.CellRendererCombo();
1650
1651             // my vars (dec)
1652
1653             // set gobject values
1654             this.el.editable = false;
1655             this.el.text_column = 0;
1656             this.el.has_entry = true;
1657             var child_0 = new Xcls_valrendermodel( _this );
1658             child_0.ref();
1659             this.el.model = child_0.el;
1660
1661             //listeners
1662             this.el.editing_started.connect( ( editable, path) => {
1663                 //_this.editing = true;
1664                 print("editing started called\n");
1665                 if (!_this.allow_edit) {
1666                    
1667                      print("val - editing_Started\n");
1668                     this.el.editable = false; // make sure it's not editor...
1669                
1670                      
1671                     return;
1672                 }
1673                  _this.allow_edit =false;
1674                 
1675                
1676                  if (  this.el.has_entry ) {
1677                
1678                      Gtk.TreeIter  iter;
1679                     _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1680                     GLib.Value gval;
1681                                   
1682             
1683                   
1684                      //   this.get('/LeftPanel.model').activePath  = path;
1685                    _this.model.el.get_value(iter,3, out gval);
1686                 
1687             
1688                     var val = (string)gval;
1689                     var combo =        (Gtk.ComboBox)editable;
1690             
1691                     var entry =  (Gtk.Entry) combo.get_child();        
1692                     entry.set_text(val);
1693                 }
1694                
1695             });
1696             this.el.edited.connect( (path, newtext) => {
1697                 print("Valrender  - signal:edited\n");
1698               
1699                     this.el.editable = false;
1700             /*  
1701              m.set(iter, 
1702                             0, "listener",
1703                             1, miter.get_key(),
1704                             2, "<b>" + miter.get_key() + "</b>",
1705                             3, miter.get_value(),
1706                             4, display_value(short);
1707                         ); 
1708             
1709               */      
1710             
1711                     Gtk.TreeIter  iter;
1712                     _this.model.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1713                     GLib.Value gval;
1714                     
1715                      _this.model.el.get_value(iter,0, out gval);
1716                     var ktype = (string)gval;
1717                     
1718                     
1719                      _this.model.el.get_value(iter,3, out gval);
1720                     var oldval = (string)gval;
1721                     
1722                      _this.model.el.get_value(iter,1, out gval);
1723                     var key = (string)gval;
1724                     
1725                      
1726                     
1727                     switch(ktype) {
1728                         case "listener":
1729                             _this.node.listeners.set(key, newtext);
1730                             _this.updateIter(iter,ktype,key,newtext);
1731                             break;
1732                         case "props":
1733                             _this.node.props.set(key,newtext);
1734                             _this.updateIter(iter,ktype, key,newtext);                
1735                             break;
1736                      }
1737             //         _this.load(_this.file,_this.node);
1738                      _this.changed();
1739                       
1740             });
1741         }
1742
1743         // user defined functions
1744         public              void setOptions (string[] ar) {
1745               var m = _this.valrendermodel.el;
1746                 m.clear();
1747              Gtk.TreeIter iret;
1748             for (var i =0; i < ar.length; i++) {
1749                     m.append(out iret);
1750                     m.set_value(iret, 0, ar[i]);
1751             }
1752         
1753         }
1754     }
1755     public class Xcls_valrendermodel : Object
1756     {
1757         public Gtk.ListStore el;
1758         private Xcls_LeftProps  _this;
1759
1760
1761             // my vars (def)
1762
1763         // ctor
1764         public Xcls_valrendermodel(Xcls_LeftProps _owner )
1765         {
1766             _this = _owner;
1767             _this.valrendermodel = this;
1768             this.el = new Gtk.ListStore( 1, typeof(string) );
1769
1770             // my vars (dec)
1771
1772             // set gobject values
1773         }
1774
1775         // user defined functions
1776     }
1777
1778
1779
1780     public class Xcls_ContextMenu : Object
1781     {
1782         public Gtk.Menu el;
1783         private Xcls_LeftProps  _this;
1784
1785
1786             // my vars (def)
1787
1788         // ctor
1789         public Xcls_ContextMenu(Xcls_LeftProps _owner )
1790         {
1791             _this = _owner;
1792             _this.ContextMenu = this;
1793             this.el = new Gtk.Menu();
1794
1795             // my vars (dec)
1796
1797             // set gobject values
1798             var child_0 = new Xcls_MenuItem33( _this );
1799             child_0.ref();
1800             this.el.append (  child_0.el  );
1801             var child_1 = new Xcls_SeparatorMenuItem34( _this );
1802             child_1.ref();
1803             this.el.append (  child_1.el  );
1804             var child_2 = new Xcls_MenuItem35( _this );
1805             child_2.ref();
1806             this.el.append (  child_2.el  );
1807         }
1808
1809         // user defined functions
1810     }
1811     public class Xcls_MenuItem33 : Object
1812     {
1813         public Gtk.MenuItem el;
1814         private Xcls_LeftProps  _this;
1815
1816
1817             // my vars (def)
1818
1819         // ctor
1820         public Xcls_MenuItem33(Xcls_LeftProps _owner )
1821         {
1822             _this = _owner;
1823             this.el = new Gtk.MenuItem();
1824
1825             // my vars (dec)
1826
1827             // set gobject values
1828             this.el.label = "Edit";
1829
1830             //listeners
1831             this.el.activate.connect( ( )  =>{
1832               
1833                 var s = _this.view.el.get_selection();
1834                 Gtk.TreeIter iter;
1835                 Gtk.TreeModel model;
1836                 s.get_selected (out  model, out  iter);
1837                 _this.startEditingKey(model.get_path(iter));
1838             });
1839         }
1840
1841         // user defined functions
1842     }
1843
1844     public class Xcls_SeparatorMenuItem34 : Object
1845     {
1846         public Gtk.SeparatorMenuItem el;
1847         private Xcls_LeftProps  _this;
1848
1849
1850             // my vars (def)
1851
1852         // ctor
1853         public Xcls_SeparatorMenuItem34(Xcls_LeftProps _owner )
1854         {
1855             _this = _owner;
1856             this.el = new Gtk.SeparatorMenuItem();
1857
1858             // my vars (dec)
1859
1860             // set gobject values
1861         }
1862
1863         // user defined functions
1864     }
1865
1866     public class Xcls_MenuItem35 : Object
1867     {
1868         public Gtk.MenuItem el;
1869         private Xcls_LeftProps  _this;
1870
1871
1872             // my vars (def)
1873
1874         // ctor
1875         public Xcls_MenuItem35(Xcls_LeftProps _owner )
1876         {
1877             _this = _owner;
1878             this.el = new Gtk.MenuItem();
1879
1880             // my vars (dec)
1881
1882             // set gobject values
1883             this.el.label = "Delete";
1884
1885             //listeners
1886             this.el.activate.connect( ( )  =>{
1887                 _this.deleteSelected();
1888             });
1889         }
1890
1891         // user defined functions
1892     }
1893
1894
1895
1896
1897 }