src/Builder4/PopoverFiles.bjs
authorAlan <alan@roojs.com>
Fri, 20 May 2022 06:12:52 +0000 (14:12 +0800)
committerAlan <alan@roojs.com>
Fri, 20 May 2022 06:12:52 +0000 (14:12 +0800)
src/Builder4/PopoverFiles.vala

src/Builder4/PopoverFiles.bjs
src/Builder4/PopoverFiles.vala

index bf75759..972262b 100644 (file)
           }
          ],
          "xtype" : "Toolbar"
-        },
+        }
+       ],
+       "xtype" : "Box"
+      }
+     ],
+     "xtype" : "Box"
+    },
+    {
+     "$ xns" : "Gtk",
+     "* pack" : "add",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+     "bool homogeneous" : false,
+     "items" : [
+      {
+       "$ shadow_type" : "Gtk.ShadowType.IN",
+       "$ xns" : "Gtk",
+       "* init" : [
+        "  this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+        " "
+       ],
+       "* pack" : "add",
+       "bool expand" : true,
+       "items" : [
         {
-         "$ shadow_type" : "Gtk.ShadowType.IN",
+         "$ enable_tree_lines" : true,
+         "$ headers_visible" : true,
          "$ xns" : "Gtk",
          "* init" : [
-          "  this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+          "  var description = new Pango.FontDescription();",
+          "     description.set_size(8000);",
+          "    this.el.override_font(description);     ",
+          "                    ",
+          "    var selection = this.el.get_selection();",
+          "    selection.set_mode( Gtk.SelectionMode.SINGLE);",
+          " ",
+          "",
+          "    ",
+          "   ",
           " "
          ],
          "* pack" : "add",
-         "bool expand" : true,
+         "id" : "view",
          "items" : [
           {
-           "$ enable_tree_lines" : true,
-           "$ headers_visible" : true,
+           "$ columns" : "typeof(string), typeof(Object)",
            "$ xns" : "Gtk",
            "* init" : [
-            "  var description = new Pango.FontDescription();",
-            "     description.set_size(8000);",
-            "    this.el.override_font(description);     ",
-            "                    ",
-            "    var selection = this.el.get_selection();",
-            "    selection.set_mode( Gtk.SelectionMode.SINGLE);",
-            " ",
+            "{",
+            "   this.el.set_sort_func(0, (mod,a,b) => {",
+            "       GLib.Value ga, gb;",
+            "       mod.get_value(a,0, out ga);",
+            "       mod.get_value(b,0, out gb);",
+            "        ",
+            "        if ((string)ga == (string)gb) {",
+            "            return 0;",
+            "        }",
+            "        return (string)ga > (string)gb ? 1 : -1;",
+            "   }); ",
             "",
-            "    ",
-            "   ",
+            "",
+            "}",
+            ""
+           ],
+           "* pack" : "set_model",
+           "id" : "model",
+           "n_columns" : 2,
+           "xtype" : "ListStore"
+          },
+          {
+           "$ xns" : "Gtk",
+           "* init" : [
+            "",
+            "    this.el.add_attribute(_this.namecol.el , \"markup\", 0  );",
             " "
            ],
-           "* pack" : "add",
-           "id" : "view",
+           "* pack" : "append_column",
            "items" : [
             {
-             "$ columns" : "typeof(string), typeof(Object)",
              "$ xns" : "Gtk",
-             "* init" : [
-              "{",
-              "   this.el.set_sort_func(0, (mod,a,b) => {",
-              "       GLib.Value ga, gb;",
-              "       mod.get_value(a,0, out ga);",
-              "       mod.get_value(b,0, out gb);",
-              "        ",
-              "        if ((string)ga == (string)gb) {",
-              "            return 0;",
-              "        }",
-              "        return (string)ga > (string)gb ? 1 : -1;",
-              "   }); ",
-              "",
-              "",
-              "}",
-              ""
-             ],
-             "* pack" : "set_model",
-             "id" : "model",
-             "n_columns" : 2,
-             "xtype" : "ListStore"
-            },
-            {
-             "$ xns" : "Gtk",
-             "* init" : [
-              "",
-              "    this.el.add_attribute(_this.namecol.el , \"markup\", 0  );",
-              " "
-             ],
-             "* pack" : "append_column",
-             "items" : [
-              {
-               "$ xns" : "Gtk",
-               "* pack" : "pack_start,true",
-               "id" : "namecol",
-               "xtype" : "CellRendererText"
-              }
-             ],
-             "utf8 title" : "Projects",
-             "xtype" : "TreeViewColumn"
+             "* pack" : "pack_start,true",
+             "id" : "namecol",
+             "xtype" : "CellRendererText"
             }
            ],
-           "listeners" : {
-            "cursor_changed" : [
-             " () => {",
-             "    if (_this.is_loading) {",
-             "        return;",
-             "    }",
-             "    ",
-             "    Gtk.TreeIter iter;",
-             "    Gtk.TreeModel mod;",
-             "            ",
-             "    var s = this.el.get_selection();",
-             "    if (!s.get_selected(out mod, out iter)) {",
-             "        return;",
-             "    }",
-             "    ",
-             "    GLib.Value gval;",
-             "",
-             "    mod.get_value(iter, 1 , out gval);",
-             "    var project = (Project.Project)gval.get_object();",
-             "    ",
-             "    _this.onProjectSelected(project);",
-             "    ",
-             "}  "
-            ]
-           },
-           "xtype" : "TreeView"
+           "utf8 title" : "Projects",
+           "xtype" : "TreeViewColumn"
           }
          ],
-         "xtype" : "ScrolledWindow"
+         "listeners" : {
+          "cursor_changed" : [
+           " () => {",
+           "    if (_this.is_loading) {",
+           "        return;",
+           "    }",
+           "    ",
+           "    Gtk.TreeIter iter;",
+           "    Gtk.TreeModel mod;",
+           "            ",
+           "    var s = this.el.get_selection();",
+           "    if (!s.get_selected(out mod, out iter)) {",
+           "        return;",
+           "    }",
+           "    ",
+           "    GLib.Value gval;",
+           "",
+           "    mod.get_value(iter, 1 , out gval);",
+           "    var project = (Project.Project)gval.get_object();",
+           "    ",
+           "    _this.onProjectSelected(project);",
+           "    ",
+           "}  "
+          ]
+         },
+         "xtype" : "TreeView"
         }
        ],
-       "xtype" : "Box"
-      }
-     ],
-     "xtype" : "Box"
-    },
-    {
-     "$ xns" : "Gtk",
-     "* pack" : "add",
-     "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-     "bool homogeneous" : false,
-     "items" : [
+       "xtype" : "ScrolledWindow"
+      },
       {
        "$ xns" : "Gtk",
        "* pack" : "add",
index 12edd84..fd5aa60 100644 (file)
@@ -49,7 +49,7 @@ public class Xcls_PopoverFiles : Object
         var child_0 = new Xcls_Box2( _this );
         child_0.ref();
         this.el.add (  child_0.el  );
-        var child_1 = new Xcls_Box11( _this );
+        var child_1 = new Xcls_Box6( _this );
         child_1.ref();
         this.el.add (  child_1.el  );
 
@@ -322,9 +322,6 @@ public class Xcls_PopoverFiles : Object
             var child_0 = new Xcls_Toolbar4( _this );
             child_0.ref();
             this.el.add (  child_0.el  );
-            var child_1 = new Xcls_ScrolledWindow6( _this );
-            child_1.ref();
-            this.el.add (  child_1.el  );
         }
 
         // user defined functions
@@ -403,7 +400,40 @@ public class Xcls_PopoverFiles : Object
     }
 
 
