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