Sample/Window.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 29 Oct 2010 08:52:38 +0000 (16:52 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 29 Oct 2010 08:52:38 +0000 (16:52 +0800)
Sample/Window.js

index e3a8dd0..5cb406e 100644 (file)
@@ -25,7 +25,7 @@ Window=new XObject({
                this.get('/MidPropTree').hideWin();
             this.get('/RightPalete').hide();
             this.get('/BottomPane').el.hide();
-            this.get('/Editor').el.show_all();
+            //this.get('/Editor').el.show_all();
         
         }
     },
@@ -2308,8 +2308,8 @@ Window=new XObject({
                                                                         var _this = this;    
                                                                         // end editing..
                                                                         this.get('/BottomPane').el.hide();
-                                                                        this.get('/RightEditor').el.hide();
-                                                                        
+                                                                        //this.get('/RightEditor').el.hide();
+                                                                         this.get('/Editor').el.hide();
                                                                         
                                                                         if (showEditor) {
                                                                     
@@ -2323,12 +2323,12 @@ Window=new XObject({
                                                                                 //e.editing_done();
                                                                                 //e.remove_widget();
                                                                                 _this.activePath = path ;
-                                                                                
+                                                                                 this.get('/Editor').el.show_all();
                                                                                 return false;
                                                                             });
                                                                             return;
                                                                         }
-                                                                        
+                                                                          
                                                                         
                                                                         
                                                                     
@@ -3725,89 +3725,6 @@ Window=new XObject({
                                                        this.el.set_tab_label(this.items[2].el, new Gtk.Label({ label : "Inspector" }));
                                             },
                                             items : [
-                                                {
-                                                    xtype: Gtk.ScrolledWindow,
-                                                    pack : "add",
-                                                    id : "RightEditor",
-                                                    items : [
-                                                        {
-                                                            xtype: GtkSource.View,
-                                                            pack : "add",
-                                                            id : "view",
-                                                            init : function() {
-                                                                XObject.prototype.init.call(this);
-                                                                 var description = Pango.Font.description_from_string("monospace")
-                                                                description.set_size(8000);
-                                                                this.el.modify_font(description);
-                                                            
-                                                            },
-                                                            load : function(str) {
-                                                            
-                                                            // show the help page for the active node..
-                                                               this.get('/Help').show();
-                                                            
-                                                            
-                                                               this.get('/BottomPane').el.set_current_page(0);
-                                                                this.el.get_buffer().set_text(str, str.length);
-                                                                var lm = GtkSource.LanguageManager.get_default();
-                                                                
-                                                                this.el.get_buffer().set_language(lm.get_language('js'));
-                                                                var buf = this.el.get_buffer();
-                                                                var cursor = buf.get_mark("insert");
-                                                                var iter= new Gtk.TextIter;
-                                                                buf.get_iter_at_mark(iter, cursor);
-                                                                iter.set_line(1);
-                                                                iter.set_line_offset(4);
-                                                                buf.move_mark(cursor, iter);
-                                                                
-                                                                
-                                                                cursor = buf.get_mark("selection_bound");
-                                                                iter= new Gtk.TextIter;
-                                                                buf.get_iter_at_mark(iter, cursor);
-                                                                iter.set_line(1);
-                                                                iter.set_line_offset(4);
-                                                                buf.move_mark(cursor, iter);
-                                                                 
-                                                                this.el.grab_focus();
-                                                            },
-                                                            insert_spaces_instead_of_tabs : true,
-                                                            indent_width : 4,
-                                                            auto_indent : true,
-                                                            show_line_numbers : true,
-                                                            items : [
-                                                                {
-                                                                    xtype: GtkSource.Buffer,
-                                                                    listeners : {
-                                                                        changed : function (self) {
-                                                                            var s = new Gtk.TextIter();
-                                                                            var e = new Gtk.TextIter();
-                                                                            this.el.get_start_iter(s);
-                                                                            this.el.get_end_iter(e);
-                                                                            var str = this.el.get_text(s,e,true);
-                                                                            try {
-                                                                                Seed.check_syntax('var e = ' + str);
-                                                                            } catch (e) {
-                                                                                this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
-                                                                                    red: 0xFFFF, green: 0xCCCC , blue : 0xCCCC
-                                                                                   }));
-                                                                                //print("SYNTAX ERROR IN EDITOR");   
-                                                                                //print(e);
-                                                                                //console.dump(e);
-                                                                                return;
-                                                                            }
-                                                                            this.get('/RightEditor.view').el.modify_base(Gtk.StateType.NORMAL, new Gdk.Color({
-                                                                                    red: 0xFFFF, green: 0xFFFF , blue : 0xFFFF
-                                                                                   }));
-                                                                            
-                                                                             this.get('/LeftPanel.model').changed(  str , false);
-                                                                        }
-                                                                    },
-                                                                    pack : "set_buffer"
-                                                                }
-                                                            ]
-                                                        }
-                                                    ]
-                                                },
                                                 {
                                                     xtype: Gtk.ScrolledWindow,
                                                     pack : "add",