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