src/Builder4/ValaProjectSettings.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 28 Apr 2015 10:07:46 +0000 (18:07 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 28 Apr 2015 10:07:46 +0000 (18:07 +0800)
src/Builder4/ValaProjectSettings.vala

src/Builder4/ValaProjectSettings.bjs
src/Builder4/ValaProjectSettings.vala

index 9ec4fb8..d96b73c 100644 (file)
              ]
             }
            ]
-          }
-         ]
-        },
-        {
-         "xtype" : "Label",
-         "* pack" : "pack_start,false,false,0",
-         "$ xns" : "Gtk",
-         "utf8 label" : "Available Directories"
-        },
-        {
-         "* pack" : "pack_start,true,true,0",
-         "xtype" : "ScrolledWindow",
-         "$ xns" : "Gtk",
-         "items" : [
+          },
           {
-           "listeners" : {
-            "button_press_event" : " ( ev) => {\n    //console.log(\"button press?\");\n   \n    \n    if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {\n        //print(\"click\" + ev.type);\n        return false;\n    }\n    //Gtk.TreePath res;\n    //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n    //    return true;\n    //}\n     \n  //  this.el.get_selection().select_path(res);\n     \n      //if (!this.get('/LeftTreeMenu').el)  { \n      //      this.get('/LeftTreeMenu').init(); \n      //  }\n        \n     _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());\n     _this.default_directory_menu.el.show_all();\n      _this.default_directory_menu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}"
-           },
-           "gboolean headers_visible" : false,
-           "id" : "default_directory_tree",
-           "* pack" : "add",
-           "xtype" : "TreeView",
+           "* pack" : "pack_start,true,true,0",
+           "xtype" : "ScrolledWindow",
            "$ xns" : "Gtk",
            "items" : [
             {
-             "id" : "default_directory_tree_store",
-             "* pack" : "set_model",
-             "xtype" : "ListStore",
-             "$ n_columns" : 1,
-             "| void load" : "() {\n \n  this.el.clear();\n  \n    \n     var def = _this.project.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n \n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < items.size; i++) {\n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   items.get(i) ); // title \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n",
-             "$ columns" : "    typeof(string)\n     ",
-             "$ xns" : "Gtk"
-            },
-            {
-             "utf8 title" : "name",
-             "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n  ",
-             "* pack" : "append_column",
-             "xtype" : "TreeViewColumn",
-             "gboolean resizable" : true,
+             "listeners" : {
+              "button_press_event" : " ( ev) => {\n    //console.log(\"button press?\");\n   \n    \n    if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {\n        //print(\"click\" + ev.type);\n        return false;\n    }\n    //Gtk.TreePath res;\n    //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n    //    return true;\n    //}\n     \n  //  this.el.get_selection().select_path(res);\n     \n      //if (!this.get('/LeftTreeMenu').el)  { \n      //      this.get('/LeftTreeMenu').init(); \n      //  }\n        \n     _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());\n     _this.default_directory_menu.el.show_all();\n      _this.default_directory_menu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}"
+             },
+             "gboolean headers_visible" : false,
+             "id" : "default_directory_tree",
+             "* pack" : "add",
+             "xtype" : "TreeView",
              "$ xns" : "Gtk",
              "items" : [
               {
-               "id" : "directory_render",
-               "* pack" : "pack_start,false",
-               "xtype" : "CellRendererText",
+               "id" : "default_directory_tree_store",
+               "* pack" : "set_model",
+               "xtype" : "ListStore",
+               "$ n_columns" : 1,
+               "| void load" : "() {\n \n  this.el.clear();\n  \n    \n     var def = _this.project.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n \n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < items.size; i++) {\n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   items.get(i) ); // title \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n",
+               "$ columns" : "    typeof(string)\n     ",
                "$ xns" : "Gtk"
+              },
+              {
+               "utf8 title" : "name",
+               "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n  ",
+               "* pack" : "append_column",
+               "xtype" : "TreeViewColumn",
+               "gboolean resizable" : true,
+               "$ xns" : "Gtk",
+               "items" : [
+                {
+                 "id" : "directory_render",
+                 "* pack" : "pack_start,false",
+                 "xtype" : "CellRendererText",
+                 "$ xns" : "Gtk"
+                }
+               ]
               }
              ]
-            }
-           ]
-          },
-          {
-           "id" : "default_directory_menu",
-           "xtype" : "Menu",
-           "$ xns" : "Gtk",
-           "items" : [
-            {
-             "listeners" : {
-              "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
-             },
-             "* pack" : "add",
-             "xtype" : "MenuItem",
-             "$ xns" : "Gtk",
-             "utf8 label" : "Add Directory"
             },
             {
-             "listeners" : {
-              "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.OPEN ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
-             },
-             "* pack" : "add",
-             "xtype" : "MenuItem",
-             "$ xns" : "Gtk",
-             "utf8 label" : "Add File"
-            },
-            {
-             "* pack" : "add",
-             "xtype" : "SeparatorMenuItem",
-             "$ xns" : "Gtk"
-            },
-            {
-             "listeners" : {
-              "activate" : "()  => {\n    \n     //\n        Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {\n               print(\"nothing selected\\n\");\n            return;\n        }\n\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       print(\"remove: %s\\n\", fn);\n       if (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {\n                  print(\"remove failed\");\n              }\n       _this.default_directory_tree_store.load();\n}"
-             },
-             "* pack" : "add",
-             "xtype" : "MenuItem",
+             "id" : "default_directory_menu",
+             "xtype" : "Menu",
              "$ xns" : "Gtk",
-             "utf8 label" : "Remove File/Directory"
+             "items" : [
+              {
+               "listeners" : {
+                "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
+               },
+               "* pack" : "add",
+               "xtype" : "MenuItem",
+               "$ xns" : "Gtk",
+               "utf8 label" : "Add Directory"
+              },
+              {
+               "listeners" : {
+                "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.OPEN ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
+               },
+               "* pack" : "add",
+               "xtype" : "MenuItem",
+               "$ xns" : "Gtk",
+               "utf8 label" : "Add File"
+              },
+              {
+               "* pack" : "add",
+               "xtype" : "SeparatorMenuItem",
+               "$ xns" : "Gtk"
+              },
+              {
+               "listeners" : {
+                "activate" : "()  => {\n    \n     //\n        Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {\n               print(\"nothing selected\\n\");\n            return;\n        }\n\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       print(\"remove: %s\\n\", fn);\n       if (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {\n                  print(\"remove failed\");\n              }\n       _this.default_directory_tree_store.load();\n}"
+               },
+               "* pack" : "add",
+               "xtype" : "MenuItem",
+               "$ xns" : "Gtk",
+               "utf8 label" : "Remove File/Directory"
+              }
+             ]
             }
            ]
           }
          ]
