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