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

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

index 2d83abe..f383a8f 100644 (file)
                ],
                "title" : "Project",
                "xtype" : "ColumnViewColumn"
+              },
+              {
+               "$ xns" : "Gtk",
+               "* pack" : "append_column",
+               "bool expand" : true,
+               "bool resizable" : true,
+               "id" : "filecol",
+               "items" : [
+                {
+                 "$ xns" : "Gtk",
+                 "* prop" : "factory",
+                 "listeners" : {
+                  "bind" : [
+                   "(listitem) => {",
+                   " var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();",
+                   " var item =  (listitem as Gtk.ListItem).get_item() as WindowState;",
+                   " ",
+                   " lb.label = item.file.relpath;",
+                   "",
+                   "",
+                   "  ",
+                   "",
+                   "}",
+                   ""
+                  ],
+                  "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" : "File",
+               "xtype" : "ColumnViewColumn"
               }
              ],
              "xtype" : "ColumnView"
                "$ xns" : "Gtk",
                "bool expand" : true,
                "bool resizable" : true,
-               "id" : "projcol",
                "items" : [
                 {
                  "$ xns" : "Gtk",
index 1cc1ef0..d56a2a4 100644 (file)
@@ -40,9 +40,9 @@ public class Xcls_MainWindow : Object
        public Xcls_windowsearch windowsearch;
        public Xcls_winmodel winmodel;
        public Xcls_projcol projcol;
+       public Xcls_filecol filecol;
        public Xcls_histmodel histmodel;
        public Xcls_histsearch histsearch;
-       public Xcls_projcol projcol;
        public Xcls_filecol filecol;
 
                // my vars (def)
@@ -1790,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_ScrolledWindow61( _this );
+                       var child_2 = new Xcls_ScrolledWindow63( _this );
                        this.el.end_child = child_2.el;
                }
 
@@ -1840,6 +1840,8 @@ public class Xcls_MainWindow : Object
                        // set gobject values
                        new Xcls_projcol( _this );
                        this.el.append_column( _this.projcol.el );
+                       new Xcls_filecol( _this );
+                       this.el.append_column ( _this.filecol.el  );
                }
 
                // user defined functions
@@ -2131,9 +2133,81 @@ public class Xcls_MainWindow : Object
        }
 
 
+       public class Xcls_filecol : Object
+       {
+               public Gtk.ColumnViewColumn el;
+               private Xcls_MainWindow  _this;
+
+
+                       // my vars (def)
+
+               // ctor
+               public Xcls_filecol(Xcls_MainWindow _owner )
+               {
+                       _this = _owner;
+                       _this.filecol = this;
+                       var child_1 = new Xcls_SignalListItemFactory62( _this );
+                       child_1.ref();
+                       this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
+
+                       // my vars (dec)
+
+                       // set gobject values
+                       this.el.id = "filecol";
+                       this.el.expand = true;
+                       this.el.resizable = true;
+               }
+
+               // user defined functions
+       }
+       public class Xcls_SignalListItemFactory62 : Object
+       {
+               public Gtk.SignalListItemFactory el;
+               private Xcls_MainWindow  _this;
+
+
+                       // my vars (def)
+
+               // ctor
+               public Xcls_SignalListItemFactory62(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.file.relpath;
+                       
+                       
+                         
+                       
+                       });
+               }
+
+               // user defined functions
+       }
+
+
 
 
-       public class Xcls_ScrolledWindow61 : Object
+       public class Xcls_ScrolledWindow63 : Object
        {
                public Gtk.ScrolledWindow el;
                private Xcls_MainWindow  _this;
@@ -2142,7 +2216,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_ScrolledWindow61(Xcls_MainWindow _owner )
+               public Xcls_ScrolledWindow63(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.ScrolledWindow();
@@ -2152,13 +2226,13 @@ public class Xcls_MainWindow : Object
                        // set gobject values
                        this.el.hexpand = true;
                        this.el.vexpand = true;
-                       var child_1 = new Xcls_ColumnView62( _this );
+                       var child_1 = new Xcls_ColumnView64( _this );
                        this.el.child = child_1.el;
                }
 
                // user defined functions
        }
