dbgenerate.js
[app.Builder.js] / XObjectBase / GdlDockItem.js
index e354d0b..4e18f33 100644 (file)
@@ -11,11 +11,40 @@ GdlDockItem = XObject.define(
     }, 
     XObject,
     {
-        pack : 'pack_start',
+        
+        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()
         {
-            this.el = new Gdl.GdlDockItem.c_new ("item1", "Item #1", Gdl.DockItemBehavior.LOCKED);
-            this.layout = new Gdl.DockLayout.c_new (dock);
+            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);
         }
     }