src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 17 Mar 2015 14:03:34 +0000 (22:03 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 17 Mar 2015 14:03:34 +0000 (22:03 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index 9090f37..98e9387 100644 (file)
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "go-previous",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "$ tooltop_text" : "\"Open File\"",
                    "items" : [
                     {
-                     "utf8 icon_name" : "document-open",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "document-open",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "document-properties",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "emblem-system",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "list-add",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "list-add",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "format-justify-left",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "appointment-new",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "folder-new",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "document-new",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "document-new",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "user-trash",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                    "width_request" : 50,
                    "$ xns" : "Gtk",
                    "height_request" : 50,
+                   "items" : [
+                    {
+                     "utf8 icon_name" : "window-new",
+                     "* pack" : "set_image",
+                     "xtype" : "Image",
+                     "$ xns" : "Gtk"
+                    }
+                   ]
+                  }
+                 ]
+                }
+               ]
+              },
+              {
+               "id" : "new_window",
+               "* init" : "this.el.set_size(50,50);",
+               "xtype" : "Actor",
+               "* pack" : "add_child",
+               "$ xns" : "Clutter",
+               "items" : [
+                {
+                 "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
+                 "* pack" : "add_child",
+                 "xtype" : "Actor",
+                 "$ xns" : "GtkClutter",
+                 "items" : [
+                  {
+                   "listeners" : {
+                    "clicked" : "  ( ) => {\n        Xcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}"
+                   },
+                   "utf8 tooltip_text" : "Open New Window",
+                   "* pack" : false,
+                   "xtype" : "Button",
+                   "width_request" : 50,
+                   "$ xns" : "Gtk",
+                   "height_request" : 50,
                    "items" : [
                     {
                      "xtype" : "Image",
       },
       {
        "id" : "statusbar",
-       "* init" : "{\n     Resources.singleton().updateProgress.connect((pos) => {\n        if (pos < 1) {\n            this.el.hide();\n            return;\n        }\n        this.el.show();\n        var cid = this.el.get_context_id(\"resources\");\n        this.el.remove_all(cid);\n        this.el.push(cid,\"Fetching Resource : %s/6\".printf(pos.to_string()));\n     });\n}\n",
+       "* init" : "{\n     Resources.singleton().updateProgress.connect((pos) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n           \n        this.el.show();\n        var cid = this.el.get_context_id(\"resources\");\n        this.el.remove_all(cid);\n        this.el.push(cid,\"Fetching Resource : %s/7\".printf(pos.to_string()));\n     });\n}\n",
        "xtype" : "Statusbar",
        "* pack" : "pack_end,false,true,0",
        "$ xns" : "Gtk"
index 6b2fc20..ff5acf3 100644 (file)
@@ -36,6 +36,7 @@ public class Xcls_MainWindow : Object
     public Xcls_addfilebutton addfilebutton;
     public Xcls_delprojectbutton delprojectbutton;
     public Xcls_new_window new_window;
+    public Xcls_new_window new_window;
     public Xcls_statusbar statusbar;
 
         // my vars (def)
@@ -624,6 +625,9 @@ public class Xcls_MainWindow : Object
             var child_11 = new Xcls_new_window( _this );
             child_11.ref();
             this.el.add_child (  child_11.el  );
+            var child_12 = new Xcls_new_window( _this );
+            child_12.ref();
+            this.el.add_child (  child_12.el  );
 
             // init method 
 
@@ -1981,6 +1985,122 @@ public class Xcls_MainWindow : Object
 
         // user defined functions 
     }
+    public class Xcls_new_window : Object 
+    {
+        public Clutter.Actor el;
+        private Xcls_MainWindow  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_new_window(Xcls_MainWindow _owner )
+        {
+            _this = _owner;
+            _this.new_window = this;
+            this.el = new Clutter.Actor();
+
+            // my vars (dec)
+
+            // set gobject values
+            var child_0 = new Xcls_Actor62( _this );
+            child_0.ref();
+            this.el.add_child (  child_0.el  );
+
+            // init method 
+
+            this.el.set_size(50,50);
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_Actor62 : Object 
+    {
+        public GtkClutter.Actor el;
+        private Xcls_MainWindow  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_Actor62(Xcls_MainWindow _owner )
+        {
+            _this = _owner;
+            this.el = new GtkClutter.Actor();
+
+            // my vars (dec)
+
+            // set gobject values
+            var child_0 = new Xcls_Button63( _this );
+            child_0.ref();
+
+            // init method 
+
+            ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_Button63 : Object 
+    {
+        public Gtk.Button el;
+        private Xcls_MainWindow  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_Button63(Xcls_MainWindow _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.Button();
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.width_request = 50;
+            this.el.height_request = 50;
+            this.el.tooltip_text = "Open New Window";
+            var child_0 = new Xcls_Image64( _this );
+            child_0.ref();
+            this.el.set_image (  child_0.el  );
+
+            // listeners 
+            this.el.clicked.connect( ( ) => {
+                    Xcls_MainWindow.singleton().no_windows++;
+                    var w = new Xcls_MainWindow();
+                    w.ref();
+            
+                    w.el.show_all();
+                    w.initChildren();
+                    w.windowstate.switchState(WindowState.State.FILES);
+            });
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_Image64 : Object 
+    {
+        public Gtk.Image el;
+        private Xcls_MainWindow  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_Image64(Xcls_MainWindow _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.Image();
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.icon_name = "window-new";
+        }
+
+        // user defined functions 
+    }
     public class Xcls_statusbar : Object 
     {
         public Gtk.Statusbar el;
@@ -2006,12 +2126,16 @@ public class Xcls_MainWindow : Object
                  Resources.singleton().updateProgress.connect((pos) => {
                     if (pos < 1) {
                         this.el.hide();
+                        _this.mainpane.el.set_sensitive(true);
+                        
                         return;
                     }
+                     _this.mainpane.el.set_sensitive(false);
+                       
                     this.el.show();
                     var cid = this.el.get_context_id("resources");
                     this.el.remove_all(cid);
-                    this.el.push(cid,"Fetching Resource : %s/6".printf(pos.to_string()));
+                    this.el.push(cid,"Fetching Resource : %s/7".printf(pos.to_string()));
                  });
             }
         }