resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / EditProject.vala
index 0203eec..af62627 100644 (file)
@@ -1,62 +1,43 @@
-/* -- to compile
-valac  --pkg gio-2.0  --pkg posix  --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0  --pkg  libwnck-3.0 \
-    /tmp/EditProject.vala  -o /tmp/EditProject
-*/
-
-
-/* -- to test class
-static int main (string[] args) {
-    Gtk.init (ref args);
-    new Xcls_EditProject();
-    EditProject.show_all();
-     Gtk.main ();
-    return 0;
-}
-*/
-
+static EditProject  _EditProject;
 
-public static Xcls_EditProject  EditProject;
-
-public class Xcls_EditProject : Object 
+public class EditProject : Object
 {
     public Gtk.Dialog el;
-    private Xcls_EditProject  _this;
+    private EditProject  _this;
 
-    public static Xcls_EditProject singleton()
+    public static EditProject singleton()
     {
-        if (EditProject == null) {
-            EditProject= new Xcls_EditProject();
+        if (_EditProject == null) {
+            _EditProject= new EditProject();
         }
-        return EditProject;
+        return _EditProject;
     }
     public Xcls_xtype xtype;
     public Xcls_cellrender cellrender;
     public Xcls_model model;
     public Xcls_dir dir;
 
-        // my vars
+        // my vars (def)
 
-        // ctor 
-    public Xcls_EditProject()
+    // ctor
+    public EditProject()
     {
         _this = this;
         this.el = new Gtk.Dialog();
 
-        // my vars
+        // my vars (dec)
 
         // set gobject values
+        this.el.title = "Project Properties";
+        this.el.name = "EditProject";
         this.el.border_width = 3;
         this.el.default_height = 500;
         this.el.default_width = 600;
         this.el.deletable = true;
         this.el.modal = true;
-        this.el.name = "EditProject";
-        this.el.title = "Project Properties";
-        var child_0 = new Xcls_VBox2( _this );
+        var child_0 = new Xcls_Box2( _this );
         child_0.ref();
-        this.el. get_content_area().add 
- (  child_0.el  );
+        this.el.get_content_area().add (  child_0.el  );
         var child_1 = new Xcls_Button9( _this );
         child_1.ref();
         this.el.add_action_widget (  child_1.el , 1 );
@@ -64,90 +45,90 @@ public class Xcls_EditProject : Object
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 0 );
 
-        // listeners 
-        this.el.destroy_event.connect(  (self, event) => {
-          this.el.response(0);
+        //listeners
+        this.el.destroy_event.connect( (self, event) => {
+               this.el.response(0);
         //     this.el.hide();
             return false;
-        } );
+        });
     }
 
-    // userdefined functions 
-    public Project.Project? show() {
-              
+    // user defined functions
+    public Project.Project? show () {
+          
+    
+        //[ 'xtype'  ].forEach(function(k) {
+        //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
+        //});
+       // shouild set path..
+        _this.model.loadData();
+        this.el.show_all();
         
-            //[ 'xtype'  ].forEach(function(k) {
-            //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
-            //});
-               // shouild set path..
-            _this.model.loadData();
-            this.el.show_all();
-            
-            var err_dialog = StandardErrorDialog.singleton();
-        
-            var id = -1;
-            while (id < 0) {
-                 id =  this.el.run();
-                 if (id < 1) {
-                        this.el.hide();
-                        return null;
+        var err_dialog = StandardErrorDialog.singleton();
+    
+        var id = -1;
+        while (id < 0) {
+             id =  this.el.run();
+             if (id < 1) {
+                    this.el.hide();
+                    return null;
+            }
+     
+             
+              if (_this.xtype.getValue().length < 1) {
+                   
+                    err_dialog.show(_this.el,"You have to set Project type");             
+                    id = -1;
+                    continue;
                 }
+                if (_this.dir.el.get_filename().length < 1) {
+     
+                    err_dialog.show(_this.el,"You have to select a folder");             
+                    id = -1;
+                    continue;
+                }
+               
+        }
         
-                 
-                  if (_this.xtype.getValue().length < 1) {
-                       
-                        err_dialog.show(_this.el,"You have to set Project type");             
-                        id = -1;
-                        continue;
-                    }
-                    if (_this.dir.el.get_filename().length < 1) {
-         
-                        err_dialog.show(_this.el,"You have to select a folder");             
-                        id = -1;
-                        continue;
-                    }
-                   
-            }
-            
-            this.el.hide();
-            
-            
-            
-         
-            var fn = _this.dir.el.get_filename();
-            print("add %s\n" , fn);
-            
-            var project = Project.Project.factory(_this.xtype.getValue(), fn);
-            project.save();
-            Project.projects.set(project.name,project);
-            
-            //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
-            
-            return project;
+        this.el.hide();
         
-            
-            //this.success = c.success;
-        }
-
-    // skip |xns - no return type
-    public class Xcls_VBox2 : Object 
+        
+        
+     
+        var fn = _this.dir.el.get_filename();
+        print("add %s\n" , fn);
+        
+        var project = Project.Project.factory(_this.xtype.getValue(), fn);
+        project.save();
+        Project.projects.set(project.name,project);
+        
+        //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
+        
+        return project;
+    
+        
+        //this.success = c.success;
+    }
+    public class Xcls_Box2 : Object
     {
-        public Gtk.VBox el;
-        private Xcls_EditProject  _this;
+        public Gtk.Box el;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_VBox2(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Box2(EditProject _owner )
         {
             _this = _owner;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_HBox3( _this );
+            this.el.homogeneous = false;
+            this.el.expand = true;
+            var child_0 = new Xcls_Box3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,true,3 );
             var child_1 = new Xcls_dir( _this );
@@ -155,27 +136,26 @@ public class Xcls_EditProject : Object
             this.el.pack_end (  child_1.el , true,true,5 );
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_HBox3 : Object 
+    public class Xcls_Box3 : Object
     {
-        public Gtk.HBox el;
-        private Xcls_EditProject  _this;
+        public Gtk.Box el;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_HBox3(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Box3(EditProject _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_Label4( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,true,3 );
@@ -184,49 +164,46 @@ public class Xcls_EditProject : Object
             this.el.pack_end (  child_1.el , true,true,3 );
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_Label4 : Object 
+    public class Xcls_Label4 : Object
     {
         public Gtk.Label el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Label4(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Label4(EditProject _owner )
         {
             _this = _owner;
             this.el = new Gtk.Label( "Project type :" );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_xtype : Object 
+
+    public class Xcls_xtype : Object
     {
         public Gtk.ComboBox el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_xtype(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_xtype(EditProject _owner )
         {
             _this = _owner;
             _this.xtype = this;
             this.el = new Gtk.ComboBox();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             var child_0 = new Xcls_cellrender( _this );
@@ -236,167 +213,162 @@ public class Xcls_EditProject : Object
             child_1.ref();
             this.el.set_model (  child_1.el  );
 
-            // init method 
-             this.el.add_attribute(_this.cellrender.el , "markup", 1 );  
-             
-        }
+            // init method
 
-        // userdefined functions 
+            this.el.add_attribute(_this.cellrender.el , "markup", 1 );
+        }
 
-        // skip |setValue - no return type
+        // user defined functions
         public string getValue () {
-                 var ix = this.el.get_active();
-                    if (ix < 0 ) {
-                        return "";
-                    }
-                    switch(ix) {
-                        case 0:
-                            return "Roo";
-                        case 1:
-                            return "Gtk";
-                    }
+             var ix = this.el.get_active();
+                if (ix < 0 ) {
                     return "";
-            }
-
-        // skip |xns - no return type
+                }
+                switch(ix) {
+                    case 0:
+                        return "Roo";
+                    case 1:
+                        return "Gtk";
+                }
+                return "";
+        }
     }
-    public class Xcls_cellrender : Object 
+    public class Xcls_cellrender : Object
     {
         public Gtk.CellRendererText el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_cellrender(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_cellrender(EditProject _owner )
         {
             _this = _owner;
             _this.cellrender = this;
             this.el = new Gtk.CellRendererText();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_model : Object 
+
+    public class Xcls_model : Object
     {
         public Gtk.ListStore el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_model(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_model(EditProject _owner )
         {
             _this = _owner;
             _this.model = this;
             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-        public void loadData  ( ) {
-                    this.el.clear();
-                                  
-                    Gtk.TreeIter iter;
-                            
-                    el.append(out iter);
-                    
-                    el.set_value(iter, 0, "Roo");
-                    el.set_value(iter, 1, "Roo Project");
-                     el.append(out iter);
-                    
-                    el.set_value(iter, 0, "Gtk");
-                    el.set_value(iter, 1, "Gtk Project");
-                     
-                          
-                                                 
-            }
-
-        // skip |xns - no return type
+        // user defined functions
+        public void loadData ( ) {
+                this.el.clear();
+                              
+                Gtk.TreeIter iter;
+                        
+                el.append(out iter);
+                
+                el.set_value(iter, 0, "Roo");
+                el.set_value(iter, 1, "Roo Project");
+                 el.append(out iter);
+                
+                el.set_value(iter, 0, "Gtk");
+                el.set_value(iter, 1, "Gtk Project");
+                 
+                      
+                                             
+        }
     }
-    public class Xcls_dir : Object 
+
+
+
+    public class Xcls_dir : Object
     {
         public Gtk.FileChooserWidget el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_dir(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_dir(EditProject _owner )
         {
             _this = _owner;
             _this.dir = this;
             this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
+            this.el.expand = true;
             this.el.create_folders = false;
             this.el.select_multiple = false;
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_Button9 : Object 
+
+
+    public class Xcls_Button9 : Object
     {
         public Gtk.Button el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Button9(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Button9(EditProject _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.label = "OK";
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_Button10 : Object 
+
+    public class Xcls_Button10 : Object
     {
         public Gtk.Button el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Button10(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Button10(EditProject _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.label = "Cancel";
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
+
 }