resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / DialogNewComponent.vala
index bca2056..ff65b70 100644 (file)
@@ -18,6 +18,9 @@ public class Xcls_DialogNewComponent : Object
     public Xcls_parent parent;
     public Xcls_permname permname;
     public Xcls_modOrder modOrder;
+    public Xcls_build_module build_module;
+    public Xcls_dbcellrenderer dbcellrenderer;
+    public Xcls_dbmodel dbmodel;
 
         // my vars (def)
     public signal void success (Project.Project pr, JsRender.JsRender file);
@@ -42,10 +45,10 @@ public class Xcls_DialogNewComponent : Object
         var child_0 = new Xcls_VBox2( _this );
         child_0.ref();
         this.el.get_content_area().add (  child_0.el  );
-        var child_1 = new Xcls_Button16( _this );
+        var child_1 = new Xcls_Button20( _this );
         child_1.ref();
         this.el.add_action_widget (  child_1.el , 0 );
-        var child_2 = new Xcls_Button17( _this );
+        var child_2 = new Xcls_Button21( _this );
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 1 );
 
@@ -173,6 +176,20 @@ public class Xcls_DialogNewComponent : Object
             if (_this.file.name.length  > 0 && _this.file.name != _this.name.el.get_text()) {
                 _this.file.renameTo(_this.name.el.get_text());
             }
+            // store the module...
+            _this.file.build_module = "";        
+             Gtk.TreeIter iter; 
+            if (_this.build_module.el.get_active_iter (out iter)) {
+                 Value vfname;
+                 this.dbmodel.el.get_value (iter, 0, out vfname);
+                 if (((string)vfname).length > 0) {
+                     _this.file.build_module = (string)vfname;
+                 }
+        
+            }
+            
+            
+    
                                                         
     }
     public   void show (JsRender.JsRender c) 
@@ -195,6 +212,26 @@ public class Xcls_DialogNewComponent : Object
         } else {
             this.el.set_title("Create New File");
         }
+        
+         var ar = new Gee.ArrayList<string>();
+         _this.dbmodel.loadData(ar,"");
+        // load the modules... if relivant..
+        if (this.project.xtype == "Gtk") {
+            var p = (Project.Gtk)c.project;
+              var cg = p.compilegroups;
+    
+            var iter = cg.map_iterator();
+           while(iter.next()) {
+                var key = iter.get_key();
+                if (key == "_default_") {
+                    continue;
+                }
+                ar.add(key);
+            };
+            _this.dbmodel.loadData(ar, c.build_module);
+    
+        }
+        
          
         _this.file = c;
         //console.log('show all');
@@ -281,6 +318,12 @@ public class Xcls_DialogNewComponent : Object
             var child_11 = new Xcls_modOrder( _this );
             child_11.ref();
             this.el.attach_defaults (  child_11.el , 1,2,5,6 );
+            var child_12 = new Xcls_Label16( _this );
+            child_12.ref();
+            this.el.attach_defaults (  child_12.el , 0,1,6,7 );
+            var child_13 = new Xcls_build_module( _this );
+            child_13.ref();
+            this.el.attach_defaults (  child_13.el , 1,2,6,7 );
         }
 
         // user defined functions 
@@ -567,7 +610,141 @@ public class Xcls_DialogNewComponent : Object
 
         // user defined functions 
     }
-    public class Xcls_Button16 : Object 
+    public class Xcls_Label16 : Object 
+    {
+        public Gtk.Label el;
+        private Xcls_DialogNewComponent  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_Label16(Xcls_DialogNewComponent _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.Label( "Module to build (Vala only)" );
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.justify = Gtk.Justification.RIGHT;
+            this.el.xalign = 0.900000f;
+            this.el.visible = true;
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_build_module : Object 
+    {
+        public Gtk.ComboBox el;
+        private Xcls_DialogNewComponent  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_build_module(Xcls_DialogNewComponent _owner )
+        {
+            _this = _owner;
+            _this.build_module = this;
+            this.el = new Gtk.ComboBox();
+
+            // my vars (dec)
+
+            // set gobject values
+            var child_0 = new Xcls_dbcellrenderer( _this );
+            child_0.ref();
+            this.el.pack_start (  child_0.el , true );
+            var child_1 = new Xcls_dbmodel( _this );
+            child_1.ref();
+            this.el.set_model (  child_1.el  );
+
+            // init method 
+
+            this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_dbcellrenderer : Object 
+    {
+        public Gtk.CellRendererText el;
+        private Xcls_DialogNewComponent  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
+        {
+            _this = _owner;
+            _this.dbcellrenderer = this;
+            this.el = new Gtk.CellRendererText();
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions 
+    }
+    public class Xcls_dbmodel : Object 
+    {
+        public Gtk.ListStore el;
+        private Xcls_DialogNewComponent  _this;
+
+
+            // my vars (def)
+
+        // ctor 
+        public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
+        {
+            _this = _owner;
+            _this.dbmodel = this;
+            this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions 
+        public void loadData (Gee.ArrayList<string> data, string cur) {
+            this.el.clear();                                    
+            Gtk.TreeIter iter;
+            var el = this.el;
+            
+           /// el.append(out iter);
+            
+             
+           // el.set_value(iter, 0, "");
+           // el.set_value(iter, 1, "aaa  - Just add Element - aaa");
+        
+            el.append(out iter);
+        
+            
+            el.set_value(iter, 0, "");
+            el.set_value(iter, 1, "-- select a module --");
+            _this.build_module.el.set_active_iter(iter);
+            
+            for (var i = 0; i < data.size;i++) {
+            
+        
+                el.append(out iter);
+                
+                el.set_value(iter, 0, data.get(i));
+                el.set_value(iter, 1, data.get(i));
+                
+                if (data.get(i) == cur) {
+                    _this.build_module.el.set_active_iter(iter);
+                }
+                
+            }
+             this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
+                                             
+        }
+    }
+    public class Xcls_Button20 : Object 
     {
         public Gtk.Button el;
         private Xcls_DialogNewComponent  _this;
@@ -576,7 +753,7 @@ public class Xcls_DialogNewComponent : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_Button16(Xcls_DialogNewComponent _owner )
+        public Xcls_Button20(Xcls_DialogNewComponent _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
@@ -589,7 +766,7 @@ public class Xcls_DialogNewComponent : Object
 
         // user defined functions 
     }
-    public class Xcls_Button17 : Object 
+    public class Xcls_Button21 : Object 
     {
         public Gtk.Button el;
         private Xcls_DialogNewComponent  _this;
@@ -598,7 +775,7 @@ public class Xcls_DialogNewComponent : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_Button17(Xcls_DialogNewComponent _owner )
+        public Xcls_Button21(Xcls_DialogNewComponent _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();