Attribute changed old-javascript
[app.Builder.js] / old-javascript / XObjectBase / GdlDockItem.js
diff --git a/old-javascript/XObjectBase/GdlDockItem.js b/old-javascript/XObjectBase/GdlDockItem.js
new file mode 100644 (file)
index 0000000..4e18f33
--- /dev/null
@@ -0,0 +1,51 @@
+
+//<Script type="Text/javascript">
+
+XObject = imports.XObject.XObject
+Gdl     = imports.gi.Gdl;
+// Cell render text..
+
+GdlDockItem = XObject.define(
+    function(cfg) {
+        XObject.call(this, cfg);
+    }, 
+    XObject,
+    {
+        
+        placement :  Gdl.DockPlacement.TOP,
+        behaviour : 0,
+        // name / long name...
+        
+        pack : function(parent, item) 
+        {
+            if (XObject.type(parent.el) == 'GdlDock') {
+                parent.el.add_item (this.el, this.placement || Gdl.DockPlacement.TOP);
+                return;
+            }
+            // otherwise 
+            parent.el.dock_to (this.el, this.placement || Gdl.DockPlacement.TOP, -1);
+            //     dock.add_item (item2, Gdl.DockPlacement.RIGHT);
+            
+            
+        },
+        init : function()
+        {
+            GdlDockItem.id = GdlDockItem.id ? GdlDockItem.id + 1 : 1;
+            
+            //new Gdl.DockItem.with_stock  ("item3",
+            //             "Item #3 has accented characters ( )",
+            //             Gtk.STOCK_CONVERT,
+            //             Gdl.DockItemBehavior.NORMAL | Gdl.DockItemBehavior.CANT_CLOSE);
+            
+            
+            this.el = new Gdl.GdlDockItem.c_new (
+                this.name       || 'Dock' + GdlDockItem.id, 
+                this.long_name  || 'Dock' + GdlDockItem.id, 
+                this.behaviour  || 0 //Gdl.DockItemBehavior.LOCKED
+            );
+            
+            
+            XObject.prototype.init.call(this);
+        }
+    }
+}; 
\ No newline at end of file