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