File.js
[app.Builder.js] / Sample / Window.js
index c2a7950..6622391 100644 (file)
@@ -265,7 +265,7 @@ Window=new XObject({
                                                         html = html.replace('</head>', project.runhtml + '</head>');
                                                         
                                                        
-                                                        var     jsstr = JSON.stringify(js[0], null, 4);
+                                                        var     jsstr = JSON.(js[0], null, 4);
                                                        
                                                         var runbuilder = '<script type="text/javascript">' + "\n" + 
                                                             " Builder.render(" + jsstr + ");\n" +
@@ -1152,7 +1152,7 @@ Window=new XObject({
                                                                                             return;
                                                                                         }
                                                                                         print("LOAD");
-                                                                                        print(JSON.stringify(f.items, null,4));
+                                                                                        print(JSON.(f.items, null,4));
                                                                                         //console.dump(f.items);
                                                                                         this.load(f.items);
                                                                                         this.get('/LeftTree.view').el.expand_all();
@@ -1331,7 +1331,7 @@ Window=new XObject({
                                                                                     }
                                                                                     o[i] = c[i];
                                                                                 }
-                                                                                return JSON.stringify(o);
+                                                                                return JSON.(o);
                                                                             },
                                                                             singleNodeToJS : function (treepath) 
                                                                                     {
@@ -1382,7 +1382,7 @@ Window=new XObject({
                                                                                 
                                                                                 if (treepath === false) {
                                                                                     //dupe!!!
-                                                                                    return JSON.parse(JSON.stringify(ar));
+                                                                                    return JSON.parse(JSON.(ar));
                                                                                 }
                                                                                 
                                                                                 return ar;
@@ -1433,8 +1433,8 @@ Window=new XObject({
                                                                                      var el = tree.getActivePath();
                                                                                      print(el);
                                                                                      var js = model.toJS(el, false);
-                                                                                    // print(JSON.stringify(js[0], null,4));
-                                                                                     this.get('/DialogSaveTemplate').show(JSON.stringify(js[0], null,4));
+                                                                                    // print(JSON.(js[0], null,4));
+                                                                                     this.get('/DialogSaveTemplate').show(JSON.(js[0], null,4));
                                                                                      
                                                                                     
                                                                                 }
@@ -1468,11 +1468,14 @@ Window=new XObject({
                                                                     items : [
                                                                         {
                                                                             xtype: Gtk.ComboBox,
-                                                                            id : "combo",
-                                                                            init : function() {
-                                                                                XObject.prototype.init.call(this);
-                                                                                this.el.add_attribute(this.get('render').el , 'markup', 1 );  
+                                                                            listeners : {
+                                                                                changed : function (self) {
+                                                                                       var fn = this.getValue();
+                                                                                       var pm  = imports.Builder.Provider.ProjectManager.ProjectManager;
+                                                                                       this.get('/LeftProjectTree.model').loadProject(pm.getByFn(fn))
+                                                                                }
                                                                             },
+                                                                            id : "combo",
                                                                             getValue : function() {
                                                                                 var ix = this.el.get_active();
                                                                                 if (ix < 0 ) {
@@ -1484,6 +1487,10 @@ Window=new XObject({
                                                                                 }
                                                                                 return data[ix].fn;
                                                                             },
+                                                                            init : function() {
+                                                                                XObject.prototype.init.call(this);
+                                                                                this.el.add_attribute(this.get('render').el , 'markup', 1 );  
+                                                                            },
                                                                             setValue : function(fn)
                                                                             {
                                                                                 var el = this.el;
@@ -1496,13 +1503,6 @@ Window=new XObject({
                                                                                     }
                                                                                 });
                                                                             },
-                                                                            listeners : {
-                                                                                changed : function (self) {
-                                                                                       var fn = this.getValue();
-                                                                                       var pm  = imports.Builder.Provider.ProjectManager.ProjectManager;
-                                                                                       this.get('/LeftProjectTree.model').loadProject(pm.getByFn(fn))
-                                                                                }
-                                                                            },
                                                                             items : [
                                                                                 {
                                                                                     xtype: Gtk.CellRendererText,
@@ -1511,6 +1511,7 @@ Window=new XObject({
                                                                                 },
                                                                                 {
                                                                                     xtype: Gtk.ListStore,
+                                                                                    id : "combomodel",
                                                                                     pack : "set_model",
                                                                                     init : function() {
                                                                                         XObject.prototype.init.call(this);
@@ -1520,6 +1521,7 @@ Window=new XObject({
                                                                                             
                                                                                             
                                                                                         ] );
+                                                                                       // this.el.set_sort_column_id(1,Gtk.SortType.ASCENDING);
                                                                                        var pm = imports.Builder.Provider.ProjectManager.ProjectManager;
                                                                                        var _this = this;
                                                                                        pm.on('changed', function() {
@@ -1544,8 +1546,7 @@ Window=new XObject({
                                                                                         });
                                                                                         
                                                                                         this.get('/LeftProjectTree.combo').setValue(ov);
-                                                                                    },
-                                                                                    id : "combomodel"
+                                                                                    }
                                                                                 }
                                                                             ]
                                                                         }
@@ -2417,7 +2418,7 @@ Window=new XObject({
                                                                         }
                                                                         
                                                                         
-                                                                        //print(JSON.stringify(ar));
+                                                                        //print(JSON.(ar));
                                                                         return ar;
                                                                         // convert the l
                                                                     },
@@ -2722,7 +2723,7 @@ Window=new XObject({
                                                                   //  console.log( '<b>' + p.name +'</b> ['+p.type+']');
                                                                         //GObject.TYPE_STRING,  // real key
                                                                         // GObject.TYPE_STRING, // real type
-                                                                        // GObject.TYPE_STRING, // docs ?
+                                                                        // GObject.TYPE_STRING, // docs ?this.el.set_value(iter, 0, p.name);et_value(iter, 0, p.name);
                                                                         // GObject.TYPE_STRING // func def?
                                                                         
                                                                     
@@ -2739,6 +2740,7 @@ Window=new XObject({
                                                 },
                                                 {
                                                     xtype: Gtk.TreeViewColumn,
+                                                    pack : false,
                                                     init : function() {
                                                         this.el = new Gtk.TreeViewColumn();
                                                         this.parent.el.append_column(this.el);
@@ -2746,7 +2748,6 @@ Window=new XObject({
                                                         XObject.prototype.init.call(this);
                                                         this.el.add_attribute(this.items[0].el , 'markup', 4  );
                                                     },
-                                                    pack : false,
                                                     items : [
                                                         {
                                                             xtype: Gtk.CellRendererText,
@@ -3182,14 +3183,14 @@ Window=new XObject({
                                                                                         
                                                                                         
                                                                                         this.renderedData = data;
-                                                                                        var str = JSON.stringify(data) ;
+                                                                                        var str = JSON.(data) ;
                                                                                         
                                                                                         if (!this.ready) {
                                                                                             console.log('not loaded yet');
                                                                                         }
                                                                                         this.lastRedraw = new Date();
                                                                                     
-                                                                                        this.el.execute_script("Builder.render(" + JSON.stringify(data) + ");");
+                                                                                        this.el.execute_script("Builder.render(" + JSON.(data) + ");");
                                                                                          print( "before render" +    this.lastRedraw);
                                                                                         print( "after render" +    (new Date()));
                                                                                         
@@ -3306,11 +3307,13 @@ Window=new XObject({
                                                                     {
                                                                     
                                                                         // does something similar to xobject..
-                                                                        item.pack = (typeof(item.pack) == 'undefined') ?  'add' : item.pack;
+                                                                        //item.pack = (typeof(item.pack) == 'undefined') ?  'add' : item.pack;
                                                                         
+                                                                        // pack is forced to 'false'
                                                                         if (item.pack===false || item.pack === 'false') {  // no ;
                                                                             return;
                                                                         }
+                                                                        
                                                                         print("CREATE: " + item['|xns'] + '.' + item['xtype']);
                                                                         
                                                                         
@@ -3372,6 +3375,7 @@ Window=new XObject({
                                                                         var pack_m  = false;
                                                                         if (!item.pack && altctr) {
                                                                             // try XObject.
+                                                                            print("SETTING PACK TO XObjectBase method");
                                                                             pack_m = altctr.prototype.pack;
                                                                             
                                                                             
@@ -3387,6 +3391,7 @@ Window=new XObject({
                                                                         
                                                                         var args = [];
                                                                         if (!pack_m) {
+                                                                            item.pack = (typeof(item.pack) == 'undefined') ?  'add' : item.pack;
                                                                             if (typeof(item.pack) == 'string') {
                                                                                  
                                                                                 item.pack.split(',').forEach(function(e, i) {