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