resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / DialogNewComponent.vala
index 6a75c27..ff65b70 100644 (file)
@@ -18,7 +18,9 @@ public class Xcls_DialogNewComponent : Object
     public Xcls_parent parent;
     public Xcls_permname permname;
     public Xcls_modOrder modOrder;
-    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);
@@ -43,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_Button18( _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_Button19( _this );
+        var child_2 = new Xcls_Button21( _this );
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 1 );
 
@@ -174,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) 
@@ -196,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');
@@ -285,9 +321,9 @@ public class Xcls_DialogNewComponent : Object
             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_modOrder( _this );
+            var child_13 = new Xcls_build_module( _this );
             child_13.ref();
-            this.el.attach_defaults (  child_13.el , 1,2,5,6 );
+            this.el.attach_defaults (  child_13.el , 1,2,6,7 );
         }
 
         // user defined functions 
@@ -598,30 +634,117 @@ public class Xcls_DialogNewComponent : Object
 
         // user defined functions 
     }
-    public class Xcls_modOrder : Object 
+    public class Xcls_build_module : Object 
     {
-        public Gtk.Entry el;
+        public Gtk.ComboBox el;
         private Xcls_DialogNewComponent  _this;
 
 
             // my vars (def)
 
         // ctor 
-        public Xcls_modOrder(Xcls_DialogNewComponent _owner )
+        public Xcls_build_module(Xcls_DialogNewComponent _owner )
         {
             _this = _owner;
-            _this.modOrder = this;
-            this.el = new Gtk.Entry();
+            _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
-            this.el.visible = true;
         }
 
         // user defined functions 
     }
-    public class Xcls_Button18 : Object 
+    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;
@@ -630,7 +753,7 @@ public class Xcls_DialogNewComponent : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_Button18(Xcls_DialogNewComponent _owner )
+        public Xcls_Button20(Xcls_DialogNewComponent _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
@@ -643,7 +766,7 @@ public class Xcls_DialogNewComponent : Object
 
         // user defined functions 
     }
-    public class Xcls_Button19 : Object 
+    public class Xcls_Button21 : Object 
     {
         public Gtk.Button el;
         private Xcls_DialogNewComponent  _this;
@@ -652,7 +775,7 @@ public class Xcls_DialogNewComponent : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_Button19(Xcls_DialogNewComponent _owner )
+        public Xcls_Button21(Xcls_DialogNewComponent _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();