+        },
+        {
+         "xtype" : "Label",
+         "* pack" : "pack_start,false,false,0",
+         "$ xns" : "Gtk",
+         "utf8 label" : "Available Directories"
         }
        ]
       },
index aec0dae..46bcd3c 100644 (file)
@@ -176,12 +176,9 @@ public class ValaProjectSettings : Object
             var child_3 = new Xcls_HBox9( _this );
             child_3.ref();
             this.el.pack_start (  child_3.el , true,true,0 );
-            var child_4 = new Xcls_Label17( _this );
+            var child_4 = new Xcls_Label27( _this );
             child_4.ref();
             this.el.pack_start (  child_4.el , false,false,0 );
-            var child_5 = new Xcls_ScrolledWindow18( _this );
-            child_5.ref();
-            this.el.pack_start (  child_5.el , true,true,0 );
         }
 
         // user defined functions 
@@ -280,6 +277,9 @@ public class ValaProjectSettings : Object
             var child_0 = new Xcls_ScrolledWindow10( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , true,true,0 );
+            var child_1 = new Xcls_ScrolledWindow17( _this );
+            child_1.ref();
+            this.el.pack_start (  child_1.el , true,true,0 );
         }
 
         // user defined functions 
@@ -516,28 +516,7 @@ public class ValaProjectSettings : Object
 
         // user defined functions 
     }
