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