src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 31 Jan 2024 09:43:08 +0000 (17:43 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 31 Jan 2024 09:43:08 +0000 (17:43 +0800)
src/Builder4/MainWindow.vala

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

index c509033..2d83abe 100644 (file)
                 }
                ],
                "xtype" : "SingleSelection"
+              },
+              {
+               "$ xns" : "Gtk",
+               "bool expand" : true,
+               "bool resizable" : true,
+               "id" : "projcol",
+               "items" : [
+                {
+                 "$ xns" : "Gtk",
+                 "* prop" : "factory",
+                 "listeners" : {
+                  "bind" : [
+                   "(listitem) => {",
+                   "\t var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
+                   "\t var item =  (listitem as Gtk.ListItem).get_item() as WindowState;",
+                   "\t ",
+                   "\t lb.label = item.project.name;",
+                   "",
+                   "",
+                   "  ",
+                   "",
+                   "}",
+                   ""
+                  ],
+                  "setup" : [
+                   "(listitem) => {",
+                   "\tvar lbl = new Gtk.Label(\"\");",
+                   " \t(listitem as Gtk.ListItem).set_child(lbl);",
+                   " \tlbl.justify = Gtk.Justification.LEFT;",
+                   " \tlbl.xalign = 1;",
+                   " \tlbl.use_markup = true;",
+                   "\tlbl.ellipsize = Pango.EllipsizeMode.START;",
+                   "  ",
+                   "\t(listitem as Gtk.ListItem).activatable = true;",
+                   "}",
+                   ""
+                  ]
+                 },
+                 "xtype" : "SignalListItemFactory"
+                }
+               ],
+               "title" : "Project",
+               "xtype" : "ColumnViewColumn"
               }
              ],
              "xtype" : "ColumnView"
index b509288..1cc1ef0 100644 (file)
@@ -39,6 +39,7 @@ public class Xcls_MainWindow : Object
        public Xcls_winfilter winfilter;
        public Xcls_windowsearch windowsearch;
        public Xcls_winmodel winmodel;
+       public Xcls_projcol projcol;
        public Xcls_histmodel histmodel;
        public Xcls_histsearch histsearch;
        public Xcls_projcol projcol;
@@ -1789,7 +1790,7 @@ public class Xcls_MainWindow : Object
                        this.el.vexpand = true;
                        var child_1 = new Xcls_ScrolledWindow48( _this );
                        this.el.start_child = child_1.el;
-                       var child_2 = new Xcls_ScrolledWindow59( _this );
+                       var child_2 = new Xcls_ScrolledWindow61( _this );
                        this.el.end_child = child_2.el;
                }
 
@@ -1837,6 +1838,8 @@ public class Xcls_MainWindow : Object
                        // my vars (dec)
 
                        // set gobject values
+                       new Xcls_projcol( _this );
+                       this.el.append_column( _this.projcol.el );
                }
 
                // user defined functions
@@ -2056,9 +2059,81 @@ public class Xcls_MainWindow : Object
 
 
 
+       public class Xcls_projcol : Object
+       {
+               public Gtk.ColumnViewColumn el;
+               private Xcls_MainWindow  _this;
+
+
+                       // my vars (def)
+
+               // ctor
+               public Xcls_projcol(Xcls_MainWindow _owner )
+               {
+                       _this = _owner;
+                       _this.projcol = this;
+                       var child_1 = new Xcls_SignalListItemFactory60( _this );
+                       child_1.ref();
+                       this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
+
+                       // my vars (dec)
+
+                       // set gobject values
+                       this.el.id = "projcol";
+                       this.el.expand = true;
+                       this.el.resizable = true;
+               }
+
+               // user defined functions
+       }
+       public class Xcls_SignalListItemFactory60 : Object
+       {
+               public Gtk.SignalListItemFactory el;
+               private Xcls_MainWindow  _this;
+
+
+                       // my vars (def)
+
+               // ctor
+               public Xcls_SignalListItemFactory60(Xcls_MainWindow _owner )
+               {
+                       _this = _owner;
+                       this.el = new Gtk.SignalListItemFactory();
+
+                       // my vars (dec)
+
+                       // set gobject values
+
+                       //listeners
+                       this.el.setup.connect( (listitem) => {
+                               var lbl = new Gtk.Label("");
+                               (listitem as Gtk.ListItem).set_child(lbl);
+                               lbl.justify = Gtk.Justification.LEFT;
+                               lbl.xalign = 1;
+                               lbl.use_markup = true;
+                               lbl.ellipsize = Pango.EllipsizeMode.START;
+                         
+                               (listitem as Gtk.ListItem).activatable = true;
+                       });
+                       this.el.bind.connect( (listitem) => {
+                                var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
+                                var item =  (listitem as Gtk.ListItem).get_item() as WindowState;
+                                
+                                lb.label = item.project.name;
+                       
+                       
+                         
+                       
+                       });
+               }
+
+               // user defined functions
+       }
+
+
 
 
-       public class Xcls_ScrolledWindow59 : Object
+       public class Xcls_ScrolledWindow61 : Object
        {
                public Gtk.ScrolledWindow el;
                private Xcls_MainWindow  _this;
@@ -2067,7 +2142,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_ScrolledWindow59(Xcls_MainWindow _owner )
+               public Xcls_ScrolledWindow61(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.ScrolledWindow();
@@ -2077,13 +2152,13 @@ public class Xcls_MainWindow : Object
                        // set gobject values
                        this.el.hexpand = true;
                        this.el.vexpand = true;
-                       var child_1 = new Xcls_ColumnView60( _this );
+                       var child_1 = new Xcls_ColumnView62( _this );
                        this.el.child = child_1.el;
                }
 
                // user defined functions
        }