-    public class Xcls_Label17 : Object 
-    {
-        public Gtk.Label el;
-        private ValaProjectSettings  _this;
-
-
-            // my vars (def)
-
-        // ctor 
-        public Xcls_Label17(ValaProjectSettings _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Label( "Available Directories" );
-
-            // my vars (dec)
-
-            // set gobject values
-        }
-
-        // user defined functions 
-    }
-    public class Xcls_ScrolledWindow18 : Object 
+    public class Xcls_ScrolledWindow17 : Object 
     {
         public Gtk.ScrolledWindow el;
         private ValaProjectSettings  _this;
@@ -546,7 +525,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_ScrolledWindow18(ValaProjectSettings _owner )
+        public Xcls_ScrolledWindow17(ValaProjectSettings _owner )
         {
             _this = _owner;
             this.el = new Gtk.ScrolledWindow( null, null );
@@ -585,7 +564,7 @@ public class ValaProjectSettings : Object
             var child_0 = new Xcls_default_directory_tree_store( _this );
             child_0.ref();
             this.el.set_model (  child_0.el  );
-            var child_1 = new Xcls_TreeViewColumn21( _this );
+            var child_1 = new Xcls_TreeViewColumn20( _this );
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
@@ -662,7 +641,7 @@ public class ValaProjectSettings : Object
             
         }
     }
-    public class Xcls_TreeViewColumn21 : Object 
+    public class Xcls_TreeViewColumn20 : Object 
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -671,7 +650,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_TreeViewColumn21(ValaProjectSettings _owner )
+        public Xcls_TreeViewColumn20(ValaProjectSettings _owner )
         {
             _this = _owner;
             this.el = new Gtk.TreeViewColumn();
@@ -732,23 +711,23 @@ public class ValaProjectSettings : Object
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_MenuItem24( _this );
+            var child_0 = new Xcls_MenuItem23( _this );
             child_0.ref();
             this.el.add (  child_0.el  );
-            var child_1 = new Xcls_MenuItem25( _this );
+            var child_1 = new Xcls_MenuItem24( _this );
             child_1.ref();
             this.el.add (  child_1.el  );
-            var child_2 = new Xcls_SeparatorMenuItem26( _this );
+            var child_2 = new Xcls_SeparatorMenuItem25( _this );
             child_2.ref();
             this.el.add (  child_2.el  );
-            var child_3 = new Xcls_MenuItem27( _this );
+            var child_3 = new Xcls_MenuItem26( _this );
             child_3.ref();
             this.el.add (  child_3.el  );
         }
 
         // user defined functions 
     }
-    public class Xcls_MenuItem24 : Object 
+    public class Xcls_MenuItem23 : Object 
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -757,7 +736,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_MenuItem24(ValaProjectSettings _owner )
+        public Xcls_MenuItem23(ValaProjectSettings _owner )
         {
             _this = _owner;
             this.el = new Gtk.MenuItem();
@@ -790,7 +769,7 @@ public class ValaProjectSettings : Object
 
         // user defined functions 
     }
-    public class Xcls_MenuItem25 : Object 
+    public class Xcls_MenuItem24 : Object 
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -799,7 +778,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_MenuItem25(ValaProjectSettings _owner )
+        public Xcls_MenuItem24(ValaProjectSettings _owner )
         {
             _this = _owner;
             this.el = new Gtk.MenuItem();
@@ -832,7 +811,7 @@ public class ValaProjectSettings : Object
 
         // user defined functions 
     }
-    public class Xcls_SeparatorMenuItem26 : Object 
+    public class Xcls_SeparatorMenuItem25 : Object 
     {
         public Gtk.SeparatorMenuItem el;
         private ValaProjectSettings  _this;
@@ -841,7 +820,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_SeparatorMenuItem26(ValaProjectSettings _owner )
+        public Xcls_SeparatorMenuItem25(ValaProjectSettings _owner )
         {
             _this = _owner;
             this.el = new Gtk.SeparatorMenuItem();
@@ -853,7 +832,7 @@ public class ValaProjectSettings : Object
 
         // user defined functions 
     }
-    public class Xcls_MenuItem27 : Object 
+    public class Xcls_MenuItem26 : Object 
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -862,7 +841,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_MenuItem27(ValaProjectSettings _owner )
+        public Xcls_MenuItem26(ValaProjectSettings _owner )
         {
             _this = _owner;
             this.el = new Gtk.MenuItem();
@@ -901,6 +880,27 @@ public class ValaProjectSettings : Object
 
         // user defined functions 
     }
+    public class Xcls_Label27 : Object 
+    {
+        public Gtk.Label el;
+        private ValaProjectSettings  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_Label27(ValaProjectSettings _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.Label( "Available Directories" );
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions 
+    }
     public class Xcls_HPaned28 : Object 
     {
         public Gtk.HPaned el;