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