-       public class Xcls_ColumnView60 : Object
+       public class Xcls_ColumnView62 : Object
        {
                public Gtk.ColumnView el;
                private Xcls_MainWindow  _this;
@@ -2092,10 +2167,10 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_ColumnView60(Xcls_MainWindow _owner )
+               public Xcls_ColumnView62(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_SingleSelection61( _this );
+                       var child_1 = new Xcls_SingleSelection63( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnView( child_1.el );
 
@@ -2112,7 +2187,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_SingleSelection61 : Object
+       public class Xcls_SingleSelection63 : Object
        {
                public Gtk.SingleSelection el;
                private Xcls_MainWindow  _this;
@@ -2121,10 +2196,10 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SingleSelection61(Xcls_MainWindow _owner )
+               public Xcls_SingleSelection63(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_SortListModel62( _this );
+                       var child_1 = new Xcls_SortListModel64( _this );
                        child_1.ref();
                        this.el = new Gtk.SingleSelection( child_1.el );
 
@@ -2137,7 +2212,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_SortListModel62 : Object
+       public class Xcls_SortListModel64 : Object
        {
                public Gtk.SortListModel el;
                private Xcls_MainWindow  _this;
@@ -2146,12 +2221,12 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SortListModel62(Xcls_MainWindow _owner )
+               public Xcls_SortListModel64(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_FilterListModel63( _this );
+                       var child_1 = new Xcls_FilterListModel65( _this );
                        child_1.ref();
-                       var child_2 = new Xcls_StringSorter67( _this );
+                       var child_2 = new Xcls_StringSorter69( _this );
                        child_2.ref();
                        this.el = new Gtk.SortListModel( child_1.el, child_2.el );
 
@@ -2162,7 +2237,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_FilterListModel63 : Object
+       public class Xcls_FilterListModel65 : Object
        {
                public Gtk.FilterListModel el;
                private Xcls_MainWindow  _this;
@@ -2171,7 +2246,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_FilterListModel63(Xcls_MainWindow _owner )
+               public Xcls_FilterListModel65(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        new Xcls_histmodel( _this );
@@ -2221,7 +2296,7 @@ public class Xcls_MainWindow : Object
                {
                        _this = _owner;
                        _this.histsearch = this;
-                       var child_1 = new Xcls_PropertyExpression66( _this );
+                       var child_1 = new Xcls_PropertyExpression68( _this );
                        child_1.ref();
                        this.el = new Gtk.StringFilter( child_1.el );
 
@@ -2232,7 +2307,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_PropertyExpression66 : Object
+       public class Xcls_PropertyExpression68 : Object
        {
                public Gtk.PropertyExpression el;
                private Xcls_MainWindow  _this;
@@ -2241,7 +2316,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_PropertyExpression66(Xcls_MainWindow _owner )
+               public Xcls_PropertyExpression68(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
@@ -2256,7 +2331,7 @@ public class Xcls_MainWindow : Object
 
 
 
-       public class Xcls_StringSorter67 : Object
+       public class Xcls_StringSorter69 : Object
        {
                public Gtk.StringSorter el;
                private Xcls_MainWindow  _this;
@@ -2265,10 +2340,10 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_StringSorter67(Xcls_MainWindow _owner )
+               public Xcls_StringSorter69(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_PropertyExpression68( _this );
+                       var child_1 = new Xcls_PropertyExpression70( _this );
                        child_1.ref();
                        this.el = new Gtk.StringSorter( child_1.el );
 
@@ -2280,7 +2355,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_PropertyExpression68 : Object
+       public class Xcls_PropertyExpression70 : Object
        {
                public Gtk.PropertyExpression el;
                private Xcls_MainWindow  _this;
@@ -2289,7 +2364,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_PropertyExpression68(Xcls_MainWindow _owner )
+               public Xcls_PropertyExpression70(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
@@ -2318,7 +2393,7 @@ public class Xcls_MainWindow : Object
                {
                        _this = _owner;
                        _this.projcol = this;
-                       var child_1 = new Xcls_SignalListItemFactory70( _this );
+                       var child_1 = new Xcls_SignalListItemFactory72( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
 
@@ -2332,7 +2407,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_SignalListItemFactory70 : Object
+       public class Xcls_SignalListItemFactory72 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_MainWindow  _this;
@@ -2341,7 +2416,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SignalListItemFactory70(Xcls_MainWindow _owner )
+               public Xcls_SignalListItemFactory72(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.SignalListItemFactory();
@@ -2390,7 +2465,7 @@ public class Xcls_MainWindow : Object
                {
                        _this = _owner;
                        _this.filecol = this;
-                       var child_1 = new Xcls_SignalListItemFactory72( _this );
+                       var child_1 = new Xcls_SignalListItemFactory74( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
 
@@ -2404,7 +2479,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_SignalListItemFactory72 : Object
+       public class Xcls_SignalListItemFactory74 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_MainWindow  _this;
@@ -2413,7 +2488,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SignalListItemFactory72(Xcls_MainWindow _owner )
+               public Xcls_SignalListItemFactory74(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.SignalListItemFactory();