src/Builder4/WindowState.vala
[app.Builder.js] / src / Builder4 / WindowState.vala
1 /**
2  * as state management is a bit too complicated inside the builder
3  * it's better to seperate this into this class
4  * 
5  * This class has references to all the Class instances that make up the window..
6  * 
7  */
8 public class WindowState : Object 
9 {
10     public Xcls_MainWindow win;
11
12     public enum State {
13         NONE,
14         PREVIEW,
15         OBJECT,
16         PROP,
17         LISTENER,
18         CODE,
19         FILES,
20         PROJECT // project settings..
21     }
22
23     public State state = State.NONE;
24
25     public bool children_loaded = false;
26
27     
28     public Xcls_WindowLeftTree  left_tree;
29     public Xcls_WindowAddProp   add_props;
30     public Xcls_LeftProps       left_props;
31     public Xcls_ProjectSettings projectsettings;
32     public ValaProjectSettings  vala_projectsettings;
33     public Xcls_RightPalete     rightpalete;
34     public Editor               code_editor;    
35     public Xcls_WindowRooView   window_rooview;
36     public Xcls_GtkView         window_gladeview;
37     public Xcls_DialogNewComponent new_file_dialog;
38     public Xcls_ClutterFiles     clutterfiles;
39
40     public Xcls_WindowLeftProjects left_projects; // can not see where this is initialized.. 
41     // ctor 
42     public WindowState(Xcls_MainWindow win)
43     {
44         this.win = win;
45         // initialize
46
47         // left elements..
48         this.leftTreeInit();
49         this.propsListInit();
50
51         // on clutter space...
52         this.projectEditInit();
53         this.codeEditInit();
54         this.projectListInit();
55         this.fileViewInit();
56         
57         // adding stuff
58         this.objectAddInit();
59         this.propsAddInit();
60      
61         
62         // previews...
63         this.gtkViewInit();
64         this.webkitViewInit();
65
66         // dialogs
67
68         this.fileNewInit();
69
70         this.children_loaded = true;
71     }
72
73
74     // left tree
75
76     public void leftTreeInit()
77     {
78      
79         this.left_tree = new Xcls_WindowLeftTree();
80         this.left_tree.ref();
81         this.left_tree.main_window = this.win;
82     
83         this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
84         this.left_tree.el.show_all();
85            
86         this.left_tree.before_node_change.connect(() => {
87             return this.leftTreeBeforeChange();
88
89         });
90
91         this.left_tree.node_selected.connect((sel) => {
92             this.leftTreeNodeSelected(sel);
93         });
94      
95         this.left_tree.changed.connect(() => {
96             this.window_rooview.requestRedraw();
97             this.left_tree.model.file.save();
98         });
99          
100     }
101
102     public bool leftTreeBeforeChange()
103     {
104         if (this.state != State.CODE) {
105             this.left_props.finish_editing();
106             return true;
107         }
108         if (!this.code_editor.saveContents()) {
109             return false;
110         }
111         return false;
112     }
113     
114     public void leftTreeNodeSelected(JsRender.Node? sel)
115     {
116
117         print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
118
119         if (sel == null) {
120             this.left_props.el.hide();
121         } 
122         this.left_props.el.show();
123         this.left_props.load(this.left_tree.getActiveFile(), sel);
124         switch (this.state) {
125             
126             case State.OBJECT: 
127                   
128                  if (sel == null) {
129                     this.rightpalete.clear();
130                     break;
131                 }
132                 this.rightpalete.load(this.left_tree.getActiveFile().palete(), sel.fqn());
133                 break;
134                  
135         
136            case State.PROP:
137                 if (sel == null) {
138                     this.add_props.clear();
139                     break;
140                 }
141                 this.add_props.show(this.left_tree.getActiveFile().palete(), "props", sel.fqn());
142                 break;
143
144             case State.LISTENER:
145                
146                 if (sel == null) {
147                     this.add_props.clear();
148                     break;
149                 }
150                 this.add_props.show(this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
151                 break;
152                 
153             case State.CODE:
154                  this.switchState(State.PREVIEW);
155              
156                 break;
157                
158                             
159         }
160          
161
162     }
163
164
165
166
167     public void propsListInit()
168     {
169     
170         this.left_props =new Xcls_LeftProps();
171         this.left_props.ref();
172         this.left_props.main_window = this.win;
173         this.win.props.el.pack_start(this.left_props.el,true, true,0);
174         this.left_props.el.show_all();
175     
176         this.left_props.show_editor.connect( (file, node, type,  key) => {
177             this.switchState(State.CODE);
178             this.code_editor.show(
179                 file,
180                 node,
181                 type,
182                 key
183             );
184             
185             
186         });
187
188    
189         this.left_props.stop_editor.connect( () => {
190             if (this.state != State.CODE) {
191                 return true;
192             }
193     
194             var ret =  this.code_editor.saveContents();
195             if (!ret) {
196                 return false;
197             }
198             this.switchState(State.PREVIEW);
199             return ret;
200         });
201     
202         this.left_props.changed.connect(() => {
203               if (this.left_tree.getActiveFile().xtype == "Roo" ) {
204                    this.window_rooview.requestRedraw();
205                    
206                } else {
207                   this.window_gladeview.loadFile(this.left_tree.getActiveFile());
208               }
209               this.left_tree.model.updateSelected();
210               this.left_tree.model.file.save();
211         });
212     
213
214
215     }
216
217     //-------------  projects edit
218
219     public void projectEditInit()
220     {
221         this.projectsettings  =new Xcls_ProjectSettings();
222         this.projectsettings.ref();  /// really?
223     
224         this.vala_projectsettings  =new ValaProjectSettings();
225         this.vala_projectsettings.ref();
226         this.vala_projectsettings.window = this.win;
227     
228         ((Gtk.Container)(this.win.projecteditview.el.get_widget())).add(this.projectsettings.el);
229         //this.projectsettings.el.show_all();
230
231         var stage = this.win.projecteditview.el.get_stage();
232         stage.set_background_color(  Clutter.Color.from_string("#000"));
233     
234         this.projectsettings.buttonPressed.connect((btn) => {
235              if (this.left_tree.getActiveFile().xtype == "Roo" ) {
236                 if (btn == "save") {
237                     this.window_rooview.view.renderJS(true);
238                 }
239                 if (btn == "apply") {
240                     this.window_rooview.view.renderJS(true);
241                     return;
242                 }
243             } else {
244                 // do nothing for gtk..
245             }
246             if (btn == "save" || btn == "apply") {
247                 this.win.project.save();
248          
249             }
250             this.switchState (State.PREVIEW); 
251              
252          });
253
254     }
255     // ----------- object adding
256     public void objectAddInit()
257     {
258
259         this.rightpalete  = new Xcls_RightPalete();
260         this.rightpalete.ref();  /// really?
261         ((Gtk.Container)(this.win.objectview.el.get_widget())).add(this.rightpalete.el);
262         //this.projectsettings.el.show_all();
263
264         var stage = this.win.objectview.el.get_stage();
265         stage.set_background_color(  Clutter.Color.from_string("#000"));
266            
267     }
268     
269     // -----------  properties adding list...
270     // listener uses the properties 
271     public void propsAddInit()
272     {
273     // Add properties
274         this.add_props  = new Xcls_WindowAddProp();
275         this.add_props.ref();  /// really?
276         ((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
277         //this.projectsettings.el.show_all();
278
279         var  stage = this.win.addpropsview.el.get_stage();
280         stage.set_background_color(  Clutter.Color.from_string("#000"));
281
282
283         this.add_props.select.connect( (key,type,skel, etype) => {
284             this.left_props.addProp(etype, key, skel, type);
285         });
286
287     }
288     public void propsAddShow()
289     {
290
291     }
292     public void propsAddHide()
293     {
294     
295     }
296
297
298
299     
300     // ----------- Add / Edit listener
301     // listener uses the properties 
302     //public void listenerInit()     { }
303     public void listenerShow()
304     {
305
306     }
307     public void listenerHide()
308     {
309     
310     }
311
312     // -------------- codeEditor
313
314     public void codeEditInit()
315     {
316         this.code_editor  = new  Editor();
317         this.code_editor.ref();  /// really?
318         ((Gtk.Container)(this.win.codeeditview.el.get_widget())).add(this.code_editor.el);
319         //this.projectsettings.el.show_all();
320
321         var stage = this.win.codeeditview.el.get_stage();
322         stage.set_background_color(  Clutter.Color.from_string("#000"));
323         // editor.save...
324
325         this.code_editor.save.connect( () => {
326              this.left_tree.model.file.save();
327              this.left_tree.model.updateSelected();
328         });
329         
330     }
331
332     // ----------- list of projects on left
333     public void  projectListInit() 
334     {
335
336         this.left_projects = new Xcls_WindowLeftProjects();
337          this.left_projects.ref();
338          this.win.leftpane.el.pack_start(this.left_projects.el,true, true,0);
339          this.left_projects.el.show_all();
340          this.left_projects.project_selected.connect((proj) => {
341             proj.scanDirs();
342             this.clutterfiles.loadProject(proj);
343         
344          });
345
346     }
347     // ----------- file view
348
349     public void fileViewInit()
350     {
351         var stage = this.win.rooview.el.get_stage(); // seems odd... 
352         this.clutterfiles = new Xcls_ClutterFiles();
353         this.clutterfiles.ref();
354         stage.add_child(this.clutterfiles.el);
355         this.clutterfiles.el.show_all();
356
357
358         this.clutterfiles.open.connect((file) => { 
359             this.fileViewOpen(file);
360         });
361         this.clutterfiles.el.transitions_completed.connect(() => {
362             if (this.state == State.FILES) {
363                 this.win.rooview.el.hide();
364             } else {
365                 this.clutterfiles.el.hide();
366             }
367             
368             
369         });
370
371     }
372     public void fileNewInit()
373     {
374         this.new_file_dialog = new Xcls_DialogNewComponent();
375         // force it modal to the main window..
376         this.new_file_dialog.el.set_transient_for(this.win.el);
377         this.new_file_dialog.el.set_modal(true);
378     
379         this.new_file_dialog.success.connect((project,file) =>
380         {
381             this.fileViewOpen(file);
382         });
383
384     }
385
386     
387     public void fileViewOpen(JsRender.JsRender file)
388     {
389         this.win.project = file.project;
390         this.switchState (State.PREVIEW); 
391         
392         this.left_tree.model.loadFile(file);
393     
394         var ctr= ((Gtk.Container)(this.win.rooview.el.get_widget()));
395         var ctr_p= ((Gtk.Container)(this.win.projecteditview.el.get_widget()));
396     
397         if (file.xtype == "Roo" ) { 
398             ctr.foreach( (w) => { ctr.remove(w); });
399             ctr_p.foreach( (w) => { ctr_p.remove(w); });
400             ctr.add(this.window_rooview.el);
401             ctr_p.add(this.projectsettings.el);            
402             this.window_rooview.loadFile(file);
403             this.window_rooview.el.show_all();
404             this.projectsettings.el.show_all();            
405
406         } else {
407             ctr.foreach( (w) => { ctr.remove(w); });
408             ctr_p.foreach( (w) => { ctr_p.remove(w); });            
409             ctr.add(this.window_gladeview.el);
410             ctr_p.add(this.vala_projectsettings.el);
411             this.window_gladeview.loadFile(file);
412             this.window_gladeview.el.show_all();
413             this.vala_projectsettings.el.show_all();
414         }
415         print("OPEN : " + file.name);
416         this.win.editpane.el.set_position(this.win.editpane.el.max_position);
417         this.win.setTitle(file.project.name + " : " +file.name);
418              
419
420         }
421
422     
423     // ---------  webkit view
424     public void webkitViewInit()
425     {
426         this.window_rooview  =new Xcls_WindowRooView();
427         this.window_rooview.ref();
428         ((Gtk.Container)(this.win.rooview.el.get_widget())).add(this.window_rooview.el);
429         this.window_rooview.el.show_all();
430
431         var stage = this.win.rooview.el.get_stage();
432         stage.set_background_color(  Clutter.Color.from_string("#000"));
433     }
434
435     // ------ Gtk  - view
436
437     public void gtkViewInit()
438     {
439         this.window_gladeview  =new Xcls_GtkView();
440         this.window_gladeview.ref();
441     }
442     
443     public void easingSaveAll()
444     {
445         this.win.addpropsview.el.save_easing_state();
446         this.win.codeeditview.el.save_easing_state();
447         this.win.objectview.el.save_easing_state();
448         this.win.projecteditview.el.save_easing_state();
449         this.win.rooview.el.save_easing_state();
450         this.clutterfiles.el.save_easing_state();
451          
452     }
453     public void easingRestoreAll()
454     {
455         this.win.addpropsview.el.restore_easing_state();
456         this.win.codeeditview.el.restore_easing_state();
457         this.win.objectview.el.restore_easing_state();
458         this.win.projecteditview.el.restore_easing_state();
459         this.win.rooview.el.restore_easing_state();
460         this.clutterfiles.el.restore_easing_state();
461         
462     }
463     public void switchState(State new_state)
464     {
465         
466         // save the easing state of everything..
467         this.easingSaveAll();
468         
469         switch (this.state) {
470
471             case State.PREVIEW:
472                 if (this.left_tree.getActiveFile() != null) {
473                      if (this.left_tree.getActiveFile().xtype == "Roo" ) {
474                          this.window_rooview.createThumb();
475                      } else {
476                           this.window_gladeview.createThumb();
477                       }
478                 }
479                 // normally we are going from preview to another state.
480                 // and different windows hide the preview in differnt ways..
481                 
482                 break;
483             
484            case State.LISTENER:
485            case State.PROP:
486                 
487                 this.win.addpropsview.el.set_scale(0.0f,0.0f);
488                  break;
489                 
490             case State.CODE:
491
492
493                 this.code_editor.saveContents();
494               
495                 this.win.codeeditview.el.set_scale(0.0f,0.0f);
496                  break;
497
498
499              case State.OBJECT:
500                
501                 this.win.objectview.el.set_scale(0.0f,0.0f);
502                  break;
503
504            case State.PROJECT:
505                 if (this.win.project.xtype == "Gtk") {
506                     this.vala_projectsettings.save();
507                 } 
508                 
509                 this.win.projecteditview.el.set_scale(0.0f,0.0f);
510                  break;
511
512           case State.FILES:
513                 // hide files...
514                 
515                 this.win.rooview.el.show_all();
516                 this.win.rooview.el.set_easing_duration(1000);
517                 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
518                 this.win.rooview.el.set_scale(1.0f,1.0f);
519                 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
520                 this.win.rooview.el.set_opacity(0xff);
521                
522                 
523                
524                  this.clutterfiles.el.set_easing_duration(1000);
525                 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
526                 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
527                 this.clutterfiles.el.set_opacity(0);
528  
529                 //this.clutterfiles.el.hide();
530                  
531
532                 break;
533
534                 
535         }
536        
537         var oldstate  =this.state;
538         this.state = new_state;
539         
540         
541                 
542         this.buttonsShowHide();
543         
544         
545         switch (this.state) {
546             
547             case State.PREVIEW:  // this is the default state when working...
548                  this.win.editpane.el.show(); // holder for tree and properties..
549                  
550              
551                  this.left_projects.el.hide(); 
552                  if (oldstate != State.FILES) {
553                     // it's handled above..
554                     print ("changing state to preview from NOT files..");
555                      
556  
557                     this.win.rooview.el.set_scale(1.0f,1.0f);
558                  }
559                
560                 break;
561
562
563             case State.LISTENER:
564                 // same as prop?
565             case State.PROP:
566                 var ae =      this.left_tree.getActiveElement();
567                 if (ae == null) {
568                     this.state = oldstate;
569                     this.buttonsShowHide();
570                     this.resizeCanvasElements();
571                     this.easingRestoreAll();
572                     return;
573                 }
574                 this.add_props.el.show_all();
575                 this.add_props.show(
576                     Palete.factory(this.win.project.xtype), 
577                     this.state == State.LISTENER ? "signals" : "props",
578                     ae.fqn()
579                 );
580  
581                     
582  
583                 
584                 // -- FIXME? this needs to be State aware?
585          
586                 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
587                   
588                 this.win.addpropsview.el.set_scale(1.0f,1.0f);
589                  break;
590            
591             case State.OBJECT:
592                  var n = this.left_tree.getActiveElement();
593
594                 if (this.left_tree.model.file == null) {
595                     this.state =oldstate;
596                     this.buttonsShowHide();
597                     this.resizeCanvasElements();
598                     this.easingRestoreAll();
599                     return;
600                 }
601                 
602                 if (n == null && this.left_tree.model.file.tree != null) {
603                     this.state = oldstate;
604                     this.buttonsShowHide();
605                     this.resizeCanvasElements();
606                     this.easingRestoreAll();
607                     return;
608                 }
609
610                 this.rightpalete.el.show_all();
611                 this.rightpalete.load(this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
612
613                 
614               
615             
616                 this.win.objectview.el.set_scale(1.0f,1.0f);
617                  
618                 break;
619                
620                
621             case State.CODE:
622
623                 this.code_editor.el.show_all();
624                 
625                 // caller needs to call editor - show....
626                   
627  
628                  this.win.codeeditview.el.set_scale(1.0f,1.0f);
629                  break;
630
631
632
633            case State.PROJECT:
634
635                if (this.win.project.xtype == "Roo") {
636                     this.projectsettings.el.show_all();
637                     this.projectsettings.show(this.win.project);
638                 } else {
639                     this.vala_projectsettings.el.show_all();
640                     this.vala_projectsettings.show((Project.Gtk)this.win.project);
641                 }
642
643                 this.win.rooview.el.set_pivot_point(1.0f,1.0f); // bottom right..
644                 
645                 this.win.projecteditview.el.set_scale(1.0f,1.0f);
646                 
647                
648                 break;
649                 
650            case State.FILES:  // can only get here from PREVIEW state.. in theory..
651                 
652    
653                 this.win.editpane.el.hide(); // holder for tree and properties..
654              
655                 this.left_projects.el.show(); 
656             
657                  this.win.rooview.el.set_easing_duration(1000);
658                 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
659                 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 180.0f);
660                 this.win.rooview.el.set_opacity(0);
661                 //el.set_scale(0.0f,0.0f);
662
663  
664                 if (this.win.project != null) {
665                     this.left_projects.selectProject(this.win.project);
666                 }
667              
668                 
669                 this.clutterfiles.el.show_all();
670                  
671                 this.clutterfiles.el.set_easing_duration(1000);
672                 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
673                 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
674                 this.clutterfiles.el.set_opacity(0xff);
675                 
676                 
677                 
678                 break;
679
680
681         }
682         this.resizeCanvasElements();
683         this.easingRestoreAll();
684         
685             
686     }
687     
688     public int redraw_count = 0;
689     public void resizeCanvas() // called by window resize .. delays redraw
690     {
691         var rc = this.redraw_count;        
692         this.redraw_count = 2;
693         if (rc == 0) {
694             GLib.Timeout.add(100,  ()  =>{
695                  return this.resizeCanvasQueue();
696             });
697         }
698     }
699     public bool  resizeCanvasQueue()
700     {
701         //print("WindowState.resizeCanvasQueue %d\n", this.redraw_count);        
702
703         if (this.redraw_count < 1) {
704             return false; // should not really happen...
705         }
706
707
708         this.redraw_count--;
709
710         if (this.redraw_count > 0) {
711             return true; // do it again in 1 second...
712         }
713         // got down to 0 or -1....
714         this.redraw_count = 0;
715         this.resizeCanvasElements();
716         return false;
717
718     }
719     public void resizeCanvasElements()
720     {
721         Gtk.Allocation alloc;
722         this.win.clutterembed.el.get_allocation(out alloc);
723
724            // print("WindowState.resizeCanvasElements\n");
725             if (!this.children_loaded || this.win.clutterembed == null) {
726                 print("WindowState.resizeCanvasElements = ingnore not loaded or no clutterfiles\n");
727             return; 
728         }
729             
730         var avail = alloc.width < 50.0f ? 0 :  alloc.width - 50.0f;
731         var palsize = avail < 300.0f ? avail : 300.0f;
732            
733  
734         // -------- code edit min 600
735         
736         var codesize = avail < 800.0f ? avail : 800.0f;
737         
738         
739         //print("set code size %f\n", codesize);
740
741             
742         
743         switch ( this.state) {
744             case State.PREVIEW:
745                 this.win.rooview.el.set_size(alloc.width-50, alloc.height);
746                 break;
747     
748             case State.FILES: 
749                 this.clutterfiles.set_size(alloc.width-50, alloc.height);
750                 break;
751
752             case State.PROJECT:
753              
754                 this.win.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
755                 
756                // this.win.rooview.el.save_easing_state();
757                 //this.win.rooview.el.set_size(alloc.width / 2.0f, alloc.height / 2.0f);
758                 this.win.rooview.el.set_scale(0.5f, 0.5f);
759                 //this.win.rooview.el.restore_easing_state();
760                 break;
761
762             case State.CODE: 
763                 this.win.codeeditview.el.set_size(codesize, alloc.height);
764                 var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
765                     //this.win.rooview.el.save_easing_state();
766                  
767                 this.win.rooview.el.set_scale(scale,scale);
768                // this.win.rooview.el.restore_easing_state();
769                 break;
770                 
771             case State.PROP:
772             case State.LISTENER:
773                  this.win.addpropsview.el.set_size(palsize, alloc.height);
774                 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
775                 this.win.rooview.el.set_scale(scale,scale);
776                 break;
777                 
778             case State.OBJECT:  
779                 this.win.objectview.el.set_size(palsize, alloc.height);    
780                 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
781                 //this.win.rooview.el.save_easing_state();
782                 this.win.rooview.el.set_scale(scale,scale);
783                // this.win.rooview.el.restore_easing_state();
784                 break;
785         }
786     }
787
788     // -- buttons show hide.....
789
790     public void buttonsShowHide()
791     {
792         // basically hide everything, then show the relivant..
793
794          this.win.backbutton.el.hide();
795     
796         this.win.projectbutton.el.hide(); // show file nav...
797         this.win.editfilebutton.el.hide();
798         this.win.projecteditbutton.el.hide();
799          
800         
801         this.win.objectshowbutton.el.hide(); // add objects
802         this.win.addpropbutton.el.hide();  
803         this.win.addlistenerbutton.el.hide(); 
804
805     
806     
807         this.win.addprojectbutton.el.hide();
808         this.win.addfilebutton.el.hide();
809         this.win.delprojectbutton.el.hide();
810         this.win.new_window.el.hide();
811
812         
813         switch (this.state) {
814             
815             case State.PREVIEW:  // this is the default state when working...
816                
817                 this.win.projectbutton.el.show(); // show file nav...
818                 this.win.editfilebutton.el.show();
819                 this.win.projecteditbutton.el.show();
820                  
821                 
822                 this.win.objectshowbutton.el.show(); // add objects
823                 this.win.addpropbutton.el.show();  
824                 this.win.addlistenerbutton.el.show(); 
825                 break;
826             
827            
828             case State.CODE: 
829             case State.PROP:
830             case State.LISTENER:
831             case State.OBJECT:
832                 
833                 this.win.backbutton.el.show();
834                 this.win.objectshowbutton.el.show(); // add objects
835                 this.win.addpropbutton.el.show();  
836                 this.win.addlistenerbutton.el.show(); 
837                 break;
838             
839             case State.PROJECT: 
840                 // anything else?
841                 this.win.backbutton.el.show();
842                 break;
843             
844     
845             case State.FILES:
846                 this.win.backbutton.el.show();
847                      
848                 this.win.addprojectbutton.el.show();
849                 this.win.addfilebutton.el.show();
850                 this.win.delprojectbutton.el.show();
851                 this.win.new_window.el.show();
852                 break;
853         }
854
855     }
856
857     
858 }
859
860