-    public class Xcls_ScrolledWindow6 : Object
+
+
+    public class Xcls_Box6 : Object
+    {
+        public Gtk.Box el;
+        private Xcls_PopoverFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_Box6(Xcls_PopoverFiles _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.homogeneous = false;
+            var child_0 = new Xcls_ScrolledWindow7( _this );
+            child_0.ref();
+            this.el.add (  child_0.el  );
+            var child_1 = new Xcls_Box12( _this );
+            child_1.ref();
+            this.el.add (  child_1.el  );
+            var child_2 = new Xcls_ScrolledWindow20( _this );
+            child_2.ref();
+            this.el.add (  child_2.el  );
+        }
+
+        // user defined functions
+    }
+    public class Xcls_ScrolledWindow7 : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_PopoverFiles  _this;
@@ -412,7 +442,7 @@ public class Xcls_PopoverFiles : Object
             // my vars (def)
 
         // ctor
-        public Xcls_ScrolledWindow6(Xcls_PopoverFiles _owner )
+        public Xcls_ScrolledWindow7(Xcls_PopoverFiles _owner )
         {
             _this = _owner;
             this.el = new Gtk.ScrolledWindow( null, null );
@@ -456,7 +486,7 @@ public class Xcls_PopoverFiles : Object
             var child_0 = new Xcls_model( _this );
             child_0.ref();
             this.el.set_model (  child_0.el  );
-            var child_1 = new Xcls_TreeViewColumn9( _this );
+            var child_1 = new Xcls_TreeViewColumn10( _this );
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
@@ -535,7 +565,7 @@ public class Xcls_PopoverFiles : Object
         // user defined functions
     }
 
-    public class Xcls_TreeViewColumn9 : Object
+    public class Xcls_TreeViewColumn10 : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_PopoverFiles  _this;
@@ -544,7 +574,7 @@ public class Xcls_PopoverFiles : Object
             // my vars (def)
 
         // ctor
-        public Xcls_TreeViewColumn9(Xcls_PopoverFiles _owner )
+        public Xcls_TreeViewColumn10(Xcls_PopoverFiles _owner )
         {
             _this = _owner;
             this.el = new Gtk.TreeViewColumn();
@@ -590,36 +620,6 @@ public class Xcls_PopoverFiles : Object
 
 
 
-
-
-    public class Xcls_Box11 : Object
-    {
-        public Gtk.Box el;
-        private Xcls_PopoverFiles  _this;
-
-
-            // my vars (def)
-
-        // ctor
-        public Xcls_Box11(Xcls_PopoverFiles _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.homogeneous = false;
-            var child_0 = new Xcls_Box12( _this );
-            child_0.ref();
-            this.el.add (  child_0.el  );
-            var child_1 = new Xcls_ScrolledWindow20( _this );
-            child_1.ref();
-            this.el.add (  child_1.el  );
-        }
-
-        // user defined functions
-    }
     public class Xcls_Box12 : Object
     {
         public Gtk.Box el;