src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 23 Mar 2015 10:03:58 +0000 (18:03 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 23 Mar 2015 10:03:58 +0000 (18:03 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index 31c9416..3a57a68 100644 (file)
@@ -10,7 +10,7 @@
    "id" : "GtkView",
    "# Gtk.Widget lastObj" : "null",
    "| void createThumb" : "() {\n    \n    \n    if (this.file == null) {\n        return;\n    }\n    var filename = this.file.getIconFileName(false);\n    \n    var  win = this.el.get_parent_window();\n    var width = win.get_width();\n    var height = win.get_height();\n\n    Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n\n    screenshot.save(filename,\"png\");\n    return;\n    \n    \n    \n    \n    \n     \n    \n    // should we hold until it's printed...\n    \n      \n\n    \n    \n\n\n    \n     \n}\n",
-   "| void loadFile" : "(JsRender.JsRender file) \n{\n    \n        this.el.set_position((int)(this.el.max_position * 0.7));\n        this.file = null;\n        \n        if (file.tree == null) {\n            return;\n        }\n        this.file = file;\n        if (this.lastObj != null) {\n            this.container.el.remove(this.lastObj);\n        }\n        \n        // hide the compile view at present..\n        _this.compile_view.el.visible = false;\n        \n        \n        uint w,h;\n        \n        _this.view_layout.el.get_size(out w, out h);\n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = uint.min (w-20, 500);\n        h = uint.min (h-20, 500);        \n        _this.container.el.set_size_request((int)w,(int)h);\n        \n\tvar x = new JsRender.NodeToGtk(file.tree);\n        var obj = x.munge() as Gtk.Widget;\n        this.lastObj = null;\n\tif (obj == null) {\n        \treturn;\n\t}\n\tthis.lastObj = obj;\n        \n        this.container.el.add(obj);\n        obj.show_all();\n        \n         _this.compile_view.el.hide();\n        \n}\n ",
+   "| void loadFile" : "(JsRender.JsRender file) \n{\n    \n        this.el.set_position((int)(this.el.max_position * 0.7));\n        this.file = null;\n        \n        if (file.tree == null) {\n            return;\n        }\n        this.file = file;\n        if (this.lastObj != null) {\n            this.container.el.remove(this.lastObj);\n        }\n        \n        // hide the compile view at present..\n        _this.compile_button.el.hide();\n         _this.compile_view.el.hide();\n         \n        \n        uint w,h;\n        \n        _this.view_layout.el.get_size(out w, out h);\n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = uint.min (w-20, 500);\n        h = uint.min (h-20, 500);        \n        _this.container.el.set_size_request((int)w,(int)h);\n        \n\tvar x = new JsRender.NodeToGtk(file.tree);\n        var obj = x.munge() as Gtk.Widget;\n        this.lastObj = null;\n\tif (obj == null) {\n        \treturn;\n\t}\n\tthis.lastObj = obj;\n        \n        this.container.el.add(obj);\n        obj.show_all();\n        \n         \n        \n}\n ",
    "xtype" : "VPaned",
    "# JsRender.JsRender file" : "null",
    "$ xns" : "Gtk",
@@ -30,7 +30,6 @@
      ]
     },
     {
-     "id" : "compile_view",
      "* pack" : "pack2,true,true",
      "xtype" : "VBox",
      "gboolean homogeneous" : false,
index 519fc8d..a0499b0 100644 (file)
@@ -14,7 +14,6 @@ public class Xcls_GtkView : Object
     }
     public Xcls_view_layout view_layout;
     public Xcls_container container;
-    public Xcls_compile_view compile_view;
 
         // my vars (def)
     public Gtk.Widget lastObj;
@@ -34,7 +33,7 @@ public class Xcls_GtkView : Object
         var child_0 = new Xcls_view_layout( _this );
         child_0.ref();
         this.el.pack1 (  child_0.el , true,true );
-        var child_1 = new Xcls_compile_view( _this );
+        var child_1 = new Xcls_VBox4( _this );
         child_1.ref();
         this.el.pack2 (  child_1.el , true,true );
     }
@@ -89,8 +88,9 @@ public class Xcls_GtkView : Object
             }
             
             // hide the compile view at present..
-            _this.compile_view.el.visible = false;
-            
+            _this.compile_button.el.hide();
+             _this.compile_view.el.hide();
+             
             
             uint w,h;
             
@@ -112,7 +112,7 @@ public class Xcls_GtkView : Object
             this.container.el.add(obj);
             obj.show_all();
             
-             _this.compile_view.el.hide();
+             
             
     }
     public class Xcls_view_layout : Object 
@@ -162,7 +162,7 @@ public class Xcls_GtkView : Object
 
         // user defined functions 
     }
-    public class Xcls_compile_view : Object 
+    public class Xcls_VBox4 : Object 
     {
         public Gtk.VBox el;
         private Xcls_GtkView  _this;
@@ -171,10 +171,9 @@ public class Xcls_GtkView : Object
             // my vars (def)
 
         // ctor 
-        public Xcls_compile_view(Xcls_GtkView _owner )
+        public Xcls_VBox4(Xcls_GtkView _owner )
         {
             _this = _owner;
-            _this.compile_view = this;
             this.el = new Gtk.VBox( false, 0 );
 
             // my vars (dec)