-       public class Xcls_ColumnView62 : Object
+       public class Xcls_ColumnView64 : Object
        {
                public Gtk.ColumnView el;
                private Xcls_MainWindow  _this;
@@ -2167,10 +2241,10 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_ColumnView62(Xcls_MainWindow _owner )
+               public Xcls_ColumnView64(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_SingleSelection63( _this );
+                       var child_1 = new Xcls_SingleSelection65( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnView( child_1.el );
 
@@ -2179,15 +2253,16 @@ public class Xcls_MainWindow : Object
                        // set gobject values
                        this.el.hexpand = true;
                        this.el.vexpand = true;
-                       new Xcls_projcol( _this );
-                       this.el.append_column( _this.projcol.el );
+                       var child_2 = new Xcls_ColumnViewColumn73( _this );
+                       child_2.ref();
+                       this.el.append_column( child_2.el );
                        new Xcls_filecol( _this );
                        this.el.append_column ( _this.filecol.el  );
                }
 
                // user defined functions
        }
-       public class Xcls_SingleSelection63 : Object
+       public class Xcls_SingleSelection65 : Object
        {
                public Gtk.SingleSelection el;
                private Xcls_MainWindow  _this;
@@ -2196,10 +2271,10 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SingleSelection63(Xcls_MainWindow _owner )
+               public Xcls_SingleSelection65(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_SortListModel64( _this );
+                       var child_1 = new Xcls_SortListModel66( _this );
                        child_1.ref();
                        this.el = new Gtk.SingleSelection( child_1.el );
 
@@ -2212,7 +2287,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_SortListModel64 : Object
+       public class Xcls_SortListModel66 : Object
        {
                public Gtk.SortListModel el;
                private Xcls_MainWindow  _this;
@@ -2221,12 +2296,12 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SortListModel64(Xcls_MainWindow _owner )
+               public Xcls_SortListModel66(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_FilterListModel65( _this );
+                       var child_1 = new Xcls_FilterListModel67( _this );
                        child_1.ref();
-                       var child_2 = new Xcls_StringSorter69( _this );
+                       var child_2 = new Xcls_StringSorter71( _this );
                        child_2.ref();
                        this.el = new Gtk.SortListModel( child_1.el, child_2.el );
 
@@ -2237,7 +2312,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_FilterListModel65 : Object
+       public class Xcls_FilterListModel67 : Object
        {
                public Gtk.FilterListModel el;
                private Xcls_MainWindow  _this;
@@ -2246,7 +2321,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_FilterListModel65(Xcls_MainWindow _owner )
+               public Xcls_FilterListModel67(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        new Xcls_histmodel( _this );
@@ -2296,7 +2371,7 @@ public class Xcls_MainWindow : Object
                {
                        _this = _owner;
                        _this.histsearch = this;
-                       var child_1 = new Xcls_PropertyExpression68( _this );
+                       var child_1 = new Xcls_PropertyExpression70( _this );
                        child_1.ref();
                        this.el = new Gtk.StringFilter( child_1.el );
 
@@ -2307,7 +2382,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;
@@ -2316,7 +2391,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" );
@@ -2331,7 +2406,7 @@ public class Xcls_MainWindow : Object
 
 
 
-       public class Xcls_StringSorter69 : Object
+       public class Xcls_StringSorter71 : Object
        {
                public Gtk.StringSorter el;
                private Xcls_MainWindow  _this;
@@ -2340,10 +2415,10 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_StringSorter69(Xcls_MainWindow _owner )
+               public Xcls_StringSorter71(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       var child_1 = new Xcls_PropertyExpression70( _this );
+                       var child_1 = new Xcls_PropertyExpression72( _this );
                        child_1.ref();
                        this.el = new Gtk.StringSorter( child_1.el );
 
@@ -2355,7 +2430,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_PropertyExpression70 : Object
+       public class Xcls_PropertyExpression72 : Object
        {
                public Gtk.PropertyExpression el;
                private Xcls_MainWindow  _this;
@@ -2364,7 +2439,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_PropertyExpression70(Xcls_MainWindow _owner )
+               public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
@@ -2380,7 +2455,7 @@ public class Xcls_MainWindow : Object
 
 
 
-       public class Xcls_projcol : Object
+       public class Xcls_ColumnViewColumn73 : Object
        {
                public Gtk.ColumnViewColumn el;
                private Xcls_MainWindow  _this;
@@ -2389,25 +2464,23 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_projcol(Xcls_MainWindow _owner )
+               public Xcls_ColumnViewColumn73(Xcls_MainWindow _owner )
                {
                        _this = _owner;
-                       _this.projcol = this;
-                       var child_1 = new Xcls_SignalListItemFactory72( _this );
+                       var child_1 = new Xcls_SignalListItemFactory74( _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_SignalListItemFactory72 : Object
+       public class Xcls_SignalListItemFactory74 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_MainWindow  _this;
@@ -2416,7 +2489,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();
@@ -2465,7 +2538,7 @@ public class Xcls_MainWindow : Object
                {
                        _this = _owner;
                        _this.filecol = this;
-                       var child_1 = new Xcls_SignalListItemFactory74( _this );
+                       var child_1 = new Xcls_SignalListItemFactory76( _this );
                        child_1.ref();
                        this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
 
@@ -2479,7 +2552,7 @@ public class Xcls_MainWindow : Object
 
                // user defined functions
        }
-       public class Xcls_SignalListItemFactory74 : Object
+       public class Xcls_SignalListItemFactory76 : Object
        {
                public Gtk.SignalListItemFactory el;
                private Xcls_MainWindow  _this;
@@ -2488,7 +2561,7 @@ public class Xcls_MainWindow : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_SignalListItemFactory74(Xcls_MainWindow _owner )
+               public Xcls_SignalListItemFactory76(Xcls_MainWindow _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.SignalListItemFactory();