Fix #7242 - see if i can get the parent child tree.. from vala
[roobuilder] / src / Builder4 / MainWindow.vala
1 static Xcls_MainWindow  _MainWindow;
2
3 public class Xcls_MainWindow : Object
4 {
5     public Gtk.Window el;
6     private Xcls_MainWindow  _this;
7
8     public static Xcls_MainWindow singleton()
9     {
10         if (_MainWindow == null) {
11             _MainWindow= new Xcls_MainWindow();
12         }
13         return _MainWindow;
14     }
15     public Xcls_headerbar headerbar;
16     public Xcls_windownew windownew;
17     public Xcls_open_projects_btn open_projects_btn;
18     public Xcls_vbox vbox;
19     public Xcls_mainpane mainpane;
20     public Xcls_leftpane leftpane;
21     public Xcls_editpane editpane;
22     public Xcls_tree tree;
23     public Xcls_props props;
24     public Xcls_rooviewbox rooviewbox;
25     public Xcls_codeeditviewbox codeeditviewbox;
26     public Xcls_topbarmenu topbarmenu;
27     public Xcls_statusbar statusbar;
28     public Xcls_search_entry search_entry;
29     public Xcls_search_results search_results;
30     public Xcls_statusbar_compilestatus_label statusbar_compilestatus_label;
31     public Xcls_statusbar_errors statusbar_errors;
32     public Xcls_statusbar_warnings statusbar_warnings;
33     public Xcls_statusbar_depricated statusbar_depricated;
34     public Xcls_statusbar_run statusbar_run;
35     public Xcls_statusbar_compile_spinner statusbar_compile_spinner;
36
37         // my vars (def)
38     public Project.Project project;
39     public string title;
40     public int no_windows;
41     public WindowState windowstate;
42
43     // ctor
44     public Xcls_MainWindow()
45     {
46         _this = this;
47         this.el = new Gtk.Window( Gtk.WindowType.TOPLEVEL );
48
49         // my vars (dec)
50         this.project = null;
51         this.title = "Roo Application Builder";
52         this.no_windows = 1;
53         this.windowstate = null;
54
55         // set gobject values
56         this.el.border_width = 0;
57         this.el.default_height = 850;
58         this.el.default_width = 1200;
59         var child_0 = new Xcls_headerbar( _this );
60         child_0.ref();
61         this.el.set_titlebar (  child_0.el  );
62         var child_1 = new Xcls_vbox( _this );
63         child_1.ref();
64         this.el.add (  child_1.el  );
65
66         // init method
67
68         this.el.set_icon_name("roobuilder");
69
70         //listeners
71         this.el.delete_event.connect( (   event) => {
72             return false;
73         });
74         this.el.destroy.connect( () =>  {
75          Xcls_MainWindow.singleton().no_windows--;
76          
77          Resources.singleton().disconnect(_this.statusbar.handler_id);
78          
79          
80          if (Xcls_MainWindow.singleton().no_windows < 1) {
81         
82              Gtk.main_quit();
83          }
84         });
85         this.el.show.connect( ( ) => {
86             // hide the file editing..
87            
88             //this.hideViewEditing();
89             _this.statusbar.el.hide();
90              _this.statusbar_errors.el.hide();
91             _this.statusbar_warnings.el.hide();
92             _this.statusbar_depricated.el.hide();
93             _this.statusbar_compile_spinner.el.hide();
94           
95             Resources.singleton().checkResources();
96         
97         });
98         this.el.key_release_event.connect( (event) => {
99             
100             if (this.search_entry.el.is_visible()) {
101                         if (event.keyval == Gdk.Key.f && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
102                             print("SAVE: ctrl-f  pressed");
103                                 this.search_entry.el.grab_focus();
104                             return false;
105                         }
106                         
107                         if (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
108                             print("SAVE: ctrl-g  pressed");
109                                 this.search_entry.forwardSearch(true);
110                             return false;
111                         }
112                         
113                 }    
114                 
115                 if (event.keyval == Gdk.Key.n && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
116                         print("SAVE: ctrl-n  pressed");
117                         this.openNewWindow();
118                         return false;
119                 }
120                 
121            // print(event.key.keyval)
122             
123             return false;
124         
125         });
126     }
127
128     // user defined functions
129     public void openNewWindow () {
130         Xcls_MainWindow.singleton().no_windows++;
131             var w = new Xcls_MainWindow();
132             w.ref();
133     
134             w.el.show_all();
135             w.initChildren();
136             w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project);
137             // should open the file dialog...
138             //w.windowstate.switchState(WindowState.State.FILES);
139     }
140     public        void initChildren () {
141         // this needs putting in a better place..
142         this.windowstate = new WindowState(this);
143          
144     
145      
146     
147         
148     
149     
150     
151     }
152     public             void show () {
153        
154         this.el.show_all();
155     
156     }
157     public             void setTitle (string str) {
158         this.headerbar.el.set_title(this.title + " - " + str);
159     }
160     public class Xcls_headerbar : Object
161     {
162         public Gtk.HeaderBar el;
163         private Xcls_MainWindow  _this;
164
165
166             // my vars (def)
167
168         // ctor
169         public Xcls_headerbar(Xcls_MainWindow _owner )
170         {
171             _this = _owner;
172             _this.headerbar = this;
173             this.el = new Gtk.HeaderBar();
174
175             // my vars (dec)
176
177             // set gobject values
178             this.el.title = "Application Builder";
179             this.el.show_close_button = true;
180             var child_0 = new Xcls_Box3( _this );
181             child_0.ref();
182             this.el.pack_start (  child_0.el  );
183         }
184
185         // user defined functions
186     }
187     public class Xcls_Box3 : Object
188     {
189         public Gtk.Box el;
190         private Xcls_MainWindow  _this;
191
192
193             // my vars (def)
194
195         // ctor
196         public Xcls_Box3(Xcls_MainWindow _owner )
197         {
198             _this = _owner;
199             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
200
201             // my vars (dec)
202
203             // set gobject values
204             var child_0 = new Xcls_windownew( _this );
205             child_0.ref();
206             this.el.add (  child_0.el  );
207             var child_1 = new Xcls_open_projects_btn( _this );
208             child_1.ref();
209             this.el.add (  child_1.el  );
210         }
211
212         // user defined functions
213     }
214     public class Xcls_windownew : Object
215     {
216         public Gtk.Button el;
217         private Xcls_MainWindow  _this;
218
219
220             // my vars (def)
221
222         // ctor
223         public Xcls_windownew(Xcls_MainWindow _owner )
224         {
225             _this = _owner;
226             _this.windownew = this;
227             this.el = new Gtk.Button();
228
229             // my vars (dec)
230
231             // set gobject values
232             this.el.always_show_image = true;
233             this.el.label = "New Window";
234             var child_0 = new Xcls_Image5( _this );
235             child_0.ref();
236             this.el.set_image (  child_0.el  );
237
238             //listeners
239             this.el.clicked.connect( ( ) => {
240                  _this.openNewWindow();
241                   
242             
243             });
244         }
245
246         // user defined functions
247     }
248     public class Xcls_Image5 : Object
249     {
250         public Gtk.Image el;
251         private Xcls_MainWindow  _this;
252
253
254             // my vars (def)
255
256         // ctor
257         public Xcls_Image5(Xcls_MainWindow _owner )
258         {
259             _this = _owner;
260             this.el = new Gtk.Image();
261
262             // my vars (dec)
263
264             // set gobject values
265             this.el.icon_name = "window-new";
266         }
267
268         // user defined functions
269     }
270
271
272     public class Xcls_open_projects_btn : Object
273     {
274         public Gtk.Button el;
275         private Xcls_MainWindow  _this;
276
277
278             // my vars (def)
279
280         // ctor
281         public Xcls_open_projects_btn(Xcls_MainWindow _owner )
282         {
283             _this = _owner;
284             _this.open_projects_btn = this;
285             this.el = new Gtk.Button();
286
287             // my vars (dec)
288
289             // set gobject values
290             this.el.always_show_image = true;
291             this.el.label = "Files / Projects";
292             var child_0 = new Xcls_Image7( _this );
293             child_0.ref();
294             this.el.set_image (  child_0.el  );
295
296             //listeners
297             this.el.clicked.connect( ( ) => {
298                 _this.windowstate.showPopoverFiles(this.el, _this.project);
299             
300             });
301         }
302
303         // user defined functions
304     }
305     public class Xcls_Image7 : Object
306     {
307         public Gtk.Image el;
308         private Xcls_MainWindow  _this;
309
310
311             // my vars (def)
312
313         // ctor
314         public Xcls_Image7(Xcls_MainWindow _owner )
315         {
316             _this = _owner;
317             this.el = new Gtk.Image();
318
319             // my vars (dec)
320
321             // set gobject values
322             this.el.icon_name = "system-file-manager";
323         }
324
325         // user defined functions
326     }
327
328
329
330
331     public class Xcls_vbox : Object
332     {
333         public Gtk.Box el;
334         private Xcls_MainWindow  _this;
335
336
337             // my vars (def)
338
339         // ctor
340         public Xcls_vbox(Xcls_MainWindow _owner )
341         {
342             _this = _owner;
343             _this.vbox = this;
344             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
345
346             // my vars (dec)
347
348             // set gobject values
349             this.el.homogeneous = false;
350             var child_0 = new Xcls_mainpane( _this );
351             child_0.ref();
352             this.el.pack_start (  child_0.el , true,true,0 );
353             var child_1 = new Xcls_Box17( _this );
354             child_1.ref();
355             this.el.pack_end (  child_1.el , false,true,0 );
356         }
357
358         // user defined functions
359     }
360     public class Xcls_mainpane : Object
361     {
362         public Gtk.Paned el;
363         private Xcls_MainWindow  _this;
364
365
366             // my vars (def)
367         public int lastWidth;
368
369         // ctor
370         public Xcls_mainpane(Xcls_MainWindow _owner )
371         {
372             _this = _owner;
373             _this.mainpane = this;
374             this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
375
376             // my vars (dec)
377             this.lastWidth = 0;
378
379             // set gobject values
380             this.el.position = 400;
381             var child_0 = new Xcls_leftpane( _this );
382             child_0.ref();
383             this.el.add (  child_0.el  );
384             var child_1 = new Xcls_Box14( _this );
385             child_1.ref();
386             this.el.add2 (  child_1.el  );
387         }
388
389         // user defined functions
390     }
391     public class Xcls_leftpane : Object
392     {
393         public Gtk.Box el;
394         private Xcls_MainWindow  _this;
395
396
397             // my vars (def)
398
399         // ctor
400         public Xcls_leftpane(Xcls_MainWindow _owner )
401         {
402             _this = _owner;
403             _this.leftpane = this;
404             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
405
406             // my vars (dec)
407
408             // set gobject values
409             var child_0 = new Xcls_editpane( _this );
410             child_0.ref();
411             this.el.pack_start (  child_0.el , true,true,0 );
412         }
413
414         // user defined functions
415     }
416     public class Xcls_editpane : Object
417     {
418         public Gtk.Paned el;
419         private Xcls_MainWindow  _this;
420
421
422             // my vars (def)
423
424         // ctor
425         public Xcls_editpane(Xcls_MainWindow _owner )
426         {
427             _this = _owner;
428             _this.editpane = this;
429             this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
430
431             // my vars (dec)
432
433             // set gobject values
434             var child_0 = new Xcls_tree( _this );
435             child_0.ref();
436             this.el.add1 (  child_0.el  );
437             var child_1 = new Xcls_props( _this );
438             child_1.ref();
439             this.el.add2 (  child_1.el  );
440
441             //listeners
442             this.el.accept_position.connect( () => {
443                 GLib.debug("Accept postion");
444                 return true;
445             });
446             this.el.move_handle.connect( (scroll) => {
447                 GLib.debug("Move handle");
448                 return true;
449             });
450         }
451
452         // user defined functions
453     }
454     public class Xcls_tree : Object
455     {
456         public Gtk.Box el;
457         private Xcls_MainWindow  _this;
458
459
460             // my vars (def)
461
462         // ctor
463         public Xcls_tree(Xcls_MainWindow _owner )
464         {
465             _this = _owner;
466             _this.tree = this;
467             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
468
469             // my vars (dec)
470
471             // set gobject values
472         }
473
474         // user defined functions
475     }
476
477     public class Xcls_props : Object
478     {
479         public Gtk.Box el;
480         private Xcls_MainWindow  _this;
481
482
483             // my vars (def)
484
485         // ctor
486         public Xcls_props(Xcls_MainWindow _owner )
487         {
488             _this = _owner;
489             _this.props = this;
490             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
491
492             // my vars (dec)
493
494             // set gobject values
495         }
496
497         // user defined functions
498     }
499
500
501
502     public class Xcls_Box14 : Object
503     {
504         public Gtk.Box el;
505         private Xcls_MainWindow  _this;
506
507
508             // my vars (def)
509
510         // ctor
511         public Xcls_Box14(Xcls_MainWindow _owner )
512         {
513             _this = _owner;
514             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
515
516             // my vars (dec)
517
518             // set gobject values
519             var child_0 = new Xcls_rooviewbox( _this );
520             child_0.ref();
521             this.el.add (  child_0.el  );
522             var child_1 = new Xcls_codeeditviewbox( _this );
523             child_1.ref();
524             this.el.add (  child_1.el  );
525         }
526
527         // user defined functions
528     }
529     public class Xcls_rooviewbox : Object
530     {
531         public Gtk.Box el;
532         private Xcls_MainWindow  _this;
533
534
535             // my vars (def)
536
537         // ctor
538         public Xcls_rooviewbox(Xcls_MainWindow _owner )
539         {
540             _this = _owner;
541             _this.rooviewbox = this;
542             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
543
544             // my vars (dec)
545
546             // set gobject values
547             this.el.vexpand = true;
548         }
549
550         // user defined functions
551     }
552
553     public class Xcls_codeeditviewbox : Object
554     {
555         public Gtk.Box el;
556         private Xcls_MainWindow  _this;
557
558
559             // my vars (def)
560
561         // ctor
562         public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
563         {
564             _this = _owner;
565             _this.codeeditviewbox = this;
566             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
567
568             // my vars (dec)
569
570             // set gobject values
571             this.el.vexpand = true;
572         }
573
574         // user defined functions
575     }
576
577
578
579     public class Xcls_Box17 : Object
580     {
581         public Gtk.Box el;
582         private Xcls_MainWindow  _this;
583
584
585             // my vars (def)
586
587         // ctor
588         public Xcls_Box17(Xcls_MainWindow _owner )
589         {
590             _this = _owner;
591             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
592
593             // my vars (dec)
594
595             // set gobject values
596             this.el.homogeneous = false;
597             var child_0 = new Xcls_Button18( _this );
598             child_0.ref();
599             this.el.add (  child_0.el  );
600             var child_1 = new Xcls_Button20( _this );
601             child_1.ref();
602             this.el.add (  child_1.el  );
603             var child_2 = new Xcls_MenuButton22( _this );
604             child_2.ref();
605             this.el.add (  child_2.el  );
606             var child_3 = new Xcls_Label27( _this );
607             child_3.ref();
608             this.el.pack_start (  child_3.el , true,true,0 );
609             var child_4 = new Xcls_statusbar( _this );
610             child_4.ref();
611             this.el.pack_start (  child_4.el , true,true,0 );
612             var child_5 = new Xcls_search_entry( _this );
613             child_5.ref();
614             this.el.pack_start (  child_5.el , false,true,0 );
615             var child_6 = new Xcls_MenuBar30( _this );
616             child_6.ref();
617             this.el.add (  child_6.el  );
618             var child_7 = new Xcls_statusbar_compile_spinner( _this );
619             child_7.ref();
620             this.el.add (  child_7.el  );
621         }
622
623         // user defined functions
624     }
625     public class Xcls_Button18 : Object
626     {
627         public Gtk.Button el;
628         private Xcls_MainWindow  _this;
629
630
631             // my vars (def)
632
633         // ctor
634         public Xcls_Button18(Xcls_MainWindow _owner )
635         {
636             _this = _owner;
637             this.el = new Gtk.Button();
638
639             // my vars (dec)
640
641             // set gobject values
642             this.el.always_show_image = true;
643             this.el.tooltip_text = "Project Details";
644             this.el.label = "Edit Project Settings";
645             var child_0 = new Xcls_Image19( _this );
646             child_0.ref();
647             this.el.set_image (  child_0.el  );
648
649             //listeners
650             this.el.clicked.connect( ( ) => {
651                  
652                  _this.windowstate.projectPopoverShow(this.el, _this.project);
653                
654               
655             });
656         }
657
658         // user defined functions
659     }
660     public class Xcls_Image19 : Object
661     {
662         public Gtk.Image el;
663         private Xcls_MainWindow  _this;
664
665
666             // my vars (def)
667
668         // ctor
669         public Xcls_Image19(Xcls_MainWindow _owner )
670         {
671             _this = _owner;
672             this.el = new Gtk.Image();
673
674             // my vars (dec)
675
676             // set gobject values
677             this.el.icon_name = "emblem-system";
678         }
679
680         // user defined functions
681     }
682
683
684     public class Xcls_Button20 : Object
685     {
686         public Gtk.Button el;
687         private Xcls_MainWindow  _this;
688
689
690             // my vars (def)
691
692         // ctor
693         public Xcls_Button20(Xcls_MainWindow _owner )
694         {
695             _this = _owner;
696             this.el = new Gtk.Button();
697
698             // my vars (dec)
699
700             // set gobject values
701             this.el.always_show_image = true;
702             this.el.tooltip_text = "File Details";
703             this.el.label = "Edit File Properties";
704             var child_0 = new Xcls_Image21( _this );
705             child_0.ref();
706             this.el.set_image (  child_0.el  );
707
708             //listeners
709             this.el.clicked.connect( ( ) => {
710               
711                 // create a new file in project..
712                 if (_this.project == null || _this.windowstate.file == null) {
713                     return  ;
714                 }
715                  _this.windowstate.file_details.show(
716                     _this.windowstate.file, this.el
717                 );
718                  
719                 return  ;    
720             
721             
722             });
723         }
724
725         // user defined functions
726     }
727     public class Xcls_Image21 : Object
728     {
729         public Gtk.Image el;
730         private Xcls_MainWindow  _this;
731
732
733             // my vars (def)
734
735         // ctor
736         public Xcls_Image21(Xcls_MainWindow _owner )
737         {
738             _this = _owner;
739             this.el = new Gtk.Image();
740
741             // my vars (dec)
742
743             // set gobject values
744             this.el.icon_name = "document-properties";
745         }
746
747         // user defined functions
748     }
749
750
751     public class Xcls_MenuButton22 : Object
752     {
753         public Gtk.MenuButton el;
754         private Xcls_MainWindow  _this;
755
756
757             // my vars (def)
758
759         // ctor
760         public Xcls_MenuButton22(Xcls_MainWindow _owner )
761         {
762             _this = _owner;
763             this.el = new Gtk.MenuButton();
764
765             // my vars (dec)
766
767             // set gobject values
768             this.el.always_show_image = true;
769             this.el.label = "About";
770             var child_0 = new Xcls_topbarmenu( _this );
771             child_0.ref();
772             this.el.set_popup (  child_0.el  );
773             var child_1 = new Xcls_Image26( _this );
774             child_1.ref();
775             this.el.set_image (  child_1.el  );
776         }
777
778         // user defined functions
779     }
780     public class Xcls_topbarmenu : Object
781     {
782         public Gtk.Menu el;
783         private Xcls_MainWindow  _this;
784
785
786             // my vars (def)
787
788         // ctor
789         public Xcls_topbarmenu(Xcls_MainWindow _owner )
790         {
791             _this = _owner;
792             _this.topbarmenu = this;
793             this.el = new Gtk.Menu();
794
795             // my vars (dec)
796
797             // set gobject values
798             var child_0 = new Xcls_MenuItem24( _this );
799             child_0.ref();
800             this.el.append (  child_0.el  );
801             var child_1 = new Xcls_MenuItem25( _this );
802             child_1.ref();
803             this.el.append (  child_1.el  );
804
805             // init method
806
807             {
808                 this.el.show_all();
809             }
810         }
811
812         // user defined functions
813     }
814     public class Xcls_MenuItem24 : Object
815     {
816         public Gtk.MenuItem el;
817         private Xcls_MainWindow  _this;
818
819
820             // my vars (def)
821
822         // ctor
823         public Xcls_MenuItem24(Xcls_MainWindow _owner )
824         {
825             _this = _owner;
826             this.el = new Gtk.MenuItem();
827
828             // my vars (dec)
829
830             // set gobject values
831             this.el.label = "Download updated Resources";
832
833             //listeners
834             this.el.activate.connect( ( ) => {
835                      Resources.singleton().fetchStart();
836             });
837         }
838
839         // user defined functions
840     }
841
842     public class Xcls_MenuItem25 : Object
843     {
844         public Gtk.MenuItem el;
845         private Xcls_MainWindow  _this;
846
847
848             // my vars (def)
849
850         // ctor
851         public Xcls_MenuItem25(Xcls_MainWindow _owner )
852         {
853             _this = _owner;
854             this.el = new Gtk.MenuItem();
855
856             // my vars (dec)
857
858             // set gobject values
859             this.el.label = "About the Builder";
860
861             //listeners
862             this.el.activate.connect( () => {
863                 About.singleton().el.show();
864                 });
865         }
866
867         // user defined functions
868     }
869
870
871     public class Xcls_Image26 : Object
872     {
873         public Gtk.Image el;
874         private Xcls_MainWindow  _this;
875
876
877             // my vars (def)
878
879         // ctor
880         public Xcls_Image26(Xcls_MainWindow _owner )
881         {
882             _this = _owner;
883             this.el = new Gtk.Image();
884
885             // my vars (dec)
886
887             // set gobject values
888             this.el.icon_name = "dialog-information";
889         }
890
891         // user defined functions
892     }
893
894
895     public class Xcls_Label27 : Object
896     {
897         public Gtk.Label el;
898         private Xcls_MainWindow  _this;
899
900
901             // my vars (def)
902
903         // ctor
904         public Xcls_Label27(Xcls_MainWindow _owner )
905         {
906             _this = _owner;
907             this.el = new Gtk.Label( "   " );
908
909             // my vars (dec)
910
911             // set gobject values
912         }
913
914         // user defined functions
915     }
916
917     public class Xcls_statusbar : Object
918     {
919         public Gtk.ProgressBar el;
920         private Xcls_MainWindow  _this;
921
922
923             // my vars (def)
924         public ulong handler_id;
925
926         // ctor
927         public Xcls_statusbar(Xcls_MainWindow _owner )
928         {
929             _this = _owner;
930             _this.statusbar = this;
931             this.el = new Gtk.ProgressBar();
932
933             // my vars (dec)
934             this.handler_id = -1;
935
936             // set gobject values
937             this.el.show_text = true;
938
939             // init method
940
941             {
942                  this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
943                     if (pos < 1) {
944                         this.el.hide();
945                         _this.mainpane.el.set_sensitive(true);
946                         
947                         return;
948                     }
949                      _this.mainpane.el.set_sensitive(false);
950                      this.el.show();
951                      this.el.set_fraction ((1.0f * pos) / (1.0f * total));
952                      this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
953                    
954                  });
955             }
956         }
957
958         // user defined functions
959     }
960
961     public class Xcls_search_entry : Object
962     {
963         public Gtk.SearchEntry el;
964         private Xcls_MainWindow  _this;
965
966
967             // my vars (def)
968
969         // ctor
970         public Xcls_search_entry(Xcls_MainWindow _owner )
971         {
972             _this = _owner;
973             _this.search_entry = this;
974             this.el = new Gtk.SearchEntry();
975
976             // my vars (dec)
977
978             // set gobject values
979             this.el.width_request = 300;
980
981             // init method
982
983             var description =   Pango.FontDescription.from_string("monospace");
984                 description.set_size(8000);
985                  this.el.override_font(description);
986
987             //listeners
988             this.el.key_press_event.connect( (event) => {
989                 
990                 if (event.keyval == Gdk.Key.Return) {
991                         this.forwardSearch(false);
992                     return true;
993             
994                 }    
995                // print(event.key.keyval)
996                 
997                 return false;
998             
999             });
1000             this.el.changed.connect( () => {
1001                 if (this.el.text == "") {
1002                         _this.search_results.el.hide();
1003                         return;
1004                 }
1005                 var res = 0;
1006                 switch(_this.windowstate.state) {
1007                         case WindowState.State.CODEONLY:
1008                         ///case WindowState.State.CODE:
1009                                 // search the code being edited..
1010                                 res = _this.windowstate.code_editor_tab.search(this.el.text);
1011                                 
1012                                 break;
1013                         case WindowState.State.PREVIEW:
1014                                 if (_this.windowstate.file.xtype == "Gtk") {
1015                                          res = _this.windowstate.window_gladeview.search(this.el.text);
1016                                 } else { 
1017                                          res = _this.windowstate.window_rooview.search(this.el.text);                   
1018                                 }
1019                         
1020                         
1021                                 break;
1022                 }
1023                 _this.search_results.el.show();
1024                 if (res > 0) {
1025                         _this.search_results.el.label = "%d Matches".printf(res);
1026                 } else {
1027                         _this.search_results.el.label = "No Matches";
1028                 }
1029                         
1030                 
1031                 
1032             });
1033         }
1034
1035         // user defined functions
1036         public void forwardSearch (bool change_focus) {
1037                 switch(_this.windowstate.state) {
1038                         case WindowState.State.CODEONLY:
1039                         //case WindowState.State.CODE:
1040                                 // search the code being edited..
1041                                 _this.windowstate.code_editor_tab.forwardSearch(change_focus);
1042                                  
1043                                 break;
1044                         case WindowState.State.PREVIEW:
1045                                 if (_this.windowstate.file.xtype == "Gtk") {
1046                                         _this.windowstate.window_gladeview.forwardSearch(change_focus);
1047                                 } else { 
1048                                          _this.windowstate.window_rooview.forwardSearch(change_focus);
1049                                 }
1050                         
1051                                 break;
1052                 }
1053                 
1054         }
1055     }
1056
1057     public class Xcls_MenuBar30 : Object
1058     {
1059         public Gtk.MenuBar el;
1060         private Xcls_MainWindow  _this;
1061
1062
1063             // my vars (def)
1064
1065         // ctor
1066         public Xcls_MenuBar30(Xcls_MainWindow _owner )
1067         {
1068             _this = _owner;
1069             this.el = new Gtk.MenuBar();
1070
1071             // my vars (dec)
1072
1073             // set gobject values
1074             this.el.tooltip_text = "Update Resources / About Roobuilder";
1075             var child_0 = new Xcls_search_results( _this );
1076             child_0.ref();
1077             this.el.add (  child_0.el  );
1078             var child_1 = new Xcls_statusbar_compilestatus_label( _this );
1079             child_1.ref();
1080             this.el.add (  child_1.el  );
1081             var child_2 = new Xcls_statusbar_errors( _this );
1082             child_2.ref();
1083             this.el.add (  child_2.el  );
1084             var child_3 = new Xcls_statusbar_warnings( _this );
1085             child_3.ref();
1086             this.el.add (  child_3.el  );
1087             var child_4 = new Xcls_statusbar_depricated( _this );
1088             child_4.ref();
1089             this.el.add (  child_4.el  );
1090             var child_5 = new Xcls_statusbar_run( _this );
1091             child_5.ref();
1092             this.el.add (  child_5.el  );
1093         }
1094
1095         // user defined functions
1096     }
1097     public class Xcls_search_results : Object
1098     {
1099         public Gtk.ImageMenuItem el;
1100         private Xcls_MainWindow  _this;
1101
1102
1103             // my vars (def)
1104         public Xcls_ValaCompileErrors popup;
1105
1106         // ctor
1107         public Xcls_search_results(Xcls_MainWindow _owner )
1108         {
1109             _this = _owner;
1110             _this.search_results = this;
1111             this.el = new Gtk.ImageMenuItem();
1112
1113             // my vars (dec)
1114
1115             // set gobject values
1116             this.el.always_show_image = true;
1117             this.el.label = "Matches";
1118             var child_0 = new Xcls_Image32( _this );
1119             child_0.ref();
1120             this.el.set_image (  child_0.el  );
1121
1122             //listeners
1123             this.el.button_press_event.connect( () => {
1124             /*
1125                 if (this.popup == null) {
1126                     this.popup = new Xcls_ValaCompileErrors();
1127                     this.popup.window = _this;
1128                 }
1129                
1130                 
1131                 this.popup.show(this.notices, this.el);
1132                 */
1133                 return true;
1134             });
1135         }
1136
1137         // user defined functions
1138     }
1139     public class Xcls_Image32 : Object
1140     {
1141         public Gtk.Image el;
1142         private Xcls_MainWindow  _this;
1143
1144
1145             // my vars (def)
1146
1147         // ctor
1148         public Xcls_Image32(Xcls_MainWindow _owner )
1149         {
1150             _this = _owner;
1151             this.el = new Gtk.Image();
1152
1153             // my vars (dec)
1154
1155             // set gobject values
1156             this.el.icon_name = "system-search";
1157             this.el.sensitive = false;
1158         }
1159
1160         // user defined functions
1161     }
1162
1163
1164     public class Xcls_statusbar_compilestatus_label : Object
1165     {
1166         public Gtk.MenuItem el;
1167         private Xcls_MainWindow  _this;
1168
1169
1170             // my vars (def)
1171
1172         // ctor
1173         public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1174         {
1175             _this = _owner;
1176             _this.statusbar_compilestatus_label = this;
1177             this.el = new Gtk.MenuItem();
1178
1179             // my vars (dec)
1180
1181             // set gobject values
1182             this.el.label = "Compile Status:";
1183         }
1184
1185         // user defined functions
1186     }
1187
1188     public class Xcls_statusbar_errors : Object
1189     {
1190         public Gtk.ImageMenuItem el;
1191         private Xcls_MainWindow  _this;
1192
1193
1194             // my vars (def)
1195         public Xcls_ValaCompileErrors popup;
1196         public Json.Object notices;
1197
1198         // ctor
1199         public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1200         {
1201             _this = _owner;
1202             _this.statusbar_errors = this;
1203             this.el = new Gtk.ImageMenuItem();
1204
1205             // my vars (dec)
1206             this.notices = new Json.Object() ;
1207
1208             // set gobject values
1209             this.el.always_show_image = true;
1210             this.el.label = "Errors";
1211             var child_0 = new Xcls_Image35( _this );
1212             child_0.ref();
1213             this.el.set_image (  child_0.el  );
1214
1215             //listeners
1216             this.el.button_press_event.connect( () => {
1217                 if (this.popup == null) {
1218                     this.popup = new Xcls_ValaCompileErrors();
1219                     this.popup.window = _this;
1220                 }
1221                
1222                 
1223                 this.popup.show(this.notices, this.el);
1224                 return true;
1225             });
1226         }
1227
1228         // user defined functions
1229         public void setNotices (Json.Object nots, int qty) {
1230             this.el.show();
1231             this.el.label = qty.to_string() + " Errors";
1232             this.notices = nots;
1233         
1234         }
1235     }
1236     public class Xcls_Image35 : Object
1237     {
1238         public Gtk.Image el;
1239         private Xcls_MainWindow  _this;
1240
1241
1242             // my vars (def)
1243
1244         // ctor
1245         public Xcls_Image35(Xcls_MainWindow _owner )
1246         {
1247             _this = _owner;
1248             this.el = new Gtk.Image();
1249
1250             // my vars (dec)
1251
1252             // set gobject values
1253             this.el.icon_name = "dialog-error";
1254         }
1255
1256         // user defined functions
1257     }
1258
1259
1260     public class Xcls_statusbar_warnings : Object
1261     {
1262         public Gtk.ImageMenuItem el;
1263         private Xcls_MainWindow  _this;
1264
1265
1266             // my vars (def)
1267         public Xcls_ValaCompileErrors popup;
1268         public Json.Object notices;
1269
1270         // ctor
1271         public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1272         {
1273             _this = _owner;
1274             _this.statusbar_warnings = this;
1275             this.el = new Gtk.ImageMenuItem();
1276
1277             // my vars (dec)
1278             this.notices = new Json.Object();
1279
1280             // set gobject values
1281             this.el.always_show_image = true;
1282             this.el.label = "Warnings";
1283             var child_0 = new Xcls_Image37( _this );
1284             child_0.ref();
1285             this.el.set_image (  child_0.el  );
1286
1287             //listeners
1288             this.el.button_press_event.connect( () => {
1289                 if (this.popup == null) {
1290                     this.popup = new Xcls_ValaCompileErrors();
1291                     this.popup.window = _this;
1292                 }
1293                 
1294                 this.popup.show(this.notices, this.el);
1295                 return true;
1296             });
1297         }
1298
1299         // user defined functions
1300         public void setNotices (Json.Object nots, int qty) {
1301             this.el.show();
1302             this.el.label = qty.to_string() + " Warnings";
1303             this.notices = nots;
1304         
1305         }
1306     }
1307     public class Xcls_Image37 : Object
1308     {
1309         public Gtk.Image el;
1310         private Xcls_MainWindow  _this;
1311
1312
1313             // my vars (def)
1314
1315         // ctor
1316         public Xcls_Image37(Xcls_MainWindow _owner )
1317         {
1318             _this = _owner;
1319             this.el = new Gtk.Image();
1320
1321             // my vars (dec)
1322
1323             // set gobject values
1324             this.el.icon_name = "dialog-warning";
1325         }
1326
1327         // user defined functions
1328     }
1329
1330
1331     public class Xcls_statusbar_depricated : Object
1332     {
1333         public Gtk.ImageMenuItem el;
1334         private Xcls_MainWindow  _this;
1335
1336
1337             // my vars (def)
1338         public Xcls_ValaCompileErrors popup;
1339         public Json.Object notices;
1340
1341         // ctor
1342         public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1343         {
1344             _this = _owner;
1345             _this.statusbar_depricated = this;
1346             this.el = new Gtk.ImageMenuItem();
1347
1348             // my vars (dec)
1349             this.notices = new Json.Object();
1350
1351             // set gobject values
1352             this.el.always_show_image = true;
1353             this.el.label = "Depricated";
1354             var child_0 = new Xcls_Image39( _this );
1355             child_0.ref();
1356             this.el.set_image (  child_0.el  );
1357
1358             //listeners
1359             this.el.button_press_event.connect( () => {
1360                 if (this.popup == null) {
1361                     this.popup = new Xcls_ValaCompileErrors();
1362                     this.popup.window = _this;
1363                 }
1364                 
1365                 
1366                 this.popup.show(this.notices, this.el);
1367                 return true;
1368             });
1369         }
1370
1371         // user defined functions
1372         public void setNotices (Json.Object nots, int qty) {
1373             this.el.show();
1374             this.el.label = qty.to_string() + " Depricated";
1375             this.notices = nots;
1376         
1377         }
1378     }
1379     public class Xcls_Image39 : Object
1380     {
1381         public Gtk.Image el;
1382         private Xcls_MainWindow  _this;
1383
1384
1385             // my vars (def)
1386
1387         // ctor
1388         public Xcls_Image39(Xcls_MainWindow _owner )
1389         {
1390             _this = _owner;
1391             this.el = new Gtk.Image();
1392
1393             // my vars (dec)
1394
1395             // set gobject values
1396             this.el.icon_name = "dialog-information";
1397         }
1398
1399         // user defined functions
1400     }
1401
1402
1403     public class Xcls_statusbar_run : Object
1404     {
1405         public Gtk.ImageMenuItem el;
1406         private Xcls_MainWindow  _this;
1407
1408
1409             // my vars (def)
1410         public Xcls_ValaCompileErrors popup;
1411
1412         // ctor
1413         public Xcls_statusbar_run(Xcls_MainWindow _owner )
1414         {
1415             _this = _owner;
1416             _this.statusbar_run = this;
1417             this.el = new Gtk.ImageMenuItem();
1418
1419             // my vars (dec)
1420
1421             // set gobject values
1422             this.el.always_show_image = true;
1423             this.el.label = "Run";
1424             var child_0 = new Xcls_Image41( _this );
1425             child_0.ref();
1426             this.el.set_image (  child_0.el  );
1427
1428             //listeners
1429             this.el.button_press_event.connect( () => {
1430                 if (_this.windowstate.file == null) {
1431                         return true;
1432                 }
1433                 _this.windowstate.valasource.spawnExecute(_this.windowstate.file);
1434                 
1435                 _this.windowstate.compile_results.show(this.el,true);
1436                 
1437                 return true;
1438             });
1439         }
1440
1441         // user defined functions
1442     }
1443     public class Xcls_Image41 : Object
1444     {
1445         public Gtk.Image el;
1446         private Xcls_MainWindow  _this;
1447
1448
1449             // my vars (def)
1450
1451         // ctor
1452         public Xcls_Image41(Xcls_MainWindow _owner )
1453         {
1454             _this = _owner;
1455             this.el = new Gtk.Image();
1456
1457             // my vars (dec)
1458
1459             // set gobject values
1460             this.el.icon_name = "media-playback-start";
1461         }
1462
1463         // user defined functions
1464     }
1465
1466
1467
1468     public class Xcls_statusbar_compile_spinner : Object
1469     {
1470         public Gtk.Spinner el;
1471         private Xcls_MainWindow  _this;
1472
1473
1474             // my vars (def)
1475
1476         // ctor
1477         public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1478         {
1479             _this = _owner;
1480             _this.statusbar_compile_spinner = this;
1481             this.el = new Gtk.Spinner();
1482
1483             // my vars (dec)
1484
1485             // set gobject values
1486             this.el.tooltip_text = "Compiling";
1487         }
1488
1489         // user defined functions
1490         public void stop () {
1491          this.el.stop();
1492           this.el.hide();
1493         }
1494         public void start () {
1495           this.el.show();
1496           this.el.start();  
1497         }
1498     }
1499
1500
1501
1502 }