src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 18 May 2015 10:13:57 +0000 (18:13 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 18 May 2015 10:13:57 +0000 (18:13 +0800)
src/Builder4/MainWindow.vala

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

index b7dd1e5..41f51e1 100644 (file)
    "items" : [
     {
      "id" : "headerbar",
-     "xtype" : "HeaderBar",
      "* pack" : "set_titlebar",
+     "xtype" : "HeaderBar",
      "bool show_close_button" : true,
      "$ xns" : "Gtk",
      "string title" : "Application Builder",
      "items" : [
       {
        "* pack" : "pack_start",
-       "xtype" : "Box",
+       "xtype" : "HBox",
        "$ xns" : "Gtk",
-       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
          "bool use_popover" : false,
-         "xtype" : "MenuButton",
          "* pack" : "add",
+         "xtype" : "MenuButton",
          "$ xns" : "Gtk",
          "items" : [
           {
@@ -60,9 +59,9 @@
              "listeners" : {
               "activate" : "  ( ) => {\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}"
              },
-             "* pack" : "append",
              "xtype" : "MenuItem",
              "string label" : "Open a new Window",
+             "* pack" : "append",
              "$ xns" : "Gtk"
             },
             {
              "listeners" : {
               "activate" : " ( ) => {\n         Resources.singleton().fetchStart();\n}"
              },
-             "string label" : "Download updated Resources",
              "* pack" : "append",
              "xtype" : "MenuItem",
+             "string label" : "Download updated Resources",
              "$ xns" : "Gtk"
             },
             {
              "listeners" : {
               "activate" : "() => {\n    About.singleton().el.show();\n    }"
              },
-             "xtype" : "MenuItem",
              "string label" : "About the Builder",
              "* pack" : "append",
+             "xtype" : "MenuItem",
              "$ xns" : "Gtk"
             }
            ]
           },
           {
-           "* pack" : "set_image",
            "xtype" : "Image",
            "utf8 icon_name" : "help-about",
+           "* pack" : "set_image",
            "$ xns" : "Gtk"
           }
          ]
     },
     {
      "id" : "vbox",
+     "xtype" : "VBox",
      "* pack" : "add",
-     "xtype" : "Box",
      "$ xns" : "Gtk",
-     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "$ homogeneous" : false,
      "items" : [
       {
        "items" : [
         {
          "id" : "leftpane",
-         "xtype" : "Box",
          "* pack" : "add1",
+         "xtype" : "VBox",
          "$ xns" : "Gtk",
-         "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
          "items" : [
           {
            "id" : "editpane",
-           "xtype" : "VPaned",
            "* pack" : "pack_start,false,true,0",
+           "xtype" : "VPaned",
            "$ xns" : "Gtk",
            "items" : [
             {
              "id" : "tree",
-             "xtype" : "Box",
              "* pack" : "add1",
-             "$ xns" : "Gtk",
-             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
+             "xtype" : "VBox",
+             "$ xns" : "Gtk"
             },
             {
              "id" : "props",
-             "xtype" : "Box",
              "* pack" : "add2",
-             "$ xns" : "Gtk",
-             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
+             "xtype" : "VBox",
+             "$ xns" : "Gtk"
             }
            ]
           }
         },
         {
          "* pack" : "add2",
-         "xtype" : "Box",
+         "xtype" : "VBox",
          "$ xns" : "Gtk",
-         "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
          "items" : [
           {
            "listeners" : {
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
                  "* pack" : "add_child",
+                 "xtype" : "Actor",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                     "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
                    },
                    "utf8 tooltip_text" : "Back",
-                   "* pack" : false,
                    "xtype" : "Button",
+                   "* pack" : false,
                    "width_request" : 50,
                    "$ xns" : "Gtk",
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "go-previous",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "go-previous",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "$ tooltop_text" : "\"Open File\"",
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "document-open",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "document-properties",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "emblem-system",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "emblem-system",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "list-add",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "format-justify-left",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "appointment-new",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "appointment-new",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "folder-new",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "document-new",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "user-trash",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
       },
       {
        "bool homogeneous" : false,
-       "xtype" : "HBox",
        "* pack" : "pack_end,false,true,0",
+       "xtype" : "HBox",
        "$ xns" : "Gtk",
        "items" : [
         {
-         "xtype" : "Label",
          "string label" : "   ",
          "* pack" : "pack_start,true,true,0",
+         "xtype" : "Label",
          "$ xns" : "Gtk"
         },
         {
          "bool show_text" : true,
-         "id" : "statusbar",
          "ulong handler_id" : "-1",
+         "id" : "statusbar",
          "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {\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         this.el.show();\n         this.el.set_fraction ((1.0f * pos) / (1.0f * total));\n         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));\n       \n     });\n}\n",
          "xtype" : "ProgressBar",
          "* pack" : "pack_start,true,true,0",
          "$ xns" : "Gtk",
          "items" : [
           {
-           "string label" : "Compile Status:",
            "* pack" : "add",
            "xtype" : "MenuItem",
+           "string label" : "Compile Status:",
            "$ xns" : "Gtk"
           },
           {
            "$ xns" : "Gtk",
            "items" : [
             {
-             "utf8 icon_name" : "dialog-error",
              "* pack" : "set_image",
              "xtype" : "Image",
+             "utf8 icon_name" : "dialog-error",
              "$ xns" : "Gtk"
             }
            ]
            "$ xns" : "Gtk",
            "items" : [
             {
-             "xtype" : "Image",
              "utf8 icon_name" : "dialog-warning",
              "* pack" : "set_image",
+             "xtype" : "Image",
              "$ xns" : "Gtk"
             }
            ]
            "$ xns" : "Gtk",
            "items" : [
             {
-             "* pack" : "set_image",
              "xtype" : "Image",
              "utf8 icon_name" : "dialog-information",
+             "* pack" : "set_image",
              "$ xns" : "Gtk"
             }
            ]
index 3e887e2..b9abb1e 100644 (file)
@@ -150,26 +150,26 @@ public class Xcls_MainWindow : Object
             // set gobject values
             this.el.title = "Application Builder";
             this.el.show_close_button = true;
-            var child_0 = new Xcls_Box3( _this );
+            var child_0 = new Xcls_HBox3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el  );
         }
 
         // user defined functions 
     }
-    public class Xcls_Box3 : Object 
+    public class Xcls_HBox3 : Object 
     {
-        public Gtk.Box el;
+        public Gtk.HBox el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
         // ctor 
-        public Xcls_Box3(Xcls_MainWindow _owner )
+        public Xcls_HBox3(Xcls_MainWindow _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
+            this.el = new Gtk.HBox( true, 0 );
 
             // my vars (dec)
 
@@ -381,7 +381,7 @@ public class Xcls_MainWindow : Object
     }
     public class Xcls_vbox : Object 
     {
-        public Gtk.Box el;
+        public Gtk.VBox el;
         private Xcls_MainWindow  _this;
 
 
@@ -392,12 +392,11 @@ public class Xcls_MainWindow : Object
         {
             _this = _owner;
             _this.vbox = this;
-            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
+            this.el = new Gtk.VBox( false, 0 );
 
             // my vars (dec)
 
             // set gobject values
-            this.el.homogeneous = false;
             var child_0 = new Xcls_mainpane( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , true,true,0 );
@@ -432,7 +431,7 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_leftpane( _this );
             child_0.ref();
             this.el.add1 (  child_0.el  );
-            var child_1 = new Xcls_Box17( _this );
+            var child_1 = new Xcls_VBox17( _this );
             child_1.ref();
             this.el.add2 (  child_1.el  );
         }
@@ -441,7 +440,7 @@ public class Xcls_MainWindow : Object
     }
     public class Xcls_leftpane : Object 
     {
-        public Gtk.Box el;
+        public Gtk.VBox el;
         private Xcls_MainWindow  _this;
 
 
@@ -452,7 +451,7 @@ public class Xcls_MainWindow : Object
         {
             _this = _owner;
             _this.leftpane = this;
-            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
+            this.el = new Gtk.VBox( true, 0 );
 
             // my vars (dec)
 
@@ -494,7 +493,7 @@ public class Xcls_MainWindow : Object
     }
     public class Xcls_tree : Object 
     {
-        public Gtk.Box el;
+        public Gtk.VBox el;
         private Xcls_MainWindow  _this;
 
 
@@ -505,7 +504,7 @@ public class Xcls_MainWindow : Object
         {
             _this = _owner;
             _this.tree = this;
-            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
+            this.el = new Gtk.VBox( true, 0 );
 
             // my vars (dec)
 
@@ -516,7 +515,7 @@ public class Xcls_MainWindow : Object
     }
     public class Xcls_props : Object 
     {
-        public Gtk.Box el;
+        public Gtk.VBox el;
         private Xcls_MainWindow  _this;
 
 
@@ -527,7 +526,7 @@ public class Xcls_MainWindow : Object
         {
             _this = _owner;
             _this.props = this;
-            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
+            this.el = new Gtk.VBox( true, 0 );
 
             // my vars (dec)
 
@@ -536,19 +535,19 @@ public class Xcls_MainWindow : Object
 
         // user defined functions 
     }
-    public class Xcls_Box17 : Object 
+    public class Xcls_VBox17 : Object 
     {
-        public Gtk.Box el;
+        public Gtk.VBox el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
         // ctor 
-        public Xcls_Box17(Xcls_MainWindow _owner )
+        public Xcls_VBox17(Xcls_MainWindow _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
+            this.el = new Gtk.VBox( true, 0 );
 
             // my vars